Beispiel #1
0
        /// <summary>
        /// Deep copy
        /// </summary>
        /// <returns></returns>
        public MType Clone()
        {
            MType clone = new MType(this.Name);

            PItem.CopyProperties(this, clone);

            foreach (MInstance instance in instances)
            {
                clone.Instances.Add(instance.Clone());
            }

            return(clone);
        }
Beispiel #2
0
        public static void CopyProperties(PItem src, PItem dest)
        {
            dest.Name        = src.Name;
            dest.Description = src.Description;
            dest.Id          = src.Id;

            if (src.Meta != null)
            {
                dest.meta = new Meta();
                foreach (KeyValuePair <string, string> kv in src.meta)
                {
                    dest.meta[kv.Key] = kv.Value;
                }
            }
        }