コード例 #1
0
        protected override void CreateChildControls()
        {
            Controls.Clear();
            ownerValue = new TemplateOwner();

            ITemplate temp = templateValue;

            temp ??= new DefaultTemplate();

            temp.InstantiateIn(ownerValue);
            this.Controls.Add(ownerValue);
        }
コード例 #2
0
        public RsCheckBoxTemplateField()
        {
            container = new TemplateOwner();

            header = new RsCheckBoxListTemplate(ListItemType.Header);
            header.InstantiateIn(container);
            this.HeaderTemplate              = header;
            this.HeaderStyle.VerticalAlign   = VerticalAlign.Middle;
            this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

            item = new RsCheckBoxListTemplate(ListItemType.Item);
            item.InstantiateIn(container);
            this.ItemTemplate = item;
        }
コード例 #3
0
        public RsRadioButtonTemplateField(Control parent)
        {
            container = new TemplateOwner();

            header = new RsRadioButtonListTemplate(parent, ListItemType.Header);
            header.InstantiateIn(container);
            this.HeaderTemplate              = header;
            this.HeaderStyle.VerticalAlign   = VerticalAlign.Middle;
            this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

            item = new RsRadioButtonListTemplate(parent, ListItemType.Item);
            item.InstantiateIn(container);
            this.ItemTemplate = item;
        }
コード例 #4
0
        protected override int CreateChildControls(IEnumerable dataSource, bool dataBinding)
        {
            DataRow[] rows = LabelFormatData.Select("name='" + _labelFormat + "'");
            if (rows.Length == 0)
            {
                throw new InvalidOperationException("LabelFormat is invalid!");
            }

            DataRow row = rows[0];

            //
            // page setup
            //
            Style.Add("Text-Align", "center");
            Style.Add("padding",
                      row["PageTopMargin"] + "mm " +
                      row["PageRightMargin"] + "mm " +
                      row["PageBottomMargin"] + "mm " +
                      row["PageLeftMargin"] + "mm");
            Style.Add("width", row["PageWidth"] + "mm");
            Style.Add("height", row["PageHeight"] + "mm");

            Controls.Clear();
            ITemplate temp  = templateValue ?? new DefaultTemplate();
            int       count = 0;

            foreach (object o in dataSource)
            {
                ownerValue    = new TemplateOwner(o, count);
                ownerValue.ID = "Panel" + count;
                ownerValue.Style.Add("width", row["LabelWidth"] + "mm");
                ownerValue.Style.Add("height", row["LabelHeight"] + "mm");
                ownerValue.Style.Add("float", "left");
                ownerValue.Style.Add("border", "1px solid #CCCCCC");
                ownerValue.Style.Add("margin-right", row["LabelRightMargin"] + "mm");
                ownerValue.Style.Add("margin-bottom", row["LabelBottomMargin"] + "mm");
                temp.InstantiateIn(ownerValue);
                this.Controls.Add(ownerValue);
                ownerValue.DataBind();
                count++;
            }

            return(0);
        }
コード例 #5
0
        private string _export()
        {
            StringBuilder sb = new StringBuilder();

            // LINE 1
            sb.AppendLine(_templateDesignerVersion.QuoteWrap());

            // LINE 2
            sb.AppendLine(String.Format(
                              "{0},{1},{2}",
                              TemplateName.QuoteWrap(),
                              TemplateOwner.QuoteWrap(),
                              _templateOwnerType.QuoteWrap()));
            sb.Append(TemplateName.QuoteWrap() + ",");
            sb.Append(TemplateOwner.QuoteWrap() + ",");
            sb.AppendLine(_templateOwnerType.QuoteWrap());

            // LINE 3 - FORM
            sb.AppendLine(String.Format(
                              "0,0,0,{0},{1},0,1048576,\"\",\"\",\"\"", Width, Height));

            // LINE 4 - TABSTRIP
            sb.AppendLine(String.Format(
                              "{0},5,377,295,395,0,32,{1},{2},{3}",
                              (_pages.Count - 1), // page 0 doesn't count
                              PrefixContainer.DefaultString.QuoteWrap(),
                              ("N=1|" + _tabstripItemData.Export(":")).QuoteWrap(),
                              (":-2147483633:" + _getPageNames()).QuoteWrap()));

            // LINE 5 - BROWSETREE
            // FWST-PedsGeneral: 0,555,10,1065,610,0,4,"","N=2|I=F|S=F|B=T",""
            //sb.AppendLine(String.Format("");
            sb.AppendLine(String.Format(
                              "0,{0},10,{1},610,0,4,\"\",{2},\"\"",
                              (Width / 2),
                              (Width - 10),
                              _browseTreeItemData.Export().QuoteWrap()));

            return(sb.ToString());
        }
コード例 #6
0
        public RsCheckBoxTemplateField()
        {
            container = new TemplateOwner();

            header = new RsCheckBoxListTemplate(ListItemType.Header);
            header.InstantiateIn(container);
            this.HeaderTemplate = header;
            this.HeaderStyle.VerticalAlign = VerticalAlign.Middle;
            this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

            item = new RsCheckBoxListTemplate(ListItemType.Item);
            item.InstantiateIn(container);
            this.ItemTemplate = item;
        }
コード例 #7
0
        public RsRadioButtonTemplateField(Control parent)
        {
            container = new TemplateOwner();

            header = new RsRadioButtonListTemplate(parent, ListItemType.Header);
            header.InstantiateIn(container);
            this.HeaderTemplate = header;
            this.HeaderStyle.VerticalAlign = VerticalAlign.Middle;
            this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

            item = new RsRadioButtonListTemplate(parent, ListItemType.Item);
            item.InstantiateIn(container);
            this.ItemTemplate = item;
        }
コード例 #8
0
                protected override void CreateChildControls()
                {
                    Controls.Clear();
                    _owner = new TemplateOwner();

                    ITemplate temp = _ContentTemplate;
                    if (temp == null)
                    {
                        temp = new DefaultContentTemplate();
                    }

                    temp.InstantiateIn(_owner);
                    this.Controls.Add(_owner);
                }
コード例 #9
0
ファイル: Lib.cs プロジェクト: PavelPZ/NetNew
 protected override void CreateChildControls() {
   BodyPlace.Controls.Clear();
   TemplateOwner ownerValue = new TemplateOwner();
   ITemplate temp = Template;
   if (temp == null) return;
   temp.InstantiateIn(ownerValue);
   BodyPlace.Controls.Add(ownerValue);
 }
コード例 #10
0
        protected override int CreateChildControls(IEnumerable dataSource, bool dataBinding)
        {
            DataRow[] rows = LabelFormatData.Select("name='" + _labelFormat + "'");
            if (rows.Length == 0)
                throw new InvalidOperationException("LabelFormat is invalid!");

            DataRow row = rows[0];

            //
            // page setup
            //
            Style.Add("Text-Align", "center");
            Style.Add("padding",
                row["PageTopMargin"] + "mm " +
                row["PageRightMargin"] + "mm " +
                row["PageBottomMargin"] + "mm " +
                row["PageLeftMargin"] + "mm");
            Style.Add("width", row["PageWidth"] + "mm");
            Style.Add("height", row["PageHeight"] + "mm");

            Controls.Clear();
            ITemplate temp = templateValue ?? new DefaultTemplate();
            int count = 0;

            foreach (object o in dataSource)
            {
                ownerValue = new TemplateOwner(o, count);
                ownerValue.ID = "Panel" + count;
                ownerValue.Style.Add("width", row["LabelWidth"] + "mm");
                ownerValue.Style.Add("height", row["LabelHeight"] + "mm");
                ownerValue.Style.Add("float", "left");
                ownerValue.Style.Add("border", "1px solid #CCCCCC");
                ownerValue.Style.Add("margin-right", row["LabelRightMargin"] + "mm");
                ownerValue.Style.Add("margin-bottom", row["LabelBottomMargin"] + "mm");
                temp.InstantiateIn(ownerValue);                
                this.Controls.Add(ownerValue);
                ownerValue.DataBind();
                count++;
            }

            return 0;
        }