DrawingAttributes.Clone 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
複製了那 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
傳回
一個物件的 DrawingAttributes 複製品。
範例
以下範例示範如何複製一個 DrawingAttributes 物件。
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
備註
此方法建立 Clone 一個新 DrawingAttributes 物件,並填充與目前物件相同的值。 任何自訂屬性也會被複製。