コード例 #1
0
        internal SLRangeSet Clone()
        {
            var rs = new SLRangeSet();

            rs.FieldItemIndexPage1 = FieldItemIndexPage1;
            rs.FieldItemIndexPage2 = FieldItemIndexPage2;
            rs.FieldItemIndexPage3 = FieldItemIndexPage3;
            rs.FieldItemIndexPage4 = FieldItemIndexPage4;
            rs.Reference           = Reference;
            rs.Name  = Name;
            rs.Sheet = Sheet;
            rs.Id    = Id;

            return(rs);
        }
コード例 #2
0
        internal void FromConsolidation(Consolidation c)
        {
            SetAllNull();

            if (c.AutoPage != null)
            {
                AutoPage = c.AutoPage.Value;
            }

            Page          pg;
            PageItem      pgi;
            List <string> listPage;
            SLRangeSet    rs;

            using (var oxr = OpenXmlReader.Create(c))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Page))
                    {
                        listPage = new List <string>();
                        pg       = (Page)oxr.LoadCurrentElement();
                        using (var oxrPage = OpenXmlReader.Create(pg))
                        {
                            while (oxrPage.Read())
                            {
                                if (oxrPage.ElementType == typeof(PageItem))
                                {
                                    pgi = (PageItem)oxrPage.LoadCurrentElement();
                                    listPage.Add(pgi.Name.Value);
                                }
                            }
                        }
                        Pages.Add(listPage);
                    }
                    else if (oxr.ElementType == typeof(RangeSet))
                    {
                        rs = new SLRangeSet();
                        rs.FromRangeSet((RangeSet)oxr.LoadCurrentElement());
                        RangeSets.Add(rs);
                    }
                }
            }
        }