internal FieldGroup ToFieldGroup()
        {
            FieldGroup fg = new FieldGroup();

            if (this.ParentId != null)
            {
                fg.ParentId = this.ParentId.Value;
            }
            if (this.Base != null)
            {
                fg.Base = this.Base.Value;
            }

            if (this.HasRangeProperties)
            {
                fg.Append(this.RangeProperties.ToRangeProperties());
            }

            if (this.DiscreteProperties.Count > 0)
            {
                DiscreteProperties dp = new DiscreteProperties();
                dp.Count = (uint)this.DiscreteProperties.Count;
                foreach (uint i in this.DiscreteProperties)
                {
                    dp.Append(new FieldItem()
                    {
                        Val = i
                    });
                }

                fg.Append(dp);
            }

            if (this.HasGroupItems)
            {
                fg.Append(this.GroupItems.ToGroupItems());
            }

            return(fg);
        }
        internal FieldGroup ToFieldGroup()
        {
            var fg = new FieldGroup();

            if (ParentId != null)
            {
                fg.ParentId = ParentId.Value;
            }
            if (Base != null)
            {
                fg.Base = Base.Value;
            }

            if (HasRangeProperties)
            {
                fg.Append(RangeProperties.ToRangeProperties());
            }

            if (DiscreteProperties.Count > 0)
            {
                var dp = new DiscreteProperties();
                dp.Count = (uint)DiscreteProperties.Count;
                foreach (var i in DiscreteProperties)
                {
                    dp.Append(new FieldItem {
                        Val = i
                    });
                }

                fg.Append(dp);
            }

            if (HasGroupItems)
            {
                fg.Append(GroupItems.ToGroupItems());
            }

            return(fg);
        }
        internal FieldGroup ToFieldGroup()
        {
            FieldGroup fg = new FieldGroup();
            if (this.ParentId != null) fg.ParentId = this.ParentId.Value;
            if (this.Base != null) fg.Base = this.Base.Value;

            if (this.HasRangeProperties)
            {
                fg.Append(this.RangeProperties.ToRangeProperties());
            }

            if (this.DiscreteProperties.Count > 0)
            {
                DiscreteProperties dp = new DiscreteProperties();
                dp.Count = (uint)this.DiscreteProperties.Count;
                foreach (uint i in this.DiscreteProperties)
                {
                    dp.Append(new FieldItem() { Val = i });
                }

                fg.Append(dp);
            }

            if (this.HasGroupItems)
            {
                fg.Append(this.GroupItems.ToGroupItems());
            }

            return fg;
        }