Example #1
0
        private static object CloneList(IList obj)
        {
            IList list = (IList)Activator.CreateInstance(obj.GetType());

            foreach (object item in obj)
            {
                list.Add(ReportObject.CloneObject(item));
            }
            return(list);
        }
Example #2
0
 protected static object CloneObject(object obj)
 {
     if (obj is ReportObject)
     {
         obj = ((ReportObject)obj).DeepClone();
     }
     else if (obj is IList)
     {
         obj = ReportObject.CloneList((IList)obj);
     }
     return(obj);
 }
Example #3
0
        private void CopyTo(ReportObject clone, ICollection <string> membersToExclude)
        {
            StructMapping structMapping = (StructMapping)TypeMapper.GetTypeMapping(base.GetType());

            foreach (MemberMapping member in structMapping.Members)
            {
                if (member.HasValue(this) && (membersToExclude == null || !membersToExclude.Contains(member.Name)))
                {
                    object value = member.GetValue(this);
                    member.SetValue(clone, ReportObject.CloneObject(value));
                }
            }
        }
Example #4
0
        public virtual object DeepClone()
        {
            Type          type          = base.GetType();
            PropertyStore propertyStore = new PropertyStore();
            ReportObject  reportObject  = (ReportObject)Activator.CreateInstance(type, BindingFlags.Instance | BindingFlags.NonPublic, null, new object[1]
            {
                propertyStore
            }, null);

            propertyStore.SetOwner(reportObject);
            this.CopyTo(reportObject, null);
            return(reportObject);
        }
Example #5
0
 public static void GetDependencies(IList <ReportObject> dependencies, ReportObject parent, string Expression)
 {
 }
Example #6
0
 public void SetOwner(ReportObject owner)
 {
     this.m_owner = owner;
 }
Example #7
0
 public PropertyStore(ReportObject owner)
 {
     this.m_owner = owner;
 }
Example #8
0
 public void GetDependencies(IList <ReportObject> dependencies, ReportObject parent)
 {
     ReportExpressionUtils.GetDependencies(dependencies, parent, this.Expression);
 }