C# Класс AGS.Editor.Utilities

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
SelectedReligion string

Открытые методы

Метод Описание
AddAllMatchingFiles ( IList list, string fileMask ) : void
AddAllMatchingFiles ( IList list, string fileMask, bool fullPaths ) : void
CalculateGraphicsProportion ( Control control ) : float

Returns relation between current graphics resolution and default DpiY (96.0). Can be used when arranging controls and resizing forms.

CheckLabelWidthsOnForm ( Control parentControl ) : void
CopyFileAndSetDestinationWritable ( string sourceFileName, string destFileName ) : void

Copies the source to destination, and makes sure that the newly created destination file is not read-only.

CopyFont ( int fromSlot, int toSlot ) : void
CopyMemory ( IntPtr source, IntPtr destination, int numberOfBytes ) : void
CopyTextToClipboard ( string text ) : void
CreateCopyOfBitmapPreservingColourDepth ( Bitmap source ) : Bitmap
CreateHardLink ( string destFileName, string sourceFileName ) : bool
CreateHardLink ( string destFileName, string sourceFileName, bool overwrite ) : bool
DeleteFileIfExists ( string fileName ) : void
DoesFileNameContainOnlyValidCharacters ( string fileName ) : bool
DoesFileNeedRecompile ( string sourceFile, string destinationFile ) : bool

Returns whether the sourceFile is newer than the destinationFile or if the destinationFile doesn't exist.

EnsureStandardSubFoldersExist ( ) : void
FindExistingFont ( string fontNames ) : FontFamily

Iterates given array of font family names and return the first FontFamily object that is installed in the system. If none was found, returns generic Sans-Serif system font.

GetBitmapForSpriteResizedKeepingAspectRatio ( Sprite sprite, int width, int height, bool centreInNewCanvas, bool drawOutline, Color backgroundColour ) : Bitmap
GetControlThatHasFocus ( ) : Control
GetDirectoryFileList ( string directory, string fileMask ) : string[]

Wraps Directory.GetFiles in a handler to deal with an exception erroneously being thrown on Linux network shares if no files match.

GetDirectoryFileList ( string directory, string fileMask, SearchOption searchOption ) : string[]

Wraps Directory.GetFiles in a handler to deal with an exception erroneously being thrown on Linux network shares if no files match.

GetProcessForActiveApplication ( ) : Process
GetRelativeToProjectPath ( string absolutePath ) : string
GetSizeSpriteWillBeRenderedInGame ( int spriteSlot, int &width, int &height ) : void

Gets the size at which the sprite will be rendered in the game. This will be the sprite size, but doubled if it is a 320-res sprite in a 640-res game.

ImageToIcon ( Image image ) : Icon

Converts an image to icon. Code taken from comments section in: http://ryanfarley.com/blog/archive/2004/04/06/507.aspx

IsControlPressed ( ) : bool
IsMonoRunning ( ) : bool
IsShiftPressed ( ) : bool
IsThisApplicationCurrentlyActive ( ) : bool
IsWindowsVistaOrHigher ( ) : bool
IsWindowsXPOrHigher ( ) : bool
OpenAGSRegistryKey ( ) : RegistryKey
SetDirectoryFilesAccess ( string directory ) : void
SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid ) : void
SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights ) : void
SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights, AccessControlType type ) : void

Sets security permissions for all files in a directory.

SetFileAccess ( string fileName, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights, AccessControlType type ) : void

Sets security permissions for a specific file.

Приватные методы

Метод Описание
DestroyIcon ( IntPtr hIcon ) : bool
GetFocus ( ) : IntPtr
GetForegroundWindow ( ) : IntPtr
GetWindowThreadProcessId ( IntPtr hWnd, IntPtr &lpdwProcessId ) : IntPtr

Описание методов

AddAllMatchingFiles() публичный статический Метод

public static AddAllMatchingFiles ( IList list, string fileMask ) : void
list IList
fileMask string
Результат void

AddAllMatchingFiles() публичный статический Метод

public static AddAllMatchingFiles ( IList list, string fileMask, bool fullPaths ) : void
list IList
fileMask string
fullPaths bool
Результат void

CalculateGraphicsProportion() публичный статический Метод

Returns relation between current graphics resolution and default DpiY (96.0). Can be used when arranging controls and resizing forms.
public static CalculateGraphicsProportion ( Control control ) : float
control System.Windows.Forms.Control
Результат float

CheckLabelWidthsOnForm() публичный статический Метод

public static CheckLabelWidthsOnForm ( Control parentControl ) : void
parentControl System.Windows.Forms.Control
Результат void

CopyFileAndSetDestinationWritable() публичный статический Метод

Copies the source to destination, and makes sure that the newly created destination file is not read-only.
public static CopyFileAndSetDestinationWritable ( string sourceFileName, string destFileName ) : void
sourceFileName string
destFileName string
Результат void

CopyFont() публичный статический Метод

public static CopyFont ( int fromSlot, int toSlot ) : void
fromSlot int
toSlot int
Результат void

CopyMemory() публичный статический Метод

public static CopyMemory ( IntPtr source, IntPtr destination, int numberOfBytes ) : void
source System.IntPtr
destination System.IntPtr
numberOfBytes int
Результат void

CopyTextToClipboard() публичный статический Метод

public static CopyTextToClipboard ( string text ) : void
text string
Результат void

CreateCopyOfBitmapPreservingColourDepth() публичный статический Метод

public static CreateCopyOfBitmapPreservingColourDepth ( Bitmap source ) : Bitmap
source System.Drawing.Bitmap
Результат System.Drawing.Bitmap

