Table of Contents

Class HiNcHost

Namespace
Hi.HiNcKits
Assembly
HiNc.dll

Host class for HiNC functionality that provides project management, path resolution, and MongoDB integration.

public class HiNcHost : IDisposable
Inheritance
HiNcHost
Implements
Inherited Members
Extension Methods

Constructors

HiNcHost(string, int, string)

public HiNcHost(string adminDirectory, int mongodbPort, string displayEngineFontFile)

Parameters

adminDirectory string
mongodbPort int
displayEngineFontFile string

The default value will be alternative if the value is null.

Fields

HiNcUserDbMetaName

Gets the name of the HiNC user database metadata.

public const string HiNcUserDbMetaName = "UserDbMeta"

Field Value

string

HiNcUserDbName

Gets the name of the HiNC user database.

public const string HiNcUserDbName = "HiNcUserDb"

Field Value

string

Properties

AdminDir

Admin absolute directory.

public string AdminDir { get; }

Property Value

string

AdminExtendedNamedPath

Gets the admin extended named path.

public ExtendedNamedPath AdminExtendedNamedPath { get; }

Property Value

ExtendedNamedPath

AdminNamedPath

Gets the admin named path.

public NamedPath AdminNamedPath { get; }

Property Value

NamedPath

CacheDbId

Gets the cache database ID.

public static string CacheDbId { get; set; }

Property Value

string

DirectoryRoute

The BaseDirectory is admin directory. The SubDirectory is current applied project directory.

public BaseAndSubDirectory DirectoryRoute { get; }

Property Value

BaseAndSubDirectory

MachiningProject

Gets the current MachiningProject instance.

public MachiningProject MachiningProject { get; }

Property Value

MachiningProject

MongoServer

Gets the main MongoDB runner.

public IMongoRunner MongoServer { get; }

Property Value

IMongoRunner

ProjectDir

Project Absolute Directory.

public string ProjectDir { get; }

Property Value

string

ProjectExtendedNamedPath

Gets the project extended named path.

public ExtendedNamedPath ProjectExtendedNamedPath { get; }

Property Value

ExtendedNamedPath

ProjectNamedPath

Gets the project named path.

public NamedPath ProjectNamedPath { get; }

Property Value

NamedPath

ProjectPathRoute

Gets the project path route.

public PathRoute ProjectPathRoute { get; }

Property Value

PathRoute

ProjectRelativeDirectory

Gets the relative project directory path.

public string ProjectRelativeDirectory { get; }

Property Value

string

ResourceDir

Resource absolute directory.

public string ResourceDir { get; }

Property Value

string

ResourceExtendedNamedPath

Gets the resource extended named path.

public ExtendedNamedPath ResourceExtendedNamedPath { get; }

Property Value

ExtendedNamedPath

ResourceNamedPath

Gets the resource named path.

public NamedPath ResourceNamedPath { get; }

Property Value

NamedPath

ResourceRelDir

Relative directory from AdminDir for resource.

public string ResourceRelDir { get; set; }

Property Value

string

Methods

CloseProject()

Closes the current project.

public Task CloseProject()

Returns

Task

A task representing the asynchronous operation

CopyResourceIfNotExisted()

Copies resources if they don't already exist in the target location.

public void CopyResourceIfNotExisted()

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

GetExtendedNamedPathByNamePath(string)

Gets an extended named path by its name path.

public ExtendedNamedPath GetExtendedNamedPathByNamePath(string namePath)

Parameters

namePath string

The name path to look up.

Returns

ExtendedNamedPath

The extended named path for the specified name path, or null if not found.

GetExtendedNamedPathByPath(string)

Gets an extended named path by its path.

public ExtendedNamedPath GetExtendedNamedPathByPath(string path)

Parameters

path string

The path to look up.

Returns

ExtendedNamedPath

The extended named path with the specified path, or null if not found.

GetExtendedNamedPathByUriPara(string)

GetExtendedNamedPath By blazor page parameter.

public ExtendedNamedPath GetExtendedNamedPathByUriPara(string uriPara)

Parameters

uriPara string

Returns

ExtendedNamedPath

GetExtendedNamedPathList(params BasePathEnum[])

Gets a list of extended named paths for the specified base path types.

public List<ExtendedNamedPath> GetExtendedNamedPathList(params BasePathEnum[] basePathEnums)

Parameters

basePathEnums BasePathEnum[]

The base path types to include.

Returns

List<ExtendedNamedPath>

A list of extended named paths.

GetNamedPathByName(string)

Gets a named path by its name.

public NamedPath GetNamedPathByName(string name)

Parameters

name string

The name of the path to retrieve

Returns

NamedPath

The named path with the specified name, or null if not found

GetNamedPathByPath(string)

Gets a named path by its path.

public NamedPath GetNamedPathByPath(string path)

Parameters

path string

The path to look up.

Returns

NamedPath

The named path with the specified path, or null if not found.

GetNamedPathList(params BasePathEnum[])

Gets a list of named paths for the specified base path types.

public List<NamedPath> GetNamedPathList(params BasePathEnum[] basePathEnums)

Parameters

basePathEnums BasePathEnum[]

The base path types to include.

Returns

List<NamedPath>

A list of named paths.

LoadProjectByRelativePath(string)

Loads a project from the specified relative file path.

public Task LoadProjectByRelativePath(string relativeFilePathFromAdminRoot)

Parameters

relativeFilePathFromAdminRoot string

The relative file path from the admin directory root

Returns

Task

A task representing the asynchronous operation

NewProjectByRelFile(string)

Creates a new project from a relative file path.

public void NewProjectByRelFile(string relFilePath)

Parameters

relFilePath string

The relative file path from the admin directory

ReloadProject()

Reloads the current project.

public Task ReloadProject()

Returns

Task

A task representing the asynchronous operation

SaveAsProject(string)

Saves the current project to a specified relative file path.

public void SaveAsProject(string relativeFilePathFromAdminRoot)

Parameters

relativeFilePathFromAdminRoot string

The relative file path from the admin directory root

SaveProject()

Save project by ProjectPathRoute.

public void SaveProject()

ShowMessageBoard(string, string, BootstrapTheme)

Shows a message board with specified title, message and theme.

public void ShowMessageBoard(string title, string message, BootstrapTheme bootstrapThemeColor)

Parameters

title string

The title of the message board

message string

The message to display

bootstrapThemeColor BootstrapTheme

The bootstrap theme color for the message board

Events

OnMachiningProjectDisposing

Event raised when the MachiningProject is about to be disposed.

public event Func<MachiningProject, Task> OnMachiningProjectDisposing

Event Type

Func<MachiningProject, Task>

OnShownMessageBoard

Event raised when a message board is shown.

public event ShowMessageBoardDelegate OnShownMessageBoard

Event Type

ShowMessageBoardDelegate