DrawingAttributes.Clone Metod

Definition

Kopierar objektet DrawingAttributes .

public:
 virtual System::Windows::Ink::DrawingAttributes ^ Clone();
public virtual System.Windows.Ink.DrawingAttributes Clone();
abstract member Clone : unit -> System.Windows.Ink.DrawingAttributes
override this.Clone : unit -> System.Windows.Ink.DrawingAttributes
Public Overridable Function Clone () As DrawingAttributes

Returer

En kopia av DrawingAttributes objektet.

Exempel

I följande exempel visas hur du kopierar ett DrawingAttributes objekt.

void CopyAttributes(Stroke someStroke)
{
    DrawingAttributes attributes = new DrawingAttributes();
    attributes.Color = Colors.Red;
    someStroke.DrawingAttributes = attributes.Clone();
}
Sub CopyAttributes(ByVal someStroke As Stroke)
    Dim attributes As New DrawingAttributes()
    attributes.Color = Colors.Red
    someStroke.DrawingAttributes = attributes.Clone()
End Sub

Kommentarer

Metoden Clone skapar ett nytt DrawingAttributes objekt och fyller det med samma värden som det aktuella objektet. Alla anpassade egenskaper kopieras också.

Gäller för

Se även