Class mmFileUtils

Internal File Utilities class

System.Object
  MarkdownMonster.mmFileUtils
public static class mmFileUtils : object

Class Members

MemberDescription

FOF_ALLOWUNDO

FOF_NOCONFIRMATION

FO_DELETE

EnsureAssociations

public static void EnsureAssociations(bool force,     bool uninstall)

EnsureBrowserEmulationEnabled

Set Internet Explorer browser compatibility

public static void EnsureBrowserEmulationEnabled(string exename,     bool uninstall)

EnsureSystemPath

public static void EnsureSystemPath(bool uninstall)

FindGitClient

Checks to see if

public static string FindGitClient()

FindGitDiffTool

public static string FindGitDiffTool()

FindImageEditor

Tries to find an installed image editor on the system as a default.

public static string FindImageEditor()

FixupDocumentFilename

Method checks for existance of full filename and tries to check for file in the initial startup folder.

public static string FixupDocumentFilename(string file)

GetChecksumFromFile

Creates an MD5 checksum of a file

public static string GetChecksumFromFile(string file)

GetEditorSyntaxFromFileType

Retrieves the editor syntax for a file based on extension for use in the editor

Unknown file types returning null

public static string GetEditorSyntaxFromFileType(string filename)

GetFileEncoding

Retrieve the file encoding for a given file so we can capture and store the Encoding when writing the file back out after editing.

Default is Utf-8 (w/ BOM). If file without BOM is read it is assumed it's UTF-8.

public static Encoding GetFileEncoding(string srcFile)

GetImageMediaTypeFromFilename

Returns the image media type for a give file extension based on a filename or url passed in.

public static string GetImageMediaTypeFromFilename(string file)

MoveToRecycleBin

public static bool MoveToRecycleBin(string filename)

NormalizeFilenameWithBasePath

Normalizes a potentially relative pathname to a base path name if the exact filename doesn't exist by prepending the base path explicitly.

public static string NormalizeFilenameWithBasePath(string file,     string basePath)

OpenGitClient

Opens the configured Git Client in the specified folder

public static bool OpenGitClient(string folder)

OpenImageInImageEditor

Opens an image in the configured image editor

public static bool OpenImageInImageEditor(string imageFile)

OpenImageInImageViewer

Opens an image in the configured image viewer. If none is specified uses default image viewer

public static bool OpenImageInImageViewer(string imageFile)

OpenTerminal

Opens the configured image editor. If command can't be executed the function returns false

public static bool OpenTerminal(string folder)

OptimizeImage

Optimizes a jpeg image

public static void OptimizeImage(string imageFilename,     int imageQuality,     Action onComplete)

OptimizePngImage

Tries to optimize png images in the background This is not fast and does not happen right away so generally this can be applied when images are saved.

public static void OptimizePngImage(string pngFilename,     int level)

SHFileOperation

public static int SHFileOperation(ref SHFILEOPSTRUCT FileOp)

ShowExternalBrowser

Shows external browser that's been configured in the MM Configuration. Defaults to Chrome

public static void ShowExternalBrowser(string url)

ShowOpenWithDialog

Displays the Windows Open With dialog with options.

public static void ShowOpenWithDialog(string path)

TryConvertToInt32

Safely converts a double to an integer

public static int TryConvertToInt32(double value,     int failValue)

Requirements

Namespace: MarkdownMonster
Assembly: markdownmonster.exe

© West Wind Technologies, 2019 • Updated: 01/06/19
Comment or report problem with topic