CreateHardLink() публичный статический Метод

public static CreateHardLink ( string destFileName, string sourceFileName ) : bool
destFileName string
sourceFileName string
Результат bool

CreateHardLink() публичный статический Метод

public static CreateHardLink ( string destFileName, string sourceFileName, bool overwrite ) : bool
destFileName string
sourceFileName string
overwrite bool
Результат bool

DeleteFileIfExists() публичный статический Метод

public static DeleteFileIfExists ( string fileName ) : void
fileName string
Результат void

DoesFileNameContainOnlyValidCharacters() публичный статический Метод

public static DoesFileNameContainOnlyValidCharacters ( string fileName ) : bool
fileName string
Результат bool

DoesFileNeedRecompile() публичный статический Метод

Returns whether the sourceFile is newer than the destinationFile or if the destinationFile doesn't exist.
public static DoesFileNeedRecompile ( string sourceFile, string destinationFile ) : bool
sourceFile string
destinationFile string
Результат bool

EnsureStandardSubFoldersExist() публичный статический Метод

public static EnsureStandardSubFoldersExist ( ) : void
Результат void

FindExistingFont() публичный статический Метод

Iterates given array of font family names and return the first FontFamily object that is installed in the system. If none was found, returns generic Sans-Serif system font.
public static FindExistingFont ( string fontNames ) : FontFamily
fontNames string
Результат System.Drawing.FontFamily

GetBitmapForSpriteResizedKeepingAspectRatio() публичный статический Метод

public static GetBitmapForSpriteResizedKeepingAspectRatio ( Sprite sprite, int width, int height, bool centreInNewCanvas, bool drawOutline, Color backgroundColour ) : Bitmap
sprite Sprite
width int
height int
centreInNewCanvas bool
drawOutline bool
backgroundColour Color
Результат System.Drawing.Bitmap

GetControlThatHasFocus() публичный статический Метод

public static GetControlThatHasFocus ( ) : Control
Результат System.Windows.Forms.Control

GetDirectoryFileList() публичный статический Метод

Wraps Directory.GetFiles in a handler to deal with an exception erroneously being thrown on Linux network shares if no files match.
public static GetDirectoryFileList ( string directory, string fileMask ) : string[]
directory string
fileMask string
Результат string[]

GetDirectoryFileList() публичный статический Метод

Wraps Directory.GetFiles in a handler to deal with an exception erroneously being thrown on Linux network shares if no files match.
public static GetDirectoryFileList ( string directory, string fileMask, SearchOption searchOption ) : string[]
directory string
fileMask string
searchOption SearchOption
Результат string[]

GetProcessForActiveApplication() публичный статический Метод

public static GetProcessForActiveApplication ( ) : Process
Результат System.Diagnostics.Process

GetRelativeToProjectPath() публичный статический Метод

public static GetRelativeToProjectPath ( string absolutePath ) : string
absolutePath string
Результат string

GetSizeSpriteWillBeRenderedInGame() публичный статический Метод

Gets the size at which the sprite will be rendered in the game. This will be the sprite size, but doubled if it is a 320-res sprite in a 640-res game.
public static GetSizeSpriteWillBeRenderedInGame ( int spriteSlot, int &width, int &height ) : void
spriteSlot int
width int
height int
Результат void

ImageToIcon() публичный статический Метод

Converts an image to icon. Code taken from comments section in: http://ryanfarley.com/blog/archive/2004/04/06/507.aspx
public static ImageToIcon ( Image image ) : Icon
image Image The image
Результат System.Drawing.Icon

IsControlPressed() публичный статический Метод

public static IsControlPressed ( ) : bool
Результат bool

IsMonoRunning() публичный статический Метод

public static IsMonoRunning ( ) : bool
Результат bool

IsShiftPressed() публичный статический Метод

public static IsShiftPressed ( ) : bool
Результат bool

IsThisApplicationCurrentlyActive() публичный статический Метод

public static IsThisApplicationCurrentlyActive ( ) : bool
Результат bool

IsWindowsVistaOrHigher() публичный статический Метод

public static IsWindowsVistaOrHigher ( ) : bool
Результат bool

IsWindowsXPOrHigher() публичный статический Метод

public static IsWindowsXPOrHigher ( ) : bool
Результат bool

OpenAGSRegistryKey() публичный статический Метод

public static OpenAGSRegistryKey ( ) : RegistryKey
Результат Microsoft.Win32.RegistryKey

SetDirectoryFilesAccess() публичный статический Метод

public static SetDirectoryFilesAccess ( string directory ) : void
directory string
Результат void

SetDirectoryFilesAccess() публичный статический Метод

public static SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid ) : void
directory string
sid System.Security.Principal.SecurityIdentifier
Результат void

SetDirectoryFilesAccess() публичный статический Метод

public static SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights ) : void
directory string
sid System.Security.Principal.SecurityIdentifier
rights FileSystemRights
Результат void

SetDirectoryFilesAccess() публичный статический Метод

Sets security permissions for all files in a directory.
public static SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights, AccessControlType type ) : void
directory string
sid System.Security.Principal.SecurityIdentifier
rights FileSystemRights
type AccessControlType
Результат void

SetFileAccess() публичный статический Метод

Sets security permissions for a specific file.
public static SetFileAccess ( string fileName, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights, AccessControlType type ) : void
fileName string
sid System.Security.Principal.SecurityIdentifier
rights FileSystemRights
type AccessControlType
Результат void

Описание свойств

SelectedReligion публичное статическое свойство

public static string SelectedReligion
Результат string