コード例 #1
0
        public IdentifiedDate Clone()
        {
            var clone = new IdentifiedDate()
            {
                Date = this.Date,
            };

            clone.Events.AddRange(this.Events.Select(c => c.Clone()));

            return(clone);
        }
コード例 #2
0
        internal void Merge(IdentifiedDate value)
        {
            var dic = this.Events.ToDictionary(c => (c.Date, c.Country, c.Region, c.Name));

            foreach (EventDate edate in value.Events)
            {
                var k = (edate.Date, edate.Country, edate.Region, edate.Name);
                if (!dic.ContainsKey(k))
                {
                    var cc = edate.Clone();
                    this.Events.Add(cc);
                    dic.Add(k, cc);
                }
            }
        }