StrokeCollectionConverter Classe

Definizione

Converte un StrokeCollection in una stringa.

public ref class StrokeCollectionConverter : System::ComponentModel::TypeConverter
public class StrokeCollectionConverter : System.ComponentModel.TypeConverter
type StrokeCollectionConverter = class
    inherit TypeConverter
Public Class StrokeCollectionConverter
Inherits TypeConverter
Ereditarietà
StrokeCollectionConverter

Esempio

Nell'esempio seguente viene illustrato come convertire una stringa ISF con codifica base 64 in un oggetto StrokeCollection. Ciò presuppone che sia presente un InkPresenter oggetto denominato presenter.

// The base-64 encoded string that contains ink data 
// in ink serialized format (ISF).
string strokesString =
    @"AOoFAxBIEEVqGwIAWf9GahsCAFn/GRQyCACAEAIAAABCMwgAgA"
    + "wCAAAAQhWrqtNBq6rTQaVh0MSr+ivFHyEVVFVVVVV1OkBUVVVVVXU6QJ7"
    + "0SZ80DJrAVFVVVVV/pcAKU3yC/gEb+AX/k5Z8PwWBO5KktgJSUAAKjzyC"
    + "wBZYLEoCJLd+Cbti873JlTUvn158doCC/gKb+ApwAJslSywE2ALAAWPPI"
    + "FhKWBKWAKAmwJVglAKACiMjgv3d+8Xi+fHWM2WC0zcm89+NSoL+A5P4Dl"
    + "uNlhFIqpLKAAoaF4L+AhP4CFAWAWCggv4Dc/gNty2yy5SrlKAKIhyC/gI"
    + "b+Ai+JZc2XZOyb46vLQCC/gOL+A5YDNlWFjN3CwAKQFeC/gOr+A7VhUFZ"
    + "KCsS2WTc2SyhKuWVLR3ly2LAXx574ssUgv4Dm/gOcCwEEpUTYSixUsuWy"
    + "gVZ79AQsWGyWUAKLCiC/gQT+BA9SWbllDfGqy3Lcu+OmfH8EIL+BDv4EP"
    + "XLKSpY3lVFhZuVZvKACkFggv4F2/gXlKLFuCVKTcsqUlkoRKBmk8zfFll"
    + "S2ySlACwAgv4Ds/gO+WWWWLBLFllllSksAoSkWG1kSbFu5AoAAAo/YoL+"
    + "Biv4GJJU+P4qSalUBKWdkBYCbm+Nliyk1CVKgCxYNYqC/gQb+BBwO8ABY"
    + "olDz4gAEzaw2AVCUKAsWCooCiAegv4Hw/gfEJe8zUoSgLCC/gNT+A0xM7"
    + "Gdmdliay2VaAo0PoL+B7v4Hx5Yq3lc2xZsseeC3N8aDXjUpWW4UIL+A5P"
    + "4DnhYqAIWFkqpcrLZuJuWqSyxVAovNoL+CJP4IjnlkDvHeSbSVd9FqFlI"
    + "oWAAgv4Dk/gOVc7gbmdyZ1LajFFJmlRKsoAKVXmC/go7+CjdRvredypaK"
    + "myLC7ytZQqFiyWbikAEvfg2pSVKS7liSwWJNsrbi4CC/gQD+A/9M2ACxU"
    + "qKjcVuXKiosCWWKQSyhvKRUUWULCwEmyyu4gA=";
' The base-64 encoded string that contains ink data 
' in ink serialized format (ISF).
Private strokesString As String = _
    "AOoFAxBIEEVqGwIAWf9GahsCAFn/GRQyCACAEAIAAABCMwgAgA" _
    & "wCAAAAQhWrqtNBq6rTQaVh0MSr+ivFHyEVVFVVVVV1OkBUVVVVVXU6QJ7" _
    & "0SZ80DJrAVFVVVVV/pcAKU3yC/gEb+AX/k5Z8PwWBO5KktgJSUAAKjzyC" _
    & "wBZYLEoCJLd+Cbti873JlTUvn158doCC/gKb+ApwAJslSywE2ALAAWPPI" _
    & "FhKWBKWAKAmwJVglAKACiMjgv3d+8Xi+fHWM2WC0zcm89+NSoL+A5P4Dl" _
    & "uNlhFIqpLKAAoaF4L+AhP4CFAWAWCggv4Dc/gNty2yy5SrlKAKIhyC/gI" _
    & "b+Ai+JZc2XZOyb46vLQCC/gOL+A5YDNlWFjN3CwAKQFeC/gOr+A7VhUFZ" _
    & "KCsS2WTc2SyhKuWVLR3ly2LAXx574ssUgv4Dm/gOcCwEEpUTYSixUsuWy" _
    & "gVZ79AQsWGyWUAKLCiC/gQT+BA9SWbllDfGqy3Lcu+OmfH8EIL+BDv4EP" _
    & "XLKSpY3lVFhZuVZvKACkFggv4F2/gXlKLFuCVKTcsqUlkoRKBmk8zfFll" _
    & "S2ySlACwAgv4Ds/gO+WWWWLBLFllllSksAoSkWG1kSbFu5AoAAAo/YoL+" _
    & "Biv4GJJU+P4qSalUBKWdkBYCbm+Nliyk1CVKgCxYNYqC/gQb+BBwO8ABY" _
    & "olDz4gAEzaw2AVCUKAsWCooCiAegv4Hw/gfEJe8zUoSgLCC/gNT+A0xM7" _
    & "Gdmdliay2VaAo0PoL+B7v4Hx5Yq3lc2xZsseeC3N8aDXjUpWW4UIL+A5P" _
    & "4DnhYqAIWFkqpcrLZuJuWqSyxVAovNoL+CJP4IjnlkDvHeSbSVd9FqFlI" _
    & "oWAAgv4Dk/gOVc7gbmdyZ1LajFFJmlRKsoAKVXmC/go7+CjdRvredypaK" _
    & "myLC7ytZQqFiyWbikAEvfg2pSVKS7liSwWJNsrbi4CC/gQD+A/9M2ACxU" _
    & "qKjcVuXKiosCWWKQSyhvKRUUWULCwEmyyu4gA="
