ActivityCodeDomSerializationManager.SetName(Object, String) 方法

定义

设置指定的现有 Object 的名称。Sets the name of the specified existing Object.

public:
 virtual void SetName(System::Object ^ instance, System::String ^ name);
public void SetName (object instance, string name);
abstract member SetName : obj * string -> unit
override this.SetName : obj * string -> unit
Public Sub SetName (instance As Object, name As String)

参数

instance
Object

要命名的 Object 实例。The Object instance to name.

name
String

一个 String,其中包含要为实例指定的名称。A String that contains the name to give the instance.

实现

注解

SetName 提供了对相同名称的 SerializationManager 方法的间接引用。SetName provides an indirect reference to the SerializationManager method of the same name.

如果试图重命名现有对象或者试图为新对象指定一个已被使用的名称,则将引发异常。An exception is thrown if you try to rename an existing object or if you try to give a new object a name that is already taken. 此外,如果不将现有对象传入方法,则将引发异常。In addition, an exception is thrown if you do not pass in an existing object to the method.

适用于