menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CustomDocumentProperties - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CustomDocumentProperties

    Represents the custom document properties for the specified document.

    Inheritance
    System.Object
    OwnerHolder
    XDLSSerializableBase
    CustomDocumentProperties
    Implements
    IXDLSSerializable
    Inherited Members
    OwnerHolder.Document
    OwnerHolder.m_doc
    XDLSSerializableBase.CloneImpl()
    XDLSSerializableBase.InitXDLSHolder()
    XDLSSerializableBase.IXDLSSerializable.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.IXDLSSerializable.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.IXDLSSerializable.RestoreReference(String, Int32)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.IXDLSSerializable.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.IXDLSSerializable.XDLSHolder
    XDLSSerializableBase.ReadXmlAttributes(IXDLSAttributeReader)
    XDLSSerializableBase.ReadXmlContent(IXDLSContentReader)
    XDLSSerializableBase.RestoreReference(String, Int32)
    XDLSSerializableBase.WriteXmlAttributes(IXDLSAttributeWriter)
    XDLSSerializableBase.WriteXmlContent(IXDLSContentWriter)
    XDLSSerializableBase.XDLSHolder
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class CustomDocumentProperties : XDLSSerializableBase, IXDLSSerializable
    Examples
    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Load an existing Word document into DocIO instance
        WordDocument document = new WordDocument("Template.docx");
        //Add the new custom property Typist with value
        document.CustomDocumentProperties.Add("Typist", "Andrew");
        //Add the new custom property Publisher with value
        document.CustomDocumentProperties.Add("Publisher", "Stephen");
        //Add the new custom property Recorded by with value
        document.CustomDocumentProperties.Add("Recorded by", "Harry");
        //Add the new custom property Recorded date with value
        document.CustomDocumentProperties.Add("Recorded date", new DateTime(2015, 2, 23));
        //Save and close the Word document
        document.Save("Result.docx", FormatType.Docx);
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Load an existing Word document into DocIO instance
        Dim document As New WordDocument("Template.docx")
        'Add the new custom property Typist with value
        document.CustomDocumentProperties.Add("Typist", "Andrew")
        'Add the new custom property Publisher with value
        document.CustomDocumentProperties.Add("Publisher", "Stephen")
        'Add the new custom property Recorded by with value
        document.CustomDocumentProperties.Add("Recorded by", "Harry")
        'Add the new custom property Recorded date with value
        document.CustomDocumentProperties.Add("Recorded date", New DateTime(2015, 2, 23))
        'Save and close the Word document
        document.Save("Result.docx", FormatType.Docx)
        document.Close()
    End Sub

    Fields

    m_customList

    Sorted list of properties

    Declaration
    protected Dictionary<string, DocumentProperty> m_customList
    Field Value
    Type
    System.Collections.Generic.Dictionary<System.String, DocumentProperty>

    Properties

    Count

    Gets the total number of custom properties in the document. Read-only.

    Declaration
    public int Count { get; }
    Property Value
    Type
    System.Int32

    Item[Int32]

    Gets the custom property by specified index. Read-only.

    Declaration
    public DocumentProperty this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type
    DocumentProperty

    Item[String]

    Gets the custom property by specified name. Read-only.

    Declaration
    public DocumentProperty this[string name] { get; }
    Parameters
    Type Name Description
    System.String name
    Property Value
    Type
    DocumentProperty

    Methods

    Add(String, Object)

    Adds the new custom document property with specified name and its value.

    Declaration
    public DocumentProperty Add(string name, object value)
    Parameters
    Type Name Description
    System.String name

    A String that represents the name of the property to add.

    System.Object value

    The value for the property.

    Returns
    Type Description
    DocumentProperty

    The new DocumentProperty this method creates.

    Clone()

    Creates a duplicate copy of this CustomDocumentProperties

    Declaration
    public CustomDocumentProperties Clone()
    Returns
    Type Description
    CustomDocumentProperties

    The newly created duplicate copy of the current CustomDocumentProperties instance

    Remove(String)

    Removes the specified custom property from the document.

    Declaration
    public void Remove(string name)
    Parameters
    Type Name Description
    System.String name

    A String that represents the name of the property.

    Exceptions
    Type Condition
    System.ArgumentNullException

    The specified property is not present in the document.

    Implements

    IXDLSSerializable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved