Search Results for

    Show / Hide Table of Contents

    Class RepositoryManager

    Class to manage all scripts in the simplic database.

    Inheritance
    System.Object
    RepositoryManager
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Framework.Repository
    Assembly: Simplic.Framework.Repository.dll
    Syntax
    public class RepositoryManager

    Properties

    | Improve this Doc View Source

    IsLocalRepository

    Defines wether the current application instance use a local repository

    Declaration
    public bool IsLocalRepository { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LocalRepositoryPath

    Get path to the local repository

    Declaration
    public string LocalRepositoryPath { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Singleton

    Singleton access to the script repository.

    Declaration
    public static RepositoryManager Singleton { get; }
    Property Value
    Type Description
    RepositoryManager

    Methods

    | Improve this Doc View Source

    CalculatePath(Guid)

    Get path of the directory

    Declaration
    public string CalculatePath(Guid directory)
    Parameters
    Type Name Description
    System.Guid directory

    Guid of the directory to the path which will should be returned

    Returns
    Type Description
    System.String

    Path to the directory

    | Improve this Doc View Source

    CopyFile(RepositoryFileInfo, String, String, RepositoryManager.HandleOverrideFileOnMove)

    Copy one file from one path to another

    Declaration
    public RepositoryFileInfo CopyFile(RepositoryFileInfo toCopy, string newPath, string newName, RepositoryManager.HandleOverrideFileOnMove overrideHandler = null)
    Parameters
    Type Name Description
    RepositoryFileInfo toCopy

    File which will be copied

    System.String newPath

    Target path of the move process

    System.String newName
    RepositoryManager.HandleOverrideFileOnMove overrideHandler
    Returns
    Type Description
    RepositoryFileInfo
    | Improve this Doc View Source

    CreateDirectoryIfNotExists(String)

    Create a directory by path if it not exists

    Declaration
    public IList<RepositoryDirectoryInfo> CreateDirectoryIfNotExists(string path)
    Parameters
    Type Name Description
    System.String path

    Path to the directory

    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryDirectoryInfo>

    List of created directories, ordered by the creation time

    | Improve this Doc View Source

    CreateRepositoryContent(Guid, String)

    Create RepositoryContentModel

    Declaration
    public RepositoryFileInfo CreateRepositoryContent(Guid id, string path)
    Parameters
    Type Name Description
    System.Guid id

    Id of the script

    System.String path

    Path to the script

    Returns
    Type Description
    RepositoryFileInfo

    Model instance

    | Improve this Doc View Source

    DeleteFromDatabase(RepositoryFileInfo)

    Delete repository entry by model instance

    Declaration
    public void DeleteFromDatabase(RepositoryFileInfo model)
    Parameters
    Type Name Description
    RepositoryFileInfo model

    Instance of repository model

    | Improve this Doc View Source

    DeleteFromDatabase(Guid)

    Delete repository entry by id

    Declaration
    public void DeleteFromDatabase(Guid id)
    Parameters
    Type Name Description
    System.Guid id
    | Improve this Doc View Source

    DeleteFromDatabase(String)

    Delete repository entry by fullPath

    Declaration
    public void DeleteFromDatabase(string fullPath)
    Parameters
    Type Name Description
    System.String fullPath

    FullPath of the entry

    | Improve this Doc View Source

    GetAll()

    Get all scripts in the repository

    Declaration
    public IList<RepositoryFileInfo> GetAll()
    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryFileInfo>

    List with repository entries

    | Improve this Doc View Source

    GetByContentType(String, Boolean)

    Get every thing of a content type in the repository

    Declaration
    public IList<RepositoryFileInfo> GetByContentType(string contentType, bool ignoreLocalRepository = false)
    Parameters
    Type Name Description
    System.String contentType

    ContentType of the document

    System.Boolean ignoreLocalRepository

    Defines whether to ignore local repository or not

    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryFileInfo>

    List of instances of RepositoryContentModel

    | Improve this Doc View Source

    GetByGuidFromDatabase(Guid)

    Get an instance of a RepositoryContentModel

    Declaration
    public RepositoryFileInfo GetByGuidFromDatabase(Guid id)
    Parameters
    Type Name Description
    System.Guid id

    Unique id of the script content

    Returns
    Type Description
    RepositoryFileInfo

    Instance of RepositoryContentModel

    | Improve this Doc View Source

    GetByModule(String, String, Boolean)

    Get an instance of a RepositoryContentModel

    Declaration
    public RepositoryFileInfo GetByModule(string module, string contentType, bool ignoreLocalRepository = false)
    Parameters
    Type Name Description
    System.String module

    Module-Path to the content (File-System-Based)

    System.String contentType

    ContentType of the document

    System.Boolean ignoreLocalRepository

    Defines whether to ignore local repository or not

    Returns
    Type Description
    RepositoryFileInfo

    Instance of RepositoryContentModel

    | Improve this Doc View Source

    GetByPath(String, Boolean)

    Get an instance of a RepositoryContentModel

    Declaration
    public RepositoryFileInfo GetByPath(string path, bool ignoreLocalRepository = false)
    Parameters
    Type Name Description
    System.String path

    Path to the content (File-System-Based)

    System.Boolean ignoreLocalRepository

    Defines whether to ignore local repository or not

    Returns
    Type Description
    RepositoryFileInfo

    Instance of RepositoryContentModel

    | Improve this Doc View Source

    GetChildDirectories(Guid)

    Get all child directories

    Declaration
    public IList<RepositoryDirectoryInfo> GetChildDirectories(Guid parent)
    Parameters
    Type Name Description
    System.Guid parent

    id of the directory, from which the children should be returned

    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryDirectoryInfo>

    List of child directories

    | Improve this Doc View Source

    GetDirectory(Guid)

    Get repository directory by it's guid

    Declaration
    public RepositoryDirectoryInfo GetDirectory(Guid id)
    Parameters
    Type Name Description
    System.Guid id

    id of the directory

    Returns
    Type Description
    RepositoryDirectoryInfo

    Instance of the repository directory

    | Improve this Doc View Source

    GetDirectory(String)

    Get repository directory by it's path

    Declaration
    public RepositoryDirectoryInfo GetDirectory(string path)
    Parameters
    Type Name Description
    System.String path

    Path of the directory

    Returns
    Type Description
    RepositoryDirectoryInfo

    Instance of the repository directory

    | Improve this Doc View Source

    GetDirectoryContent(Guid)

    Get the sources in the directory.

    Declaration
    public IList<RepositoryFileInfo> GetDirectoryContent(Guid directory)
    Parameters
    Type Name Description
    System.Guid directory

    Guid of the directory.

    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryFileInfo>

    A list of fileinfos of the content in the repository directory.

    | Improve this Doc View Source

    GetDirectoryContent(String, Boolean)

    Get the sources in the directory by path.

    Declaration
    public IList<RepositoryFileInfo> GetDirectoryContent(string path, bool recursiv)
    Parameters
    Type Name Description
    System.String path

    Path of the directory.

    System.Boolean recursiv
    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryFileInfo>

    A list of fileinfos of the content in the repository directory.

    | Improve this Doc View Source

    GetDirectoryContentByType(Guid, String)

    Gets all files of the given type from the directory and all subdirectories.

    Declaration
    public IList<RepositoryFileInfo> GetDirectoryContentByType(Guid directory, string type)
    Parameters
    Type Name Description
    System.Guid directory

    Guid of the directory.

    System.String type

    Type of the content.

    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryFileInfo>

    A list of fileinfos of the content in the repository directory.

    | Improve this Doc View Source

    GetDirectoryContentByType(String, String)

    Gets all files of the given type from the directory and all subdirectories.

    Declaration
    public IList<RepositoryFileInfo> GetDirectoryContentByType(string path, string type)
    Parameters
    Type Name Description
    System.String path

    Path of the directory.

    System.String type

    Allowed file type.

    Returns
    Type Description
    System.Collections.Generic.IList<RepositoryFileInfo>

    List of sources in the repository.

    | Improve this Doc View Source

    GetFileParent(RepositoryFileInfo)

    Gets the directory that a file lies in.

    Declaration
    public RepositoryDirectoryInfo GetFileParent(RepositoryFileInfo file)
    Parameters
    Type Name Description
    RepositoryFileInfo file

    Guid of the file

    Returns
    Type Description
    RepositoryDirectoryInfo

    The directory info of the file

    | Improve this Doc View Source

    GetFileParent(Guid)

    Gets the directory that a file lies in.

    Declaration
    public RepositoryDirectoryInfo GetFileParent(Guid file)
    Parameters
    Type Name Description
    System.Guid file

    Guid of the file

    Returns
    Type Description
    RepositoryDirectoryInfo

    The directory info of the file

    | Improve this Doc View Source

    GetFromLocalRepository(String)

    Get a script from the current local repository

    Declaration
    public RepositoryFileInfo GetFromLocalRepository(string relativePath)
    Parameters
    Type Name Description
    System.String relativePath
    Returns
    Type Description
    RepositoryFileInfo
    | Improve this Doc View Source

    MoveFile(RepositoryFileInfo, String, RepositoryManager.HandleOverrideFileOnMove)

    Move one file from one path to another

    Declaration
    public void MoveFile(RepositoryFileInfo toMove, string newPath, RepositoryManager.HandleOverrideFileOnMove overrideHandler = null)
    Parameters
    Type Name Description
    RepositoryFileInfo toMove

    File which will be moved

    System.String newPath

    Target path of the move process

    RepositoryManager.HandleOverrideFileOnMove overrideHandler
    | Improve this Doc View Source

    ReadAllBytes(Guid)

    Declaration
    public byte[] ReadAllBytes(Guid id)
    Parameters
    Type Name Description
    System.Guid id
    Returns
    Type Description
    System.Byte[]
    | Improve this Doc View Source

    ReadAllBytes(String)

    Declaration
    public byte[] ReadAllBytes(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.Byte[]
    | Improve this Doc View Source

    ReadAllText(Guid)

    Declaration
    public string ReadAllText(Guid id)
    Parameters
    Type Name Description
    System.Guid id
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ReadAllText(String)

    Declaration
    public string ReadAllText(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ReadStream(Guid)

    Declaration
    public Stream ReadStream(Guid id)
    Parameters
    Type Name Description
    System.Guid id
    Returns
    Type Description
    System.IO.Stream
    | Improve this Doc View Source

    ReadStream(String)

    Declaration
    public Stream ReadStream(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.IO.Stream
    | Improve this Doc View Source

    RecalculatePathRecursive(Guid)

    Recalculate all directories and subdirectorie paths recusivly

    Declaration
    public void RecalculatePathRecursive(Guid directory)
    Parameters
    Type Name Description
    System.Guid directory

    Guid of the start directory

    | Improve this Doc View Source

    RemoveDirectory(Guid, Boolean)

    Remove a directory and all of it's children. The sources in the repository will not be removed

    Declaration
    public void RemoveDirectory(Guid directory, bool recursive)
    Parameters
    Type Name Description
    System.Guid directory

    Id of the directory

    System.Boolean recursive
    | Improve this Doc View Source

    RenameDirectory(Guid, String)

    Rename a directory and update all child paths (other directories and files)

    Declaration
    public string RenameDirectory(Guid id, string newName)
    Parameters
    Type Name Description
    System.Guid id

    Unique id of the directory

    System.String newName

    New name of the directory

    Returns
    Type Description
    System.String

    New full path

    | Improve this Doc View Source

    RenameFile(Guid, String)

    Rename a file in the repository

    Declaration
    public void RenameFile(Guid id, string newName)
    Parameters
    Type Name Description
    System.Guid id

    Unique id of the file

    System.String newName

    Name of the file

    | Improve this Doc View Source

    SaveToDatabase(RepositoryFileInfo, Boolean)

    Save repository content (script) in the database.

    Declaration
    public RepositoryFileInfo SaveToDatabase(RepositoryFileInfo info, bool prepareContentModel = true)
    Parameters
    Type Name Description
    RepositoryFileInfo info

    Instance of a repository content model (RepositoryContentModel)

    System.Boolean prepareContentModel

    If set to true, the Name, Guid, ModulePath, FilePath and Hash-Value will be proofed

    Returns
    Type Description
    RepositoryFileInfo
    | Improve this Doc View Source

    SetDiretory(RepositoryDirectoryInfo)

    Set a directory direct to the database, no model profing here

    Declaration
    public void SetDiretory(RepositoryDirectoryInfo model)
    Parameters
    Type Name Description
    RepositoryDirectoryInfo model

    Instance of a directory model, containing all information

    | Improve this Doc View Source

    UseLocalRepository(String)

    Use a local repository instead of the database

    Declaration
    public void UseLocalRepository(string path)
    Parameters
    Type Name Description
    System.String path

    Path to the local repository (absolut)

    | Improve this Doc View Source

    WriteAllBytes(Guid, Byte[])

    Declaration
    public void WriteAllBytes(Guid id, byte[] content)
    Parameters
    Type Name Description
    System.Guid id
    System.Byte[] content
    | Improve this Doc View Source

    WriteAllBytes(String, Byte[])

    Declaration
    public void WriteAllBytes(string path, byte[] content)
    Parameters
    Type Name Description
    System.String path
    System.Byte[] content
    | Improve this Doc View Source

    WriteAllText(Guid, String)

    Declaration
    public void WriteAllText(Guid id, string content)
    Parameters
    Type Name Description
    System.Guid id
    System.String content
    | Improve this Doc View Source

    WriteAllText(String, String)

    Declaration
    public void WriteAllText(string path, string content)
    Parameters
    Type Name Description
    System.String path
    System.String content
    | Improve this Doc View Source

    WriteStream(Guid, Stream)

    Declaration
    public void WriteStream(Guid id, Stream content)
    Parameters
    Type Name Description
    System.Guid id
    System.IO.Stream content
    | Improve this Doc View Source

    WriteStream(String, Stream)

    Declaration
    public void WriteStream(string path, Stream content)
    Parameters
    Type Name Description
    System.String path
    System.IO.Stream content
    | Improve this Doc View Source

    WriteToHistory(RepositoryFileInfo, RepositoryFileInfo, Byte[], FileChangeType)

    Write some information to the history of a repository file

    Declaration
    public void WriteToHistory(RepositoryFileInfo oldFileInfo, RepositoryFileInfo newFileInfo, byte[] newContent = null, FileChangeType changeType = FileChangeType.Unknown)
    Parameters
    Type Name Description
    RepositoryFileInfo oldFileInfo

    Old-Content

    RepositoryFileInfo newFileInfo
    System.Byte[] newContent

    New-Content

    FileChangeType changeType

    Change type has the default value for autodetection. If a change-type is set, it will be used.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx