Пример #1
0
 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();
     }
 }
Пример #2
0
        /// <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);
        }