C# Класс MPTagThat.Core.Util

Показать файл Открыть проект

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

Метод Описание
CheckParameterFormat ( string str, Options formattype ) : bool

Check the Parameter Format for validity

CreateCursorFromResource ( string resourceName, int xHotSpot, int yHotSpot ) : Cursor

Create a cursor from the given Resource Name

Drive2BassID ( char driveLetter ) : int

Converts the given CD/DVD Drive Letter to a number suiteable for BASS

DurationToSeconds ( string durationString ) : int

Converts a time string "HH:mm:ss" to seconds

EnterMethod ( MPTagThat.Core.CallingMethod method ) : void

write the Method Name into the log

FormatGridColumn ( MPTagThat.Core.GridViewColumn setting ) : System.Windows.Forms.DataGridViewColumn

Formats a Grid Column based on the Settings

FormatID3Tag ( File file ) : File

Based on the Options set, use the correct version for ID3 Eventually remove V1 or V2 tags, if set in the options

GetCallingMethod ( ) : MPTagThat.Core.CallingMethod

Example using CallingMethod within another method. This still returns information about the caller by excluding calls from this Utils class.

GetFolderThumb ( string folder ) : Common.MPTagThat.Core.Common.Picture

Return the folder.jpg as a Taglib.Picture

GetImageAssociatedWithFile ( string filePath, bool small ) : Image
GetQualifiedFilename ( string strBasePath, string &strFileName ) : void

Returns a filename prefixed with the Path

GetWebPage ( string requestString ) : string

Returns the requested WebPage

HttpPostRequest ( string url, string>.Dictionary postParameters ) : string

Post data to WebPage and get result.

IsAudio ( string fileName ) : bool

Is this an Audio file, which can be handled by MPTagThat

IsCDDrive ( string driveLetter ) : bool

Checks if the given Drive Letter is a CD/DVD Drive

IsPicture ( string fileName ) : bool

Is this a Picture file, which can be shown in Listview

IsReplayGain ( string description ) : bool

Checks, if we got a replaygain frame

LabelToParameter ( string label ) : string

Convert the Label to a Parameter

LeaveMethod ( MPTagThat.Core.CallingMethod method ) : void

write the Method Name into the log

LongestCommonSubstring ( string sourceString, string targetString ) : double

This function matches the Longet Common Substring of the source string found in target string

MakeValidFileName ( string str ) : string

Make a Valid Filename out of a given String

MakeValidFolderName ( string str ) : string

Make a Valid Foldername out of a given String

ReadFullStream ( Stream stream, int initialLength ) : byte[]

Reads data from a stream until the end is reached. The data is returned as a byte array. An IOException is thrown if any of the underlying IO calls fail.

RelativePathTo ( string fromDirectory, string toPath ) : string

Creates a relative path from one file or folder to another.

RemoveInvalidChars ( string strText ) : string

Changes the Quote to a double Quote, to have correct SQL Syntax

RemoveTrailingSlash ( string strLine ) : string
ReplaceEx ( string original, string pattern, string replacement ) : string

Fast Case Sensitive Replace Method

ReplaceParametersWithTrackValues ( string parameter, TrackData track ) : string

Replace the given Parameter string with the values from the Track

SavePicture ( TrackData track ) : void

Save the Picture of the track as folder.jpg

SecondsToHMSString ( string sSeconds ) : string

Converts given seconds to HH:mm:ss

SendMessage ( string action, string data ) : void

Sends a message

SendProgress ( string message ) : void

Sends a Progress Message, so that the status bar can be updated

isARedBookCD ( string drive ) : bool

Checks, if the given Drive Letter is a Red Book (Audio) CD

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

Метод Описание
CheckParmWithLengthIndicator ( int startIndex, string str, string &parmString ) : bool

Check a Parameter with a given Length Indicator for correctness

CreateIconIndirect ( System.Drawing.IconInfo &icon ) : IntPtr
GetIconInfo ( IntPtr hIcon, System.Drawing.IconInfo &pIconInfo ) : bool
MoveWindow ( IntPtr hWnd, int x, int y, int cx, int cy, bool repaint ) : bool
ReplaceStringWithLengthIndicator ( int startIndex, string replaceString, string replaceValue ) : string
SHFileOperation ( SHFILEOPSTRUCT &FileOp ) : int
SendMessage ( IntPtr hWnd, int msg, int len, IntPtr order ) : IntPtr
SetWindowText ( IntPtr hwnd, String lpString ) : bool
Util ( ) : System

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

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

Check the Parameter Format for validity
public static CheckParameterFormat ( string str, Options formattype ) : bool
str string
formattype Options
Результат bool

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

Create a cursor from the given Resource Name
public static CreateCursorFromResource ( string resourceName, int xHotSpot, int yHotSpot ) : Cursor
resourceName string
xHotSpot int
yHotSpot int
Результат System.Windows.Forms.Cursor

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

Converts the given CD/DVD Drive Letter to a number suiteable for BASS
public static Drive2BassID ( char driveLetter ) : int
driveLetter char
Результат int

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

Converts a time string "HH:mm:ss" to seconds
public static DurationToSeconds ( string durationString ) : int
durationString string
Результат int

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

write the Method Name into the log
public static EnterMethod ( MPTagThat.Core.CallingMethod method ) : void
method MPTagThat.Core.CallingMethod
Результат void

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

Formats a Grid Column based on the Settings
public static FormatGridColumn ( MPTagThat.Core.GridViewColumn setting ) : System.Windows.Forms.DataGridViewColumn
setting MPTagThat.Core.GridViewColumn
Результат System.Windows.Forms.DataGridViewColumn

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

Based on the Options set, use the correct version for ID3 Eventually remove V1 or V2 tags, if set in the options
public static FormatID3Tag ( File file ) : File
file TagLib.File
Результат TagLib.File

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

Example using CallingMethod within another method. This still returns information about the caller by excluding calls from this Utils class.
public static GetCallingMethod ( ) : MPTagThat.Core.CallingMethod
Результат MPTagThat.Core.CallingMethod

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

Return the folder.jpg as a Taglib.Picture
public static GetFolderThumb ( string folder ) : Common.MPTagThat.Core.Common.Picture
folder string
Результат Common.MPTagThat.Core.Common.Picture

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

public static GetImageAssociatedWithFile ( string filePath, bool small ) : Image
filePath string
small bool
Результат Image

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

Returns a filename prefixed with the Path
public static GetQualifiedFilename ( string strBasePath, string &strFileName ) : void
strBasePath string
strFileName string
Результат void

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

Returns the requested WebPage
public static GetWebPage ( string requestString ) : string
requestString string
Результат string

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

Post data to WebPage and get result.
public static HttpPostRequest ( string url, string>.Dictionary postParameters ) : string
url string
postParameters string>.Dictionary
Результат string

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

Is this an Audio file, which can be handled by MPTagThat
public static IsAudio ( string fileName ) : bool
fileName string
Результат bool

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

Checks if the given Drive Letter is a CD/DVD Drive
public static IsCDDrive ( string driveLetter ) : bool
driveLetter string
Результат bool

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

Is this a Picture file, which can be shown in Listview
public static IsPicture ( string fileName ) : bool
fileName string
Результат bool

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

Checks, if we got a replaygain frame
public static IsReplayGain ( string description ) : bool
description string
Результат bool

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

Convert the Label to a Parameter
public static LabelToParameter ( string label ) : string
label string
Результат string

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

write the Method Name into the log
public static LeaveMethod ( MPTagThat.Core.CallingMethod method ) : void
method MPTagThat.Core.CallingMethod
Результат void

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

This function matches the Longet Common Substring of the source string found in target string
public static LongestCommonSubstring ( string sourceString, string targetString ) : double
sourceString string The Source String to match
targetString string The Target String to search within
Результат double

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

Make a Valid Filename out of a given String
public static MakeValidFileName ( string str ) : string
str string
Результат string

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

Make a Valid Foldername out of a given String
public static MakeValidFolderName ( string str ) : string
str string
Результат string

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

Reads data from a stream until the end is reached. The data is returned as a byte array. An IOException is thrown if any of the underlying IO calls fail.
public static ReadFullStream ( Stream stream, int initialLength ) : byte[]
stream Stream The stream to read data from
initialLength int The initial buffer length
Результат byte[]

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

Creates a relative path from one file or folder to another.
public static RelativePathTo ( string fromDirectory, string toPath ) : string
fromDirectory string /// Contains the directory that defines the /// start of the relative path. ///
toPath string /// Contains the path that defines the /// endpoint of the relative path. ///
Результат string

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

Changes the Quote to a double Quote, to have correct SQL Syntax
public static RemoveInvalidChars ( string strText ) : string
strText string
Результат string

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

public static RemoveTrailingSlash ( string strLine ) : string
strLine string
Результат string

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

Fast Case Sensitive Replace Method
public static ReplaceEx ( string original, string pattern, string replacement ) : string
original string
pattern string
replacement string
Результат string

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

Replace the given Parameter string with the values from the Track
public static ReplaceParametersWithTrackValues ( string parameter, TrackData track ) : string
parameter string
track TrackData
Результат string

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

Save the Picture of the track as folder.jpg
public static SavePicture ( TrackData track ) : void
track TrackData
Результат void

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

Converts given seconds to HH:mm:ss
public static SecondsToHMSString ( string sSeconds ) : string
sSeconds string
Результат string

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

Sends a message
public static SendMessage ( string action, string data ) : void
action string
data string
Результат void

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

Sends a Progress Message, so that the status bar can be updated
public static SendProgress ( string message ) : void
message string
Результат void

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

Checks, if the given Drive Letter is a Red Book (Audio) CD
public static isARedBookCD ( string drive ) : bool
drive string
Результат bool