internal void FromDateTimeItem(DateTimeItem dti)
        {
            SetAllNull();

            if (dti.Val != null)
            {
                Val = dti.Val.Value;
            }
            if (dti.Unused != null)
            {
                Unused = dti.Unused.Value;
            }
            if (dti.Calculated != null)
            {
                Calculated = dti.Calculated.Value;
            }
            if (dti.Caption != null)
            {
                Caption = dti.Caption.Value;
            }
            if (dti.PropertyCount != null)
            {
                PropertyCount = dti.PropertyCount.Value;
            }

            MemberPropertyIndex mpi;

            using (var oxr = OpenXmlReader.Create(dti))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        // 0 is the default value.
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null)
                        {
                            MemberPropertyIndexes.Add(mpi.Val.Value);
                        }
                        else
                        {
                            MemberPropertyIndexes.Add(0);
                        }
                    }
                }
            }
        }
        internal void FromRowItem(RowItem ri)
        {
            SetAllNull();

            if (ri.ItemType != null)
            {
                ItemType = ri.ItemType.Value;
            }
            if (ri.RepeatedItemCount != null)
            {
                RepeatedItemCount = ri.RepeatedItemCount.Value;
            }
            if (ri.Index != null)
            {
                Index = ri.Index.Value;
            }

            MemberPropertyIndex mpi;

            using (var oxr = OpenXmlReader.Create(ri))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null)
                        {
                            MemberPropertyIndexes.Add(mpi.Val.Value);
                        }
                        else
                        {
                            MemberPropertyIndexes.Add(0);
                        }
                    }
                }
            }
        }
        internal void FromMissingItem(MissingItem mi)
        {
            SetAllNull();

            if (mi.Unused != null)
            {
                Unused = mi.Unused.Value;
            }
            if (mi.Calculated != null)
            {
                Calculated = mi.Calculated.Value;
            }
            if (mi.Caption != null)
            {
                Caption = mi.Caption.Value;
            }
            if (mi.PropertyCount != null)
            {
                PropertyCount = mi.PropertyCount.Value;
            }
            if (mi.FormatIndex != null)
            {
                FormatIndex = mi.FormatIndex.Value;
            }
            if (mi.BackgroundColor != null)
            {
                BackgroundColor = mi.BackgroundColor.Value;
            }
            if (mi.ForegroundColor != null)
            {
                ForegroundColor = mi.ForegroundColor.Value;
            }
            if (mi.Italic != null)
            {
                Italic = mi.Italic.Value;
            }
            if (mi.Underline != null)
            {
                Underline = mi.Underline.Value;
            }
            if (mi.Strikethrough != null)
            {
                Strikethrough = mi.Strikethrough.Value;
            }
            if (mi.Bold != null)
            {
                Bold = mi.Bold.Value;
            }

            SLTuplesType        tt;
            MemberPropertyIndex mpi;

            using (var oxr = OpenXmlReader.Create(mi))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Tuples))
                    {
                        tt = new SLTuplesType();
                        tt.FromTuples((Tuples)oxr.LoadCurrentElement());
                        Tuples.Add(tt);
                    }
                    else if (oxr.ElementType == typeof(MemberPropertyIndex))
                    {
                        // 0 is the default value.
                        mpi = (MemberPropertyIndex)oxr.LoadCurrentElement();
                        if (mpi.Val != null)
                        {
                            MemberPropertyIndexes.Add(mpi.Val.Value);
                        }
                        else
                        {
                            MemberPropertyIndexes.Add(0);
                        }
                    }
                }
            }
        }