// Accepts a string that contains ink data in ink 
// serialized format (ISF) and converts it into a StrokeCollection.
public void LoadStrokes()
{
    StrokeCollectionConverter converter =
        new StrokeCollectionConverter();

    if (converter.CanConvertFrom(typeof(string)))
    {
        StrokeCollection newStrokes =
            (StrokeCollection)converter.ConvertFrom(null, null, strokesString);
        presenter.Strokes.Clear();
        presenter.Strokes.Add(newStrokes);
    }
}
' Accepts a string that contains ink data in ink 
' serialized format (ISF) and converts it into a StrokeCollection.
Public Sub LoadStrokes()

    Dim converter As New StrokeCollectionConverter()

    If converter.CanConvertFrom(GetType(String)) Then
        Dim newStrokes As StrokeCollection

        newStrokes = converter.ConvertFrom(Nothing, Nothing, strokesString)
        presenter.Strokes.Clear()
        presenter.Strokes.Add(newStrokes)

    End If

End Sub

Commenti

StrokeCollectionConverter Converte un oggetto in StrokeCollection una stringa che rappresenta l'oggetto StrokeCollection in formato Ink Serialized Format (ISF) in base 64. È utile archiviare i dati input penna come ISF con codifica base 64 quando non è possibile archiviare dati di byte non elaborati, ad esempio nelle pagine Web.

Costruttori

Nome Descrizione
StrokeCollectionConverter()

Inizializza una nuova istanza della classe StrokeCollectionConverter.

Metodi

Nome Descrizione
CanConvertFrom(ITypeDescriptorContext, Type)

Restituisce un valore che indica se l'oggetto StrokeCollectionConverter può convertire un oggetto di un tipo specificato in un oggetto StrokeCollection.

CanConvertFrom(Type)

Restituisce un valore che indica se questo convertitore può convertire un oggetto del tipo specificato nel tipo di questo convertitore.

(Ereditato da TypeConverter)
CanConvertTo(ITypeDescriptorContext, Type)

Restituisce un valore che indica se l'oggetto StrokeCollectionConverter può convertire un oggetto StrokeCollection nel tipo specificato.

CanConvertTo(Type)

Restituisce un valore che indica se questo convertitore può convertire l'oggetto nel tipo specificato.

(Ereditato da TypeConverter)
ConvertFrom(ITypeDescriptorContext, CultureInfo, Object)

Converte l'oggetto specificato in un oggetto StrokeCollection.

ConvertFrom(Object)

Converte il valore specificato nel tipo di questo convertitore.

(Ereditato da TypeConverter)
ConvertFromInvariantString(ITypeDescriptorContext, String)

Converte la stringa specificata nel tipo di questo convertitore, utilizzando le impostazioni cultura invarianti e il contesto specificato.

(Ereditato da TypeConverter)
ConvertFromInvariantString(String)

Converte la stringa specificata nel tipo di questo convertitore, utilizzando le impostazioni cultura invarianti.

(Ereditato da TypeConverter)
ConvertFromString(ITypeDescriptorContext, CultureInfo, String)

Converte il testo specificato in un oggetto utilizzando il contesto e le informazioni sulle impostazioni cultura specificate.

(Ereditato da TypeConverter)
ConvertFromString(ITypeDescriptorContext, String)

Converte il testo specificato in un oggetto utilizzando il contesto specificato.

(Ereditato da TypeConverter)
ConvertFromString(String)

Converte il testo specificato in un oggetto .

(Ereditato da TypeConverter)
ConvertTo(ITypeDescriptorContext, CultureInfo, Object, Type)

Converte un StrokeCollection in una stringa.

ConvertTo(Object, Type)

