Beispiel #1
0
        public NotifyInfo Clone()
        {
            NotifyInfo objCloned = (NotifyInfo)Activator.CreateInstance(GetType(), null);

            PropertyInfo[] propertyInfos = CBO.Instance.GetPropertyInfo(GetType());

            for (int i = 0; i < propertyInfos.Length; i++)
            {
                try
                {
                    if (propertyInfos[i].Name != "IsOrigin")
                    {
                        GetType().InvokeMember(propertyInfos[i].Name, BindingFlags.SetProperty, null, objCloned,
                                               new[] { propertyInfos[i].GetValue(this, null) });
                    }
                }
                catch (Exception exception)
                {
                    EventLogProvider.Instance.WriteOfflineLog(exception.ToString(), "Clone object.");
                }
            }

            objCloned.IsOrigin = IsOrigin;

            return(objCloned);
        }
Beispiel #2
0
        protected virtual NotifyInfo CloneThis(NotifyInfo objClone)
        {
            objClone.IsOrigin = false;

            return(objClone);
        }