C# Class AGS.Editor.Utilities

Afficher le fichier Open project: adventuregamestudio/ags Class Usage Examples

Méthodes publiques

Свойство Type Description
SelectedReligion string

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
DestroyIcon ( IntPtr hIcon ) : bool
GetFocus ( ) : IntPtr
GetForegroundWindow ( ) : IntPtr
GetWindowThreadProcessId ( IntPtr hWnd, IntPtr &lpdwProcessId ) : IntPtr

Method Details

AddAllMatchingFiles() public static méthode

public static AddAllMatchingFiles ( IList list, string fileMask ) : void
list IList
fileMask string
Résultat void

AddAllMatchingFiles() public static méthode

public static AddAllMatchingFiles ( IList list, string fileMask, bool fullPaths ) : void
list IList
fileMask string
fullPaths bool
Résultat void

CalculateGraphicsProportion() public static méthode

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
Résultat float

CheckLabelWidthsOnForm() public static méthode

public static CheckLabelWidthsOnForm ( Control parentControl ) : void
parentControl System.Windows.Forms.Control
Résultat void

CopyFileAndSetDestinationWritable() public static méthode

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
Résultat void

CopyFont() public static méthode

public static CopyFont ( int fromSlot, int toSlot ) : void
fromSlot int
toSlot int
Résultat void

CopyMemory() public static méthode

public static CopyMemory ( IntPtr source, IntPtr destination, int numberOfBytes ) : void
source System.IntPtr
destination System.IntPtr
numberOfBytes int
Résultat void

CopyTextToClipboard() public static méthode

public static CopyTextToClipboard ( string text ) : void
text string
Résultat void

CreateCopyOfBitmapPreservingColourDepth() public static méthode

public static CreateCopyOfBitmapPreservingColourDepth ( Bitmap source ) : Bitmap
source System.Drawing.Bitmap
Résultat System.Drawing.Bitmap

CreateHardLink() public static méthode

public static CreateHardLink ( string destFileName, string sourceFileName ) : bool
destFileName string
sourceFileName string
Résultat bool

CreateHardLink() public static méthode

public static CreateHardLink ( string destFileName, string sourceFileName, bool overwrite ) : bool
destFileName string
sourceFileName string
overwrite bool
Résultat bool

DeleteFileIfExists() public static méthode

public static DeleteFileIfExists ( string fileName ) : void
fileName string
Résultat void

DoesFileNameContainOnlyValidCharacters() public static méthode

public static DoesFileNameContainOnlyValidCharacters ( string fileName ) : bool
fileName string
Résultat bool

DoesFileNeedRecompile() public static méthode

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
Résultat bool

EnsureStandardSubFoldersExist() public static méthode

public static EnsureStandardSubFoldersExist ( ) : void
Résultat void

FindExistingFont() public static méthode

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
Résultat System.Drawing.FontFamily

GetBitmapForSpriteResizedKeepingAspectRatio() public static méthode

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
Résultat System.Drawing.Bitmap

GetControlThatHasFocus() public static méthode

public static GetControlThatHasFocus ( ) : Control
Résultat System.Windows.Forms.Control

GetDirectoryFileList() public static méthode

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
Résultat string[]

GetDirectoryFileList() public static méthode

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
Résultat string[]

GetProcessForActiveApplication() public static méthode

public static GetProcessForActiveApplication ( ) : Process
Résultat System.Diagnostics.Process

GetRelativeToProjectPath() public static méthode

public static GetRelativeToProjectPath ( string absolutePath ) : string
absolutePath string
Résultat string

GetSizeSpriteWillBeRenderedInGame() public static méthode

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
Résultat void

ImageToIcon() public static méthode

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
Résultat System.Drawing.Icon

IsControlPressed() public static méthode

public static IsControlPressed ( ) : bool
Résultat bool

IsMonoRunning() public static méthode

public static IsMonoRunning ( ) : bool
Résultat bool

IsShiftPressed() public static méthode

public static IsShiftPressed ( ) : bool
Résultat bool

IsThisApplicationCurrentlyActive() public static méthode

public static IsThisApplicationCurrentlyActive ( ) : bool
Résultat bool

IsWindowsVistaOrHigher() public static méthode

public static IsWindowsVistaOrHigher ( ) : bool
Résultat bool

IsWindowsXPOrHigher() public static méthode

public static IsWindowsXPOrHigher ( ) : bool
Résultat bool

OpenAGSRegistryKey() public static méthode

public static OpenAGSRegistryKey ( ) : RegistryKey
Résultat Microsoft.Win32.RegistryKey

SetDirectoryFilesAccess() public static méthode

public static SetDirectoryFilesAccess ( string directory ) : void
directory string
Résultat void

SetDirectoryFilesAccess() public static méthode

public static SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid ) : void
directory string
sid System.Security.Principal.SecurityIdentifier
Résultat void

SetDirectoryFilesAccess() public static méthode

public static SetDirectoryFilesAccess ( string directory, System.Security.Principal.SecurityIdentifier sid, FileSystemRights rights ) : void
directory string
sid System.Security.Principal.SecurityIdentifier
rights FileSystemRights
Résultat void

SetDirectoryFilesAccess() public static méthode

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
Résultat void

SetFileAccess() public static méthode

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
Résultat void

Property Details

SelectedReligion public_oe static_oe property

public static string SelectedReligion
Résultat string