Beispiel #1
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                LogTimerResult("Standard.OnInit() started", Timer.ElapsedDurationInSecondsAsString);

                TimeReportImageButton               = new CswImageButton(CswImageButton.ButtonType.ClockGrey);
                TimeReportImageButton.ID            = "TimeReportImageButton";
                TimeReportImageButton.OnClientClick = "TimeReportImageButton_Click(); return false;";
                TimeReportImageButtonPH.Controls.Add(TimeReportImageButton);

                //Master.CswNbtResources.OnBeforeDeleteView += new CswNbtResources.BeforeDeleteViewEventHandler( OnBeforeDeleteView );
                Master.CswNbtResources.CswEventLinker.Subscribe("StandardMasterInit_BeforeDeleteView", CswNbtView.BeforeDeleteViewEventName, (CswNbtView.BeforeDeleteViewEventHandler)OnBeforeDeleteView);
                //Master.CswNbtResources.CswEventLinker.Subscribe( "StandardMasterInit_AfterNewView", CswNbtView.AfterNewViewEventName, (CswNbtView.AfterNewViewEventHandler) OnAfterNewView );
                Master.CswNbtResources.CswEventLinker.Subscribe("StandardMasterInit_AfterEditView", CswNbtView.AfterEditViewEventName, (CswNbtView.AfterEditViewEventHandler)OnAfterEditView);

                base.OnInit(e);

                LogTimerResult("Standard.OnInit() finished", Timer.ElapsedDurationInSecondsAsString);
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }//OnInit()
Beispiel #2
0
        protected override void CreateChildControls()
        {
            CswAutoTable Table = new CswAutoTable();

            this.Controls.Add(Table);

            HtmlGenericControl ComboDiv = new HtmlGenericControl();

            ComboDiv.ID = "cd";
            Table.addControl(0, 0, ComboDiv);

            _Combo = new RadComboBox();
            _Combo.AutoPostBack        = false;
            _Combo.AllowCustomText     = true; // setting this to false means the box is always empty
            _Combo.EnableTextSelection = false;
            _Combo.EnableLoadOnDemand  = false;
            _Combo.Width = Unit.Parse("270px");
            _Combo.ID    = "combo";
            _Combo.EnableEmbeddedSkins = false;
            _Combo.Skin      = "ChemSW";
            _TreeView.Height = 300;
            ComboDiv.Controls.Add(_Combo);

            _Combo.ItemTemplate = new ComboTreeTemplate(_TreeView);
            _Combo.Items.Add(new RadComboBoxItem());

            //HtmlGenericControl ImageDiv = new HtmlGenericControl("div");
            //ImageDiv.Style.Add(HtmlTextWriterStyle.TextAlign, "right");
            //_Combo.DropDownFooter.Controls.Add(ImageDiv);
            //Image DropDownResizeImage = new Image();
            //DropDownResizeImage.ID = "comboresize";
            //DropDownResizeImage.ImageUrl = "Images/combo/resize.gif";
            //ImageDiv.Controls.Add(DropDownResizeImage);

            //_HiddenNodeValue = new HiddenField();
            //_HiddenNodeValue.ID = "value";
            //Table.addControl(0, 0, _HiddenNodeValue);

            //_Validator = new Sample.Web.UI.Compatibility.CustomValidator();
            //_Validator.ID = "vld";
            //_Validator.ValidateEmptyText = true;
            //_Validator.ValidationGroup = ValidationGroup;
            //Table.addControl(0, 0, _Validator);

            _ClearButton    = new CswImageButton(CswImageButton.ButtonType.Clear);
            _ClearButton.ID = "clear";
            Table.addControl(0, 1, _ClearButton);

            _EditButton    = new CswImageButton(CswImageButton.ButtonType.View);
            _EditButton.ID = "edit";
            //_EditButton.Click += new ImageClickEventHandler(_EditButton_Click);
            _EditButton.Click += new EventHandler(_EditButton_Click);
            Table.addControl(0, 1, _EditButton);

            base.CreateChildControls();
        }
Beispiel #3
0
        private void _AddQuickLaunchHeader()
        {
            if (!QuickLaunchHeaderAdded)
            {
                Literal QuickLaunchLiteral = new Literal();
                QuickLaunchLiteral.Text = "Quick Launch:";
                _QuickLaunchTable.addControl(0, 0, QuickLaunchLiteral);

                HtmlGenericControl ConfigButtonDiv = new HtmlGenericControl("div");
                ConfigButtonDiv.Style.Add(HtmlTextWriterStyle.TextAlign, "right");
                _QuickLaunchTable.addControl(0, 1, ConfigButtonDiv);

                CswImageButton ConfigButton = new CswImageButton(CswImageButton.ButtonType.Configure);
                ConfigButton.OnClientClick = "CswQuickLaunch_openConfigPopup(); return false;";
                ConfigButtonDiv.Controls.Add(ConfigButton);

                QuickLaunchHeaderAdded = true;
            }
        }
