public void CopyTo(XVBAScriptGlobalObjectList list) { if (list == null) { throw new ArgumentNullException("list"); } if (myItems == null) { list.myItems = new ArrayList(); } else { list.myItems = (ArrayList)this.myItems.Clone(); } }
/// <summary> /// 复制对象 /// </summary> /// <returns>复制品</returns> object ICloneable.Clone() { XVBAScriptGlobalObjectList list = ( XVBAScriptGlobalObjectList)System.Activator.CreateInstance(this.GetType()); list.myItems.Clear(); foreach (XVBAScriptGlobalObject item in this.myItems) { XVBAScriptGlobalObject newItem = new XVBAScriptGlobalObject(); newItem.Name = item.Name; newItem.Value = item.Value; newItem.ValueType = item.ValueType; list.myItems.Add(newItem); } return(list); }