Search Results for

    Show / Hide Table of Contents

    Class OpenXMLConnector

    Connector that stores all the files into a unique .PNP OpenXML package

    Inheritance
    System.Object
    FileConnectorBase
    OpenXMLConnector
    Inherited Members
    FileConnectorBase.CONNECTIONSTRING
    FileConnectorBase.CONTAINER
    FileConnectorBase.Parameters
    FileConnectorBase.AddParameterAsString(String, String)
    FileConnectorBase.AddParameter(String, Object)
    Namespace: PnP.Framework.Provisioning.Connectors
    Assembly: PnP.Framework.dll
    Syntax
    public class OpenXMLConnector : FileConnectorBase, ICommitableFileConnector

    Constructors

    OpenXMLConnector(Stream)

    OpenXMLConnector constructor. Allows to manage a .PNP OpenXML package through an in memory stream.

    Declaration
    public OpenXMLConnector(Stream packageStream)
    Parameters
    Stream packageStream

    The package stream

    OpenXMLConnector(String, FileConnectorBase, String, X509Certificate2, String)

    OpenXMLConnector constructor. Allows to manage a .PNP OpenXML package file through a supporting persistence connector.

    Declaration
    public OpenXMLConnector(string packageFileName, FileConnectorBase persistenceConnector, string author = null, X509Certificate2 signingCertificate = null, string templateFileName = null)
    Parameters
    System.String packageFileName

    The name of the .PNP package file. If the .PNP extension is missing, it will be added

    FileConnectorBase persistenceConnector

    The FileConnector object that will be used for physical persistence of the file

    System.String author

    The Author of the .PNP package file, if any. Optional

    X509Certificate2 signingCertificate

    The X.509 certificate to use for digital signature of the template, optional

    System.String templateFileName

    The name of the tempalte file, optional

    Properties

    Info

    Declaration
    public PnPInfo Info { get; }
    Property Value
    PnPInfo

    Methods

    Commit()

    Commits the file

    Declaration
    public void Commit()
    Implements
    ICommitableFileConnector.Commit()

    DeleteFile(String)

    Deletes a file from the default container

    Declaration
    public override void DeleteFile(string fileName)
    Parameters
    System.String fileName

    Name of the file to delete

    Overrides
    FileConnectorBase.DeleteFile(String)

    DeleteFile(String, String)

    Deletes a file from the specified container

    Declaration
    public override void DeleteFile(string fileName, string container)
    Parameters
    System.String fileName

    Name of the file to delete

    System.String container

    Name of the container to delete the file from

    Overrides
    FileConnectorBase.DeleteFile(String, String)

    GetFile(String)

    Gets a file as string from the default container

    Declaration
    public override string GetFile(string fileName)
    Parameters
    System.String fileName

    Name of the file to get

    Returns
    System.String

    String containing the file contents

    Overrides
    FileConnectorBase.GetFile(String)

    GetFile(String, String)

    Gets a file as string from the specified container

    Declaration
    public override string GetFile(string fileName, string container)
    Parameters
    System.String fileName

    Name of the file to get

    System.String container

    Name of the container to get the file from

    Returns
    System.String

    String containing the file contents

    Overrides
    FileConnectorBase.GetFile(String, String)

    GetFilenamePart(String)

    Returns a filename without a path

    Declaration
    public override string GetFilenamePart(string fileName)
    Parameters
    System.String fileName

    Name of the file to get

    Returns
    System.String

    Returns a filename without a path

    Overrides
    FileConnectorBase.GetFilenamePart(String)

    GetFiles()

    Get the files available in the default container

    Declaration
    public override List<String> GetFiles()
    Returns
    List<String>

    List of files

    Overrides
    FileConnectorBase.GetFiles()

    GetFiles(String)

    Get the files available in the specified container

    Declaration
    public override List<string> GetFiles(string container)
    Parameters
    System.String container

    Name of the container to get the files from (something like: "\images\subfolder")

    Returns
    List<System.String>

    List of files

    Overrides
    FileConnectorBase.GetFiles(String)

    GetFileStream(String)

    Gets a file as stream from the default container

    Declaration
    public override Stream GetFileStream(string fileName)
    Parameters
    System.String fileName

    Name of the file to get

    Returns
    Stream

    String containing the file contents

    Overrides
    FileConnectorBase.GetFileStream(String)

    GetFileStream(String, String)

    Gets a file as stream from the specified container

    Declaration
    public override Stream GetFileStream(string fileName, string container)
    Parameters
    System.String fileName

    Name of the file to get

    System.String container

    Name of the container to get the file from

    Returns
    Stream

    String containing the file contents

    Overrides
    FileConnectorBase.GetFileStream(String, String)

    GetFolders()

    Get the folders of the default container

    Declaration
    public override List<string> GetFolders()
    Returns
    List<System.String>

    List of folders

    Overrides
    FileConnectorBase.GetFolders()

    GetFolders(String)

    Get the folders of a specified container

    Declaration
    public override List<string> GetFolders(string container)
    Parameters
    System.String container

    Name of the container to get the folders from

    Returns
    List<System.String>

    List of folders

    Overrides
    FileConnectorBase.GetFolders(String)

    SaveFileStream(String, Stream)

    Saves a stream to the default container with the given name. If the file exists it will be overwritten

    Declaration
    public override void SaveFileStream(string fileName, Stream stream)
    Parameters
    System.String fileName

    Name of the file to save

    Stream stream

    Stream containing the file contents

    Overrides
    FileConnectorBase.SaveFileStream(String, Stream)

    SaveFileStream(String, String, Stream)

    Saves a stream to the specified container with the given name. If the file exists it will be overwritten

    Declaration
    public override void SaveFileStream(string fileName, string container, Stream stream)
    Parameters
    System.String fileName

    Name of the file to save

    System.String container

    Name of the container to save the file to

    Stream stream

    Stream containing the file contents

    Overrides
    FileConnectorBase.SaveFileStream(String, String, Stream)

    Extension Methods

    ValidationExtensions.ValidateNotNullOrEmpty<T>(T, String)
    ObjectExtensions.Set<TObject, T>(TObject, Expression<Func<TObject, T>>, T, Boolean, Boolean)
    ObjectExtensions.GetPublicInstancePropertyValue(Object, String)
    ObjectExtensions.GetPublicInstanceProperty(Object, String)
    ObjectExtensions.SetPublicInstancePropertyValue(Object, String, Object)
    Extensions.ToByteArray(Object)
    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer