public void Deconstruct( out ContentItem item, out LanguageVariant variant ) { item = Item ?? throw new ArgumentNullException(nameof(Item)); variant = Variant ?? throw new ArgumentNullException(nameof(Variant)); }
public void Deconstruct( out Reference languageReference, out LanguageVariant variant ) { languageReference = LanguageReference ?? throw new ArgumentNullException(nameof(LanguageReference)); variant = Variant ?? throw new ArgumentNullException(nameof(Variant)); }
public void Deconstruct( out string codename, out LanguageVariant variant ) { codename = Codename ?? throw new ArgumentNullException(nameof(Codename)); variant = Variant ?? throw new ArgumentNullException(nameof(Variant)); }
public override bool Equals(object other) { if (!(other is IPage) || !base.Equals(other)) { return false; } return LanguageVariant.Equals(((IPage) other).LanguageVariant); }
public void Deconstruct( out Guid itemId, out string language, out LanguageVariant variant ) { itemId = ItemId; language = Language ?? throw new ArgumentNullException(nameof(Language)); variant = Variant ?? throw new ArgumentNullException(nameof(Variant)); }
private static LanguageVariant GetNewTransferLanguageVariant(CreateTransferItemParameters createTransferItemParameters) { var(_, customer, fields) = createTransferItemParameters; var variant = new LanguageVariant { Elements = { new CustomElement { Element = new Reference { Codename = "info" }, Value = CoreHelper.Serialize(new { customer }) }, new RichTextElement { Element = new Reference { Codename = "fields" } } } }; if (variant.Elements[1] is RichTextElement richTextElement) { var fieldHtmlBuilder = new StringBuilder(); if (fields != default) { foreach (var field in fields) { AbstractComponent?component = default; switch (field.Type) { case Field.heading: component = new HeadingComponent(field); break; case Field.write_text: component = new WriteTextComponent(field); break; case Field.upload_file: component = new UploadFileComponent(field); break; case Field.download_asset: component = new DownloadAssetComponent(field); break; } if (component != default) { fieldHtmlBuilder.Append($"<object type=\"application/kenticocloud\" data-type=\"component\" data-id=\"{component.Id}\"></object>"); richTextElement.Components.Add(component); } } } fieldHtmlBuilder.Append("<p><br/></p>"); richTextElement.Value = fieldHtmlBuilder.ToString(); } return(variant); }
public override int GetHashCode() { return Guid.GetHashCode() + 3 * LanguageVariant.GetHashCode(); }