Helper class for cloning records. Keeps track of masters used by various plugins before adding
Example #1
0
        /// <summary>
        ///  Copy Records to new plugin.  By default make as overrides
        /// </summary>
        /// <param name="src"></param>
        /// <param name="dst"></param>
        /// <param name="bOverride">Make record an override in the new location</param>
        /// <returns></returns>
        public static int CopyRecordsTo(BaseRecord[] src, IGroupRecord dst, bool bOverride = true)
        {
            int count = 0;

            if (src != null && dst != null)
            {
                if (dst is Plugin)
                {
                    var plugin = (Plugin)dst;
                    count = new CloneTool(plugin, bOverride).CopyRecordsTo(src);
                }
                else
                {
                    var dstRec = src.Select(x => x.Clone()).ToArray();
                    dst.AddRecords(dstRec);
                    count += dstRec.Count();
                }
            }

            return(count);
        }
Example #2
0
        /// <summary>
        ///  Copy Records to new plugin.  By default make as overrides
        /// </summary>
        /// <param name="src"></param>
        /// <param name="dst"></param>
        /// <param name="bOverride">Make record an override in the new location</param>
        /// <returns></returns>
        public static int CopyRecordsTo(BaseRecord[] src, IGroupRecord dst, bool bOverride = true)
        {
            int count = 0;
            if (src != null && dst != null)
            {
                if (dst is Plugin)
                {
                    var plugin = (Plugin)dst;
                    count = new CloneTool(plugin, bOverride).CopyRecordsTo(src);
                }
                else
                {
                    var dstRec = src.Select(x => x.Clone()).ToArray();
                    dst.AddRecords(dstRec);
                    count += dstRec.Count();
                }
            }

            return count;
        }