Ejemplo n.º 1
0
        public HeaderFooterBandBaseMenu(Designer designer)
            : base(designer)
        {
            miKeepWithData                       = CreateMenuItem(Res.Get("ComponentMenu,HeaderBand,KeepWithData"), new EventHandler(miKeepWithData_Click));
            miKeepWithData.BeginGroup            = true;
            miKeepWithData.AutoCheckOnClick      = true;
            miRepeatOnEveryPage                  = CreateMenuItem(Res.Get("ComponentMenu,HeaderBand,RepeatOnEveryPage"), new EventHandler(miRepeatOnEveryPage_Click));
            miRepeatOnEveryPage.AutoCheckOnClick = true;

            miStartNewPage.BeginGroup = false;

            int insertPos = Items.IndexOf(miStartNewPage);

            Items.Insert(insertPos, miKeepWithData);
            Items.Insert(insertPos + 1, miRepeatOnEveryPage);

            HeaderFooterBandBase band = Designer.SelectedObjects[0] as HeaderFooterBandBase;
            bool enabled = !band.HasRestriction(Restrictions.DontModify);

            miKeepWithData.Enabled      = enabled;
            miRepeatOnEveryPage.Enabled = enabled;
            miKeepWithData.Checked      = band.KeepWithData;
            miRepeatOnEveryPage.Checked = band.RepeatOnEveryPage;
        }