Beispiel #4
0
        public void ReinitComponents()
        {
            _ComponentPlaceHolder.Controls.Clear(); // BEWARE

            CswAutoTable ComponentTable = new CswAutoTable();

            ComponentTable.ID       = "ComponentTable";
            ComponentTable.CssClass = "ComponentTable";
            //ComponentTable.Style.Add( HtmlTextWriterStyle.TextAlign, TableTextAlign );
            ComponentTable.Attributes.Add("align", TableTextAlign);
            _ComponentPlaceHolder.Controls.Add(ComponentTable);

            Int32 CellIncrement = 3;

            foreach (LayoutComponent Component in Components.Values)
            {
                TableCell LabelCell  = ComponentTable.getCell(Component.DisplayRow - 1, (Component.DisplayColumn - 1) * CellIncrement);
                TableCell ValueCell  = ComponentTable.getCell(Component.DisplayRow - 1, (Component.DisplayColumn - 1) * CellIncrement + 1);
                TableCell ConfigCell = ComponentTable.getCell(Component.DisplayRow - 1, (Component.DisplayColumn - 1) * CellIncrement + 2);

                LabelCell.CssClass = CssClassLabelCell;
                if (EditMode)
                {
                    ValueCell.CssClass = CssClassValueCellEditMode;
                }
                else
                {
                    ValueCell.CssClass = CssClassValueCell;
                }

                if (Component.LabelControl != null)
                {
                    LabelCell.Controls.Add(Component.LabelControl);
                }
                if (Component.ValueControl != null)
                {
                    ValueCell.Controls.Add(Component.ValueControl);
                }

                if (LabelCellRightAlign)
                {
                    LabelCell.Style.Add(HtmlTextWriterStyle.TextAlign, "right");
                }

                if (EditMode)
                {
                    CswAutoTable ButtonTable = new CswAutoTable();
                    ConfigCell.Controls.Add(ButtonTable);

                    if (Component.DisplayRow > 1)
                    {
                        CswImageButton NorthButton = new CswImageButton(CswImageButton.ButtonType.ArrowNorth);
                        NorthButton.ID     = "North_" + Component.LayoutComponentId;
                        NorthButton.Click += new EventHandler(MoveButton_Click);
                        ButtonTable.addControl(0, 1, NorthButton);
                        _AjaxManager.AjaxSettings.AddAjaxSetting(NorthButton, ComponentTable);
                    }

                    CswImageButton EastButton = new CswImageButton(CswImageButton.ButtonType.ArrowEast);
                    EastButton.ID     = "East_" + Component.LayoutComponentId;
                    EastButton.Click += new EventHandler(MoveButton_Click);
                    ButtonTable.addControl(1, 2, EastButton);
                    _AjaxManager.AjaxSettings.AddAjaxSetting(EastButton, ComponentTable);

                    CswImageButton SouthButton = new CswImageButton(CswImageButton.ButtonType.ArrowSouth);
                    SouthButton.ID     = "South_" + Component.LayoutComponentId;
                    SouthButton.Click += new EventHandler(MoveButton_Click);
                    ButtonTable.addControl(2, 1, SouthButton);
                    _AjaxManager.AjaxSettings.AddAjaxSetting(SouthButton, ComponentTable);

                    if (Component.DisplayColumn > 1)
                    {
                        CswImageButton WestButton = new CswImageButton(CswImageButton.ButtonType.ArrowWest);
                        WestButton.ID     = "West_" + Component.LayoutComponentId;
                        WestButton.Click += new EventHandler(MoveButton_Click);
                        ButtonTable.addControl(1, 0, WestButton);
                        _AjaxManager.AjaxSettings.AddAjaxSetting(WestButton, ComponentTable);
                    }

                    if (Component.AllowDelete)
                    {
                        CswImageButton DeleteButton = new CswImageButton(CswImageButton.ButtonType.Delete);
                        DeleteButton.ID     = "Delete_" + Component.LayoutComponentId;
                        DeleteButton.Click += new EventHandler(DeleteButton_Click);
                        ButtonTable.addControl(1, 1, DeleteButton);
                        _AjaxManager.AjaxSettings.AddAjaxSetting(DeleteButton, ComponentTable);
                    }
                } // if( EditMode )
            }     // foreach( LayoutComponent Component in Components.Values )

            for (Int32 r = 0; r < ComponentTable.Rows.Count; r++)
            {
                for (Int32 c = 0; c < ComponentTable.MaxCells; c++)
                {
                    TableCell Cell = ComponentTable.getCell(r, c);
                    if (Cell.Controls.Count == 0)
                    {
                        Cell.Controls.Add(new CswLiteralNbsp());
                        if (c % CellIncrement == 1)   // this is a Value Cell
                        {
                            if (EditMode)
                            {
                                Cell.CssClass = CssClassEmptyCellEditMode;
                            }
                            else
                            {
                                Cell.CssClass = CssClassEmptyCell;
                            }
                        }
                    }
                } // for( Int32 c = 0; c < ComponentTable.MaxCells; c++ )
            }     // for( Int32 r = 0; r < ComponentTable.Rows.Count; r++ )
        }         // ReinitComponents()