Пример #1
0
        object ICloneable.Clone()
        {
            var copy = new WidgetElement()
            {
                ID = this.ID,
                Version = this.Version,
                Language = this.Language,
                Height = this.Height,
                Width = this.Width,
                ViewModes = this.ViewModes,
                Name = this.Name,
                DefaultLocale = this.DefaultLocale,
                Description = this.Description,
                Direction = this.Direction
            };

            if (this.Author != null)
                copy.Author = this.Author.Clone();

            if (this.Content != null)
                copy.Content = this.Content.Clone();

            if (this.Features != null && this.Features.Count() > 0)
            {
                copy.Features = new List<FeatureElement>();
                foreach (var f in this.Features)
                    copy.Features.Add(f.Clone());
            }

            if (this.Preferences != null && this.Preferences.Count() > 0)
            {
                copy.Preferences = new List<PreferenceElement>();
                foreach (var f in this.Preferences)
                    copy.Preferences.Add(f.Clone());
            }

            if (this.Licenses != null && this.Licenses.Count() > 0)
            {
                copy.Licenses = new List<LicenseElement>();
                foreach (var l in this.Licenses)
                    copy.Licenses.Add(l.Clone());
            }

            if (this.Icons != null && this.Icons.Count() > 0)
            {
                copy.Icons = new List<IconElement>();
                foreach (var l in this.Icons)
                    copy.Icons.Add(l.Clone());
            }

            return copy;
        }
Пример #2
0
        object ICloneable.Clone()
        {
            var copy = new WidgetElement()
            {
                ID            = this.ID,
                Version       = this.Version,
                Language      = this.Language,
                Height        = this.Height,
                Width         = this.Width,
                ViewModes     = this.ViewModes,
                Name          = this.Name,
                DefaultLocale = this.DefaultLocale,
                Description   = this.Description,
                Direction     = this.Direction
            };

            if (this.Author != null)
            {
                copy.Author = this.Author.Clone();
            }

            if (this.Content != null)
            {
                copy.Content = this.Content.Clone();
            }

            if (this.Features != null && this.Features.Count() > 0)
            {
                copy.Features = new List <FeatureElement>();
                foreach (var f in this.Features)
                {
                    copy.Features.Add(f.Clone());
                }
            }

            if (this.Preferences != null && this.Preferences.Count() > 0)
            {
                copy.Preferences = new List <PreferenceElement>();
                foreach (var f in this.Preferences)
                {
                    copy.Preferences.Add(f.Clone());
                }
            }

            if (this.Licenses != null && this.Licenses.Count() > 0)
            {
                copy.Licenses = new List <LicenseElement>();
                foreach (var l in this.Licenses)
                {
                    copy.Licenses.Add(l.Clone());
                }
            }

            if (this.Icons != null && this.Icons.Count() > 0)
            {
                copy.Icons = new List <IconElement>();
                foreach (var l in this.Icons)
                {
                    copy.Icons.Add(l.Clone());
                }
            }

            return(copy);
        }