C# 클래스 GitForce.ClassUtils

Contains various utility functions
파일 보기 프로젝트 열기: gdevic/GitForce 1 사용 예제들

공개 메소드들

메소드 설명
AddEnvar ( string name, string value ) : void

Adds an environment variable for the Run method

CommandPromptHere ( string where ) : void

Open a command prompt at the specific directory

DeleteFile ( string name ) : bool

Deletes a file from the local file system. Returns true if delete succeeded, false otherwise.

DeleteFolder ( DirectoryInfo dirInfo, bool fPreserveGit, bool fPreserveRootFolder ) : bool

Remove given folder and all files and subfolders under it. If fPreserveGit is true, all folders that are named ".git" will be preserved (not removed) If fPreserveRootFolder is true, the first (root) folder will also be preserved Return false if the function could not remove all folders, true otherwise.

DirStat ( string path ) : DirStatType

Given a fully qualified path to a local directory, return the stat on that folder

ExecuteShellCommand ( string cmd, string args ) : string

Executes a shell command

ExplorerHere ( string where, string selFile ) : void

Open a file browser/Explorer at the specific directory, optionally selecting a file

FileDoubleClick ( string file ) : void

Handle double-clicking on a file. Depending on the saved options, we either do nothing ("0"), open a file using a default Explorer file association ("1"), or open a file using a specified application ("2")

FileOpenFromMenu ( object sender, string file ) : void

Edit selected file using either the default editor (native OS file association, if the tag is null, or the editor program specified in the tag field. This is a handler for the context menu, edit tool bar button and also revision history view menus.

GetEnvars ( ) : string>.Dictionary

Returns a set of environment variables registered for this execution environment

GetHomePath ( ) : string

Retruns a path to the home directory.

GetShellExecCmd ( ) : string

Returns CMD/SHELL executable name to execute a command line command

GetShellExecFlags ( ) : string

Returns a string to be used by CMD/SHELL as argument when executing a command line command

GetShortPathName ( string path ) : string

This function is meaningful only on Windows: Given a long file path name, return its short version. This is used mainly to avoid various problems with paths containing spaces and the inability of git to handle them.

IsMono ( ) : bool

Returns true if the app is running on Mono (Linux), false if it is Windows

IsNullOrWhiteSpace ( string s ) : bool

Identical to NET4.0 IsNullOrWhiteSpace()

OpenWebLink ( string html ) : void

Open an HTML link in an external web browser application.

ToPlainAscii ( string s ) : string

Returns a copy of the input string, but with all non-ASCII characters stripped down. This function also removes ANSI escape codes from the string.

UpgradeApplicationSettingsIfNecessary ( ) : void

Upgrades the application settings to a new version, if necessary http://stackoverflow.com/questions/10121044/app-loses-all-settings-when-app-update-is-installed

WriteResourceToFile ( string pathName, string fileName, byte buffer ) : string

Writes binary resource to a temporary file

비공개 메소드들

메소드 설명
DeleteFolder ( DirectoryInfo dirInfo ) : bool

Deletes a folder from the local file system. Returns true if delete succeeded, false otherwise.

메소드 상세

AddEnvar() 공개 정적인 메소드

Adds an environment variable for the Run method
public static AddEnvar ( string name, string value ) : void
name string
value string
리턴 void

CommandPromptHere() 공개 정적인 메소드

Open a command prompt at the specific directory
public static CommandPromptHere ( string where ) : void
where string
리턴 void

DeleteFile() 공개 정적인 메소드

Deletes a file from the local file system. Returns true if delete succeeded, false otherwise.
public static DeleteFile ( string name ) : bool
name string
리턴 bool

DeleteFolder() 공개 정적인 메소드

Remove given folder and all files and subfolders under it. If fPreserveGit is true, all folders that are named ".git" will be preserved (not removed) If fPreserveRootFolder is true, the first (root) folder will also be preserved Return false if the function could not remove all folders, true otherwise.
public static DeleteFolder ( DirectoryInfo dirInfo, bool fPreserveGit, bool fPreserveRootFolder ) : bool
dirInfo System.IO.DirectoryInfo
fPreserveGit bool
fPreserveRootFolder bool
리턴 bool

DirStat() 공개 정적인 메소드

Given a fully qualified path to a local directory, return the stat on that folder
public static DirStat ( string path ) : DirStatType
path string
리턴 DirStatType

ExecuteShellCommand() 공개 정적인 메소드

Executes a shell command
public static ExecuteShellCommand ( string cmd, string args ) : string
cmd string
args string
리턴 string

ExplorerHere() 공개 정적인 메소드

Open a file browser/Explorer at the specific directory, optionally selecting a file
public static ExplorerHere ( string where, string selFile ) : void
where string
selFile string
리턴 void

FileDoubleClick() 공개 정적인 메소드

Handle double-clicking on a file. Depending on the saved options, we either do nothing ("0"), open a file using a default Explorer file association ("1"), or open a file using a specified application ("2")
public static FileDoubleClick ( string file ) : void
file string
리턴 void

FileOpenFromMenu() 공개 정적인 메소드

Edit selected file using either the default editor (native OS file association, if the tag is null, or the editor program specified in the tag field. This is a handler for the context menu, edit tool bar button and also revision history view menus.
public static FileOpenFromMenu ( object sender, string file ) : void
sender object
file string
리턴 void

GetEnvars() 공개 정적인 메소드

Returns a set of environment variables registered for this execution environment
public static GetEnvars ( ) : string>.Dictionary
리턴 string>.Dictionary

GetHomePath() 공개 정적인 메소드

Retruns a path to the home directory.
public static GetHomePath ( ) : string
리턴 string

GetShellExecCmd() 공개 정적인 메소드

Returns CMD/SHELL executable name to execute a command line command
public static GetShellExecCmd ( ) : string
리턴 string

GetShellExecFlags() 공개 정적인 메소드

Returns a string to be used by CMD/SHELL as argument when executing a command line command
public static GetShellExecFlags ( ) : string
리턴 string

GetShortPathName() 공개 정적인 메소드

This function is meaningful only on Windows: Given a long file path name, return its short version. This is used mainly to avoid various problems with paths containing spaces and the inability of git to handle them.
public static GetShortPathName ( string path ) : string
path string
리턴 string

IsMono() 공개 정적인 메소드

Returns true if the app is running on Mono (Linux), false if it is Windows
public static IsMono ( ) : bool
리턴 bool

IsNullOrWhiteSpace() 공개 정적인 메소드

Identical to NET4.0 IsNullOrWhiteSpace()
public static IsNullOrWhiteSpace ( string s ) : bool
s string
리턴 bool

OpenWebLink() 공개 정적인 메소드

Open an HTML link in an external web browser application.
public static OpenWebLink ( string html ) : void
html string
리턴 void

ToPlainAscii() 공개 정적인 메소드

Returns a copy of the input string, but with all non-ASCII characters stripped down. This function also removes ANSI escape codes from the string.
public static ToPlainAscii ( string s ) : string
s string
리턴 string

UpgradeApplicationSettingsIfNecessary() 공개 정적인 메소드

Upgrades the application settings to a new version, if necessary http://stackoverflow.com/questions/10121044/app-loses-all-settings-when-app-update-is-installed
public static UpgradeApplicationSettingsIfNecessary ( ) : void
리턴 void

WriteResourceToFile() 공개 정적인 메소드

Writes binary resource to a temporary file
public static WriteResourceToFile ( string pathName, string fileName, byte buffer ) : string
pathName string
fileName string
buffer byte
리턴 string