C# Class AddonHelper.Addon

Afficher le fichier Open project: angelog/ClipUpload Class Usage Examples

Méthodes publiques

Свойство Type Description
ProgressBar cProgressBar
rnd System.Random

Méthodes publiques

Méthode Description
AddLog ( string URL, string info ) : void

Add a recently uploaded file to the upload log

Backup ( byte buffer, string filename ) : void

Make a backup of the given file buffer as the current filename

Backup ( string sourceFile ) : void

Make a backup of the given source file

Debug ( string str ) : void

Writes to debug.txt

Drag ( Action doneDragging ) : void

Drag to upload

Epoch ( ) : long

Returns the linux epoch time (seconds passed since 1/1/1970)

GetBetween ( string Source, string Str1, string Str2 ) : string

Get a string between 2 other strings from the source string

GetEncoder ( ImageFormat format ) : System.Drawing.Imaging.ImageCodecInfo

Returns the image encoder for the given ImageFormat

GetProxy ( ) : WebProxy

Get a WebProxy object from the global proxy settings in the ClipUpload application

ImagePipeline ( Image img ) : void

Transforms an image based on global upload settings

LongDataEscape ( string Str ) : string

Alternative of M:System.Uri.EscapeDataString(System.String) to allow for much longer data to be escaped

MD5 ( string S ) : string

Generate an MD5 hash of the given string

PopulateKeysCombobox ( ComboBox comboBox ) : void

Populate a keys combobox with possible keys to press

RandomFilename ( int len, string chars = "abcdefghijklmnopqrstuvwxyz0123456789" ) : string

Returns a random filename based on the length and the allowed characters given

RandomString ( int len, string chars = "abcdefghijklmnopqrstuvwxyz0123456789" ) : string

Returns a random string based on the length and the allowed characters given

SetClipboardText ( string Text ) : void

Safely sets the clipboard text. Refrain from using Clipboard.SetText directly, instead, use this function!

SetShortcuts ( bool enabled ) : void

Enables or disables shortcuts in ClipUpload.

base64Decode ( string input ) : string

Decode a base64 string

base64Encode ( string input ) : string

Encode a string in base64

getDateString ( ) : string

Returns a date string without any delimiters in the following order: Day, month, year, hour, minute, second

Private Methods

Méthode Description
GetOpenClipboardWindow ( ) : IntPtr
formatFilename ( string origFilename ) : string

Method Details

AddLog() public méthode

Add a recently uploaded file to the upload log
public AddLog ( string URL, string info ) : void
URL string The URL
info string Additional info that will appear in the recent uploads list
Résultat void

Backup() public méthode

Make a backup of the given file buffer as the current filename
public Backup ( byte buffer, string filename ) : void
buffer byte The file buffer
filename string The filename
Résultat void

Backup() public méthode

Make a backup of the given source file
public Backup ( string sourceFile ) : void
sourceFile string The source filename
Résultat void

Debug() public méthode

Writes to debug.txt
public Debug ( string str ) : void
str string Line of text
Résultat void

Drag() public méthode

Drag to upload
public Drag ( Action doneDragging ) : void
doneDragging Action Dragging callback
Résultat void

Epoch() public méthode

Returns the linux epoch time (seconds passed since 1/1/1970)
public Epoch ( ) : long
Résultat long

GetBetween() public méthode

Get a string between 2 other strings from the source string
public GetBetween ( string Source, string Str1, string Str2 ) : string
Source string The source string
Str1 string The first string, for example: "<link>"
Str2 string The second string, for example: "</link>"
Résultat string

GetEncoder() public méthode

Returns the image encoder for the given ImageFormat
public GetEncoder ( ImageFormat format ) : System.Drawing.Imaging.ImageCodecInfo
format System.Drawing.Imaging.ImageFormat The ImageFormat to get the encoder for
Résultat System.Drawing.Imaging.ImageCodecInfo

GetProxy() public méthode

Get a WebProxy object from the global proxy settings in the ClipUpload application
public GetProxy ( ) : WebProxy
Résultat System.Net.WebProxy

ImagePipeline() public méthode

Transforms an image based on global upload settings
public ImagePipeline ( Image img ) : void
img Image The base image
Résultat void

LongDataEscape() public méthode

Alternative of M:System.Uri.EscapeDataString(System.String) to allow for much longer data to be escaped
public LongDataEscape ( string Str ) : string
Str string The string to be escaped
Résultat string

MD5() public méthode

Generate an MD5 hash of the given string
public MD5 ( string S ) : string
S string The string
Résultat string

PopulateKeysCombobox() public méthode

Populate a keys combobox with possible keys to press
public PopulateKeysCombobox ( ComboBox comboBox ) : void
comboBox System.Windows.Forms.ComboBox The combobox
Résultat void

RandomFilename() public méthode

Returns a random filename based on the length and the allowed characters given
public RandomFilename ( int len, string chars = "abcdefghijklmnopqrstuvwxyz0123456789" ) : string
len int The length
chars string Allowed characters
Résultat string

RandomString() public static méthode

Returns a random string based on the length and the allowed characters given
public static RandomString ( int len, string chars = "abcdefghijklmnopqrstuvwxyz0123456789" ) : string
len int The length
chars string Allowed characters
Résultat string

SetClipboardText() public méthode

Safely sets the clipboard text. Refrain from using Clipboard.SetText directly, instead, use this function!
public SetClipboardText ( string Text ) : void
Text string The text to set the clipboard to
Résultat void

SetShortcuts() public static méthode

Enables or disables shortcuts in ClipUpload.
public static SetShortcuts ( bool enabled ) : void
enabled bool Bool to enable or disable
Résultat void

base64Decode() public méthode

Decode a base64 string
public base64Decode ( string input ) : string
input string The base64 string to be decoded
Résultat string

base64Encode() public méthode

Encode a string in base64
public base64Encode ( string input ) : string
input string The string to be encoded
Résultat string

getDateString() public méthode

Returns a date string without any delimiters in the following order: Day, month, year, hour, minute, second
public getDateString ( ) : string
Résultat string

Property Details

ProgressBar public_oe property

Used to invoke a progressbar window
public cProgressBar ProgressBar
Résultat cProgressBar

rnd public_oe static_oe property

public static Random,System rnd
Résultat System.Random