DrawingAttributes.Clone Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
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å.