C# Класс Open.Core.Common.StringExtensions

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

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

Метод Описание
GetFolder ( string folderPath ) : DirectoryInfo
ToComponentUri ( this resourcePath ) : Uri

Converts the path to a resource into a fully qualified component URI using the calling assembly (eg "/assembly;component/Images/MyImage.png").

ToComponentUri ( this resourcePath, Assembly assembly ) : Uri

Converts the path to a resource into a fully qualified component URI (eg "/assembly;component/Images/MyImage.png").

ToImage ( this source ) : System.Image

Converts the given source to an Image.

ToImage ( this url, UriKind uriKind ) : System.Image

Creates an image setting the 'Source' to the specified image path.

To load images dynamicaly from the server use the following settings:
1. UriKind = Relative.
2. Prefix the URL with a '/' (eg. /Images/Logo.png).
3. If storing the images in the calling project set the image BuildAction = 'None' and Copy to Output Directory = 'Copy always'
Look for the image in the 'bin' directory. 3. Copy the images to the 'ClientBin' folder of the hosting web-site.

ToImageSource ( this resourcePath ) : BitmapImage

Converts the path to a resource into a fully qualified component URI (eg "/assembly;component/Images/MyImage.png") and loads it into a bitmap image which can be used as the 'Source' of an Image.

ToImageSource ( this resourcePath, Assembly assembly ) : BitmapImage

Converts the path to a resource into a fully qualified component URI (eg "/assembly;component/Images/MyImage.png") and loads it into a bitmap image which can be used as the 'Source' of an Image.

ToImageSource ( this resourcePath, ImageLocation location ) : BitmapImage

Converts the path to a resource into bitmap image which can be used as the 'Source' of an Image.

ToPathGeometry ( this self ) : Path

Loads the given geometry data string as a XAML Path..

Don't forget to set the Fill and Stretch properties on the returned object.

WriteToProjectFile ( this content, string folder, string fileName ) : void

Writes the given string to a file within the executing application's folder.

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

Метод Описание
GetApplicationPath ( ) : string
GetMatchingDirectory ( DirectoryInfo start, string name ) : DirectoryInfo

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

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

public static GetFolder ( string folderPath ) : DirectoryInfo
folderPath string
Результат System.IO.DirectoryInfo

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

Converts the path to a resource into a fully qualified component URI using the calling assembly (eg "/assembly;component/Images/MyImage.png").
public static ToComponentUri ( this resourcePath ) : Uri
resourcePath this /// The path to the resource from the root of the project.
/// This may, or may not, contain a leading '/' character.
/// For example: "Images/MyImage.png"
///
Результат System.Uri

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

Converts the path to a resource into a fully qualified component URI (eg "/assembly;component/Images/MyImage.png").
public static ToComponentUri ( this resourcePath, Assembly assembly ) : Uri
resourcePath this /// The path to the resource from the root of the project.
/// This may, or may not, contain a leading '/' character.
/// For example: "Images/MyImage.png"
///
assembly System.Reflection.Assembly The assembly the resource is within.
Результат System.Uri

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

Converts the given source to an Image.
public static ToImage ( this source ) : System.Image
source this The source of the image.
Результат System.Image

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

Creates an image setting the 'Source' to the specified image path.
To load images dynamicaly from the server use the following settings:
1. UriKind = Relative.
2. Prefix the URL with a '/' (eg. /Images/Logo.png).
3. If storing the images in the calling project set the image BuildAction = 'None' and Copy to Output Directory = 'Copy always'
Look for the image in the 'bin' directory. 3. Copy the images to the 'ClientBin' folder of the hosting web-site.
public static ToImage ( this url, UriKind uriKind ) : System.Image
url this The URL path to the image.
uriKind UriKind The kind of URI passed in the 'url' string.
Результат System.Image

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

Converts the path to a resource into a fully qualified component URI (eg "/assembly;component/Images/MyImage.png") and loads it into a bitmap image which can be used as the 'Source' of an Image.
public static ToImageSource ( this resourcePath ) : BitmapImage
resourcePath this /// The path to the resource from the root of the project.
/// This may, or may not, contain a leading '/' character.
/// For example: "Images/MyImage.png"
///
Результат BitmapImage

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

Converts the path to a resource into a fully qualified component URI (eg "/assembly;component/Images/MyImage.png") and loads it into a bitmap image which can be used as the 'Source' of an Image.
public static ToImageSource ( this resourcePath, Assembly assembly ) : BitmapImage
resourcePath this /// The path to the resource from the root of the project.
/// This may, or may not, contain a leading '/' character.
/// For example: "Images/MyImage.png"
///
assembly System.Reflection.Assembly The assembly the resource is within.
Результат BitmapImage

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

Converts the path to a resource into bitmap image which can be used as the 'Source' of an Image.
public static ToImageSource ( this resourcePath, ImageLocation location ) : BitmapImage
resourcePath this /// The path to the resource from the root of the project or the root of the ClientBin (depending on 'location').
///
location ImageLocation Flag indicating whether the image is packaged in the XAP on the client, or is in the ClientBin on the server.
Результат BitmapImage

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

Loads the given geometry data string as a XAML Path..
Don't forget to set the Fill and Stretch properties on the returned object.
public static ToPathGeometry ( this self ) : Path
self this The geometry data.
Результат System.IO.Path

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

Writes the given string to a file within the executing application's folder.
public static WriteToProjectFile ( this content, string folder, string fileName ) : void
content this The content to write.
folder string The path of the folder (starting at the name of the project folder).
fileName string The name of the file
Результат void