コード例 #1
0
ファイル: SLFilters.cs プロジェクト: mousetwentytwo/test
        internal void FromFilters(Filters fs)
        {
            this.SetAllNull();

            if (fs.Blank != null && fs.Blank.Value) this.Blank = fs.Blank.Value;
            if (fs.CalendarType != null) this.CalendarType = fs.CalendarType.Value;

            if (fs.HasChildren)
            {
                SLFilter f;
                SLDateGroupItem dgi;
                using (OpenXmlReader oxr = OpenXmlReader.Create(fs))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(Filter))
                        {
                            f = new SLFilter();
                            f.FromFilter((Filter)oxr.LoadCurrentElement());
                            this.Filters.Add(f);
                        }
                        else if (oxr.ElementType == typeof(DateGroupItem))
                        {
                            dgi = new SLDateGroupItem();
                            dgi.FromDateGroupItem((DateGroupItem)oxr.LoadCurrentElement());
                            this.DateGroupItems.Add(dgi);
                        }
                    }
                }
            }
        }
コード例 #2
0
        internal void FromFilters(Filters fs)
        {
            this.SetAllNull();

            if (fs.Blank != null && fs.Blank.Value)
            {
                this.Blank = fs.Blank.Value;
            }
            if (fs.CalendarType != null)
            {
                this.CalendarType = fs.CalendarType.Value;
            }

            if (fs.HasChildren)
            {
                SLFilter        f;
                SLDateGroupItem dgi;
                using (OpenXmlReader oxr = OpenXmlReader.Create(fs))
                {
                    while (oxr.Read())
                    {
                        if (oxr.ElementType == typeof(Filter))
                        {
                            f = new SLFilter();
                            f.FromFilter((Filter)oxr.LoadCurrentElement());
                            this.Filters.Add(f);
                        }
                        else if (oxr.ElementType == typeof(DateGroupItem))
                        {
                            dgi = new SLDateGroupItem();
                            dgi.FromDateGroupItem((DateGroupItem)oxr.LoadCurrentElement());
                            this.DateGroupItems.Add(dgi);
                        }
                    }
                }
            }
        }