Converte l'oggetto valore specificato nel tipo specificato utilizzando gli argomenti .

(Ereditato da TypeConverter)
ConvertToInvariantString(ITypeDescriptorContext, Object)

Converte il valore specificato in una rappresentazione di stringa invariante delle impostazioni cultura, utilizzando il contesto specificato.

(Ereditato da TypeConverter)
ConvertToInvariantString(Object)

Converte il valore specificato in una rappresentazione di stringa invariante delle impostazioni cultura.

(Ereditato da TypeConverter)
ConvertToString(ITypeDescriptorContext, CultureInfo, Object)

Converte il valore specificato in una rappresentazione di stringa, utilizzando il contesto e le informazioni sulle impostazioni cultura specificate.

(Ereditato da TypeConverter)
ConvertToString(ITypeDescriptorContext, Object)

Converte il valore specificato in una rappresentazione di stringa, utilizzando il contesto specificato.

(Ereditato da TypeConverter)
ConvertToString(Object)

Converte il valore specificato in una rappresentazione di stringa.

(Ereditato da TypeConverter)
CreateInstance(IDictionary)

Ricrea un Object dato un set di valori di proprietà per l'oggetto.

(Ereditato da TypeConverter)
CreateInstance(ITypeDescriptorContext, IDictionary)

Crea un'istanza del tipo a cui è associato questo TypeConverter utilizzando il contesto specificato, dato un set di valori di proprietà per l'oggetto .

(Ereditato da TypeConverter)
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetConvertFromException(Object)

Restituisce un'eccezione da generare quando non è possibile eseguire una conversione.

(Ereditato da TypeConverter)
GetConvertToException(Object, Type)

Restituisce un'eccezione da generare quando non è possibile eseguire una conversione.

(Ereditato da TypeConverter)
GetCreateInstanceSupported()

Restituisce un valore che indica se la modifica di un valore in questo oggetto richiede una chiamata al metodo CreateInstance(IDictionary) per creare un nuovo valore.

(Ereditato da TypeConverter)
GetCreateInstanceSupported(ITypeDescriptorContext)

Restituisce un valore che indica se la modifica di un valore in questo oggetto richiede una chiamata a CreateInstance(IDictionary) per creare un nuovo valore, utilizzando il contesto specificato.

(Ereditato da TypeConverter)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetProperties(ITypeDescriptorContext, Object, Attribute[])

Restituisce una raccolta di proprietà per il tipo di matrice specificato dal parametro value, utilizzando il contesto e gli attributi specificati.

(Ereditato da TypeConverter)
GetProperties(ITypeDescriptorContext, Object)

Restituisce una raccolta di proprietà per il tipo di matrice specificato dal parametro value, utilizzando il contesto specificato.

(Ereditato da TypeConverter)
GetProperties(Object)

Restituisce un insieme di proprietà per il tipo di matrice specificato dal parametro value.

(Ereditato da TypeConverter)
GetPropertiesSupported()

Restituisce un valore che indica se l'oggetto supporta le proprietà.

(Ereditato da TypeConverter)
GetPropertiesSupported(ITypeDescriptorContext)

Restituisce un valore che indica se l'oggetto supporta le proprietà utilizzando il contesto specificato.

(Ereditato da TypeConverter)
GetStandardValues()

Restituisce una raccolta di valori standard dal contesto predefinito per il tipo di dati per cui è progettato questo convertitore di tipi.

(Ereditato da TypeConverter)
GetStandardValues(ITypeDescriptorContext)

Restituisce una raccolta di valori standard per il tipo di dati che questo convertitore di tipi è progettato per quando viene fornito con un contesto di formato.

(Ereditato da TypeConverter)
GetStandardValuesExclusive()

Restituisce un valore che indica se l'insieme di valori standard restituiti da GetStandardValues() è un elenco esclusivo.

(Ereditato da TypeConverter)
GetStandardValuesExclusive(ITypeDescriptorContext)

Restituisce un valore che indica se la raccolta di valori standard restituiti da GetStandardValues() è un elenco esclusivo di valori possibili, utilizzando il contesto specificato.

(Ereditato da TypeConverter)
GetStandardValuesSupported()

Restituisce un valore che indica se l'oggetto supporta un set standard di valori che è possibile selezionare da un elenco.

(Ereditato da TypeConverter)
GetStandardValuesSupported(ITypeDescriptorContext)

Restituisce un valore che indica se l'oggetto supporta un set standard di valori che è possibile selezionare da un elenco, utilizzando il contesto specificato.

GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
IsValid(ITypeDescriptorContext, Object)

Restituisce un valore che indica se l'oggetto valore specificato è valido per questo tipo e per il contesto specificato.

(Ereditato da TypeConverter)
IsValid(Object)

Restituisce un valore che indica se l'oggetto valore specificato è valido per questo tipo.

(Ereditato da TypeConverter)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
SortProperties(PropertyDescriptorCollection, String[])

Ordina una raccolta di proprietà.

(Ereditato da TypeConverter)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a