コード例 #1
0
        protected override IGroup CreateNewGroup(GroupDescription groupDescription)
        {
            if (groupDescription.Key != null && groupDescription.Key != "Radio")
            {
                throw new ArgumentException("We only know about RadioGroups at present, not: " + groupDescription.Key);
            }

            return new RadioGroup();
        }
コード例 #2
0
 protected abstract IGroup CreateNewGroup(GroupDescription groupDescription);
コード例 #3
0
        private void FillGroup(object element, GroupDescription groupDescription)
        {
            if (groupDescription == null)
                return;

            var rootElement = element as IRootElement;
            if (rootElement == null)
            {
                throw new ArgumentException("You cannot set a group on an Element of type " + element.GetType().Name);
            }

            var group = CreateNewGroup(groupDescription);
            FillProperties(group, groupDescription.Properties);
            rootElement.Group = group;
        }