Example #1
0
        void ControllableTab.Refresh()
        {
            if (!loaded)
            {
                return;
            }

            reports.Clear();
            LoadReports(-1, true, true);
        }
        /// <summary>
        /// Sets splits based on the given array.
        /// </summary>
        public void SetSplits(Split[] splits)
        {
            // A zero-length array indicates loading settings where the user had previously not set up any splits.
            if (splits.Length == 0)
            {
                return;
            }

            splitControls.Clear();

            for (int i = 0; i < splits.Length; i++)
            {
                Split split = splits[i];

                splitControls.Add(new SplitControl(this, i + 1, split.Type, split.Data)
                {
                    Location = new Point(0, SplitSpacing * i)
                });
            }

            ((SplitControl)splitControls[0]).ToggleUp(false);
            ((SplitControl)splitControls.Last()).ToggleDown(false);

            SplitCollection.Splits = splits;
            UpdateCountLabel();
        }
        protected virtual void CreatePagerFields()
        {
            // In theory (on multi-core or SMP machines), OnTotalRowCountAvailable may
            // be called asynchronously to this method (since it is a delegate reacting
            // to event in the container), so we want to protect ourselves from data
            // corruption here. Lock would be an overkill, since we really want to
            // create the list only once anyway.
            _createPagerFieldsRunning = true;

            ControlCollection controls = Controls;

            controls.Clear();

            DataPagerFieldItem control;

            foreach (DataPagerField dpf in _fields)
            {
                control = new DataPagerFieldItem(dpf, this);
                controls.Add(control);
                if (dpf.Visible)
                {
                    dpf.CreateDataPagers(control, _startRowIndex, _maximumRows, _totalRowCount, _fields.IndexOf(dpf));
                    control.DataBind();
                }
            }

            _createPagerFieldsRunning = false;
        }
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = Controls;

            controls.Clear();
            EditorControls.Clear();

            object editableObject = GetEditableObject();

            if (editableObject != null)
            {
                foreach (PropertyDescriptor pd in GetEditableProperties(editableObject, true))
                {
                    Control editorControl = CreateEditorControl(pd);
                    EditorControls.Add(editorControl);
                    Controls.Add(editorControl);
                }
                _errorMessages = new string[EditorControls.Count];
            }

            // We don't need viewstate enabled on our child controls.  Disable for perf.
            foreach (Control c in controls)
            {
                c.EnableViewState = false;
            }
        }
Example #5
0
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = this.Controls;

            controls.Clear();
            this._title         = new TextBox();
            this._title.Columns = 30;
            controls.Add(this._title);
            TypeConverter converter = TypeDescriptor.GetConverter(typeof(PartChromeType));

            this._chromeType = new DropDownList();
            this._chromeType.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeType_Default"), converter.ConvertToString(PartChromeType.Default)));
            this._chromeType.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeType_TitleAndBorder"), converter.ConvertToString(PartChromeType.TitleAndBorder)));
            this._chromeType.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeType_TitleOnly"), converter.ConvertToString(PartChromeType.TitleOnly)));
            this._chromeType.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeType_BorderOnly"), converter.ConvertToString(PartChromeType.BorderOnly)));
            this._chromeType.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeType_None"), converter.ConvertToString(PartChromeType.None)));
            controls.Add(this._chromeType);
            TypeConverter converter2 = TypeDescriptor.GetConverter(typeof(ContentDirection));

            this._direction = new DropDownList();
            this._direction.Items.Add(new ListItem(System.Web.SR.GetString("ContentDirection_NotSet"), converter2.ConvertToString(ContentDirection.NotSet)));
            this._direction.Items.Add(new ListItem(System.Web.SR.GetString("ContentDirection_LeftToRight"), converter2.ConvertToString(ContentDirection.LeftToRight)));
            this._direction.Items.Add(new ListItem(System.Web.SR.GetString("ContentDirection_RightToLeft"), converter2.ConvertToString(ContentDirection.RightToLeft)));
            controls.Add(this._direction);
            this._height = new UnitInput();
            controls.Add(this._height);
            this._width = new UnitInput();
            controls.Add(this._width);
            this._hidden = new CheckBox();
            controls.Add(this._hidden);
            foreach (Control control in controls)
            {
                control.EnableViewState = false;
            }
        }
Example #6
0
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = this.Controls;

            controls.Clear();
            TypeConverter converter = TypeDescriptor.GetConverter(typeof(PartChromeState));

            this._chromeState = new DropDownList();
            this._chromeState.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeState_Normal"), converter.ConvertToString(PartChromeState.Normal)));
            this._chromeState.Items.Add(new ListItem(System.Web.SR.GetString("PartChromeState_Minimized"), converter.ConvertToString(PartChromeState.Minimized)));
            controls.Add(this._chromeState);
            this._zone = new DropDownList();
            WebPartManager webPartManager = base.WebPartManager;

            if (webPartManager != null)
            {
                WebPartZoneCollection zones = webPartManager.Zones;
                if (zones != null)
                {
                    foreach (WebPartZoneBase base2 in zones)
                    {
                        ListItem item = new ListItem(base2.DisplayTitle, base2.ID);
                        this._zone.Items.Add(item);
                    }
                }
            }
            controls.Add(this._zone);
            this._zoneIndex         = new TextBox();
            this._zoneIndex.Columns = 10;
            controls.Add(this._zoneIndex);
            foreach (Control control in controls)
            {
                control.EnableViewState = false;
            }
        }
Example #7
0
        private void ClearAndDisposeControls(ControlCollection controls)
        {
            for (int i = 0; i < controls.Count; i++)
            {
                Control control = controls[i];

                if (control.Controls != null)
                {
                    if (control.Controls.Count > 0)
                    {
                        ClearAndDisposeControls(control.Controls);
                    }
                }

                if (control.ContextMenuStrip != null)
                {
                    control.ContextMenuStrip = null;
                }

                control.Dispose();
                control = null;
            }

            controls.Clear();
        }
Example #8
0
        /// <summary>
        /// 查询Author支付成功的订单信息
        /// </summary>
        /// <param name="DB">数据库</param>
        /// <param name="TAB">表名称</param>
        /// <param name="Author">用户名</param>
        public static void showTable(ControlCollection root, DataBase DB, string TAB, string Author, int UserType)
        {
            if (DB.ExistTab(TAB))
            {
                //string sql = "select * from [" + TAB + "]";
                string sql = "select top 1000 ID,softName,price,ext,dateTime from [" + TAB + "]";
                if (UserType == 1)
                {
                    sql = sql + " where ext like '%" + "author(" + Author + ")" + "%' ";                    // 普通用户
                }
                sql = sql + " order by ID desc";

                Table table = DB.Execute(sql).Table();

                Label label = new Label();
                label.ForeColor = Color.BlueViolet;

                label.Text = "\r\n" + "现有注册软件,详情" + ":";

                root.Clear();

                root.Add(label);

                //print("数据表" + TAB +":");
                root.Add(table);
            }
        }
 public static void HandleException(Exception ex, ControlCollection Controls)
 {
     Controls.Clear();
     Controls.Add(new LiteralControl("<font style='color: red;'>Error: </font>" +
                                     ex.Message + "<br /><br />Share These Details with Support Staff:<br />" +
                                     parseException(ex)));
 }
Example #10
0
        public void Clear()
        {
#if NET_2_0
            owner.GenerateTableSections = false;
#endif
            cc.Clear();
        }
Example #11
0
        /// <summary>
        /// 查询数据表DB.TAB中的数据,以TAB表进行显示;
        /// 根据ID选取最后1000条,逆序显示
        /// </summary>
        /// <param name="DB">数据库</param>
        /// <param name="TAB">表名称</param>
        public static void showTable(ControlCollection root, DataBase DB, string TAB, string AppendCondition = "", bool clearPre = true)
        {
            if (!isSci)
            {
                return;
            }

            if (DB.ExistTab(TAB))
            {
                //string sql = "select * from [" + TAB + "]";
                string sql = "select top 1000 * from [" + TAB + "]";
                if (AppendCondition != null && !AppendCondition.Equals(""))
                {
                    sql += " " + AppendCondition;
                }
                sql = sql + " order by ID desc";

                Table table = DB.Execute(sql).Table();

                Label label = new Label();
                label.ForeColor = Color.BlueViolet;

                if (clearPre)
                {
                    root.Clear();           // 是否清除之前包含的数据表
                }
                label.Text = "\r\n数据表" + TAB + ":";
                root.Add(label);

                //print("数据表" + TAB +":");
                root.Add(table);
            }
        }
Example #12
0
 /// <summary>
 /// 显示网页
 /// </summary>
 /// <param name="cc"></param>
 /// <param name="content"></param>
 public void ShowControlHtml(ControlCollection cc, string content)
 {
     cc.Clear();
     WebKit.WebKitBrowser browser = new WebKit.WebKitBrowser();
     browser.Dock         = DockStyle.Fill;
     browser.DocumentText = content;
     cc.Add(browser);
 }
Example #13
0
 protected override void CreateChildControls()
 {
     Controls.Clear();
     caption.Click        += new EventHandler(caption_Click);
     caption.OnClientClick = this.OnClientClick;
     caption.Text          = base.ToolTip;
     caption.ToolTip       = base.ToolTip;
     Controls.Add(caption);
 }
Example #14
0
        /// <summary>
        /// Disposes all items in the List and then clears the list
        /// </summary>
        private static void DisposeAndClear(ControlCollection controlCollection)
        {
            foreach (Control control in controlCollection)
            {
                control.Dispose();
            }

            controlCollection.Clear();
        }
        protected void SetEditControl(int index, IBusinessObjectBoundEditableWebControl control)
        {
            Control webControl = ArgumentUtility.CheckNotNullAndType <Control> ("control", control);

            ControlCollection cellControls = GetEditControls(index);

            cellControls.Clear();
            cellControls.Add(webControl);
        }
Example #16
0
        //创建子控件(服务器日历控件)
        protected override void CreateChildControls()
        {
            Controls.Clear();
            _Label           = new Label();
            _Label.ID        = MyLabelID;
            _Label.Font.Size = FontUnit.Parse("9pt");
            _Label.Font.Name = "Verdana";

            this.Controls.Add(_Label);
        }
Example #17
0
        /// <summary>
        /// Reverses the control collection in the controls
        /// </summary>
        /// <param name="originalCollection">The control collection to be reversed</param>
        public static void Reverse(this ControlCollection originalCollection)
        {
            List <Control> newControlCollection = new List <Control>();

            foreach (Control control in originalCollection)
            {
                newControlCollection.Insert(0, control);
            }
            originalCollection.Clear();
            originalCollection.AddRange(newControlCollection.ToArray());
        }
Example #18
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            this.InitItems();

            this.DetectLayoutFromConfig();

            if (this.Items.Count > 0 && this.Layout.IsEmpty() && this.LayoutControl == null && this.UseDefaultLayout)
            {
                this.Layout = "auto";
            }

            if (this.Items.Count > 0)
            {
                return;
            }

            if (this.Layout.IsNotEmpty() && this.Items.Count == 0 && this is IContent && this.LayoutControl == null)
            {
                ControlCollection contentControls = ((IContent)this).ContentControls;

                if (contentControls.Count == 0)
                {
                    return;
                }

                List <Component> components = new List <Component>();

                foreach (Control control in contentControls)
                {
                    Component cmp = control as Component;

                    if (cmp != null)
                    {
                        // need interim collection to avoid Items' AfterItemAdd firing while we go over the body's controls
                        components.Add(cmp);
                        cmp.ID = cmp.ID;
                    }
                }

                if (components.Count == 0)
                {
                    return;
                }

                contentControls.Clear();

                foreach (Component cmp in components)
                {
                    this.Add(cmp);
                }
            }
        }
Example #19
0
        /// <summary>
        /// 网页HTML
        /// </summary>
        /// <param name="cc"></param>
        /// <param name="content"></param>
        public void ShowControlHtml(ControlCollection cc, string content)
        {
            cc.Clear();
            WebBrowser browser = new WebBrowser();

            browser.Dock = DockStyle.Fill;
            cc.Add(browser);
            browser.ScriptErrorsSuppressed = true;
            browser.ScrollBarsEnabled      = false;
            browser.DocumentText           = content;
            webBrowser = browser;
        }
Example #20
0
        /// <summary>
        /// 加载网页
        /// </summary>
        /// <param name="cc"></param>
        /// <param name="url"></param>
        public void ShowControlWebkit(ControlCollection cc, string url)
        {
            cc.Clear();
            WebBrowser browser = new WebBrowser();

            browser.Dock = DockStyle.Fill;
            cc.Add(browser);
            browser.ScriptErrorsSuppressed = true;
            browser.ScrollBarsEnabled      = false;
            browser.Url = new Uri(url);
            webBrowser  = browser;
        }
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = this.Controls;

            controls.Clear();
            this._allowClose = new CheckBox();
            controls.Add(this._allowClose);
            this._allowConnect = new CheckBox();
            controls.Add(this._allowConnect);
            this._allowHide = new CheckBox();
            controls.Add(this._allowHide);
            this._allowMinimize = new CheckBox();
            controls.Add(this._allowMinimize);
            this._allowZoneChange = new CheckBox();
            controls.Add(this._allowZoneChange);
            TypeConverter converter = TypeDescriptor.GetConverter(typeof(WebPartExportMode));

            this._exportMode = new DropDownList();
            this._exportMode.Items.AddRange(new ListItem[] { new ListItem(System.Web.SR.GetString("BehaviorEditorPart_ExportModeNone"), converter.ConvertToString(WebPartExportMode.None)), new ListItem(System.Web.SR.GetString("BehaviorEditorPart_ExportModeAll"), converter.ConvertToString(WebPartExportMode.All)), new ListItem(System.Web.SR.GetString("BehaviorEditorPart_ExportModeNonSensitiveData"), converter.ConvertToString(WebPartExportMode.NonSensitiveData)) });
            controls.Add(this._exportMode);
            TypeConverter converter2 = TypeDescriptor.GetConverter(typeof(WebPartHelpMode));

            this._helpMode = new DropDownList();
            this._helpMode.Items.AddRange(new ListItem[] { new ListItem(System.Web.SR.GetString("BehaviorEditorPart_HelpModeModal"), converter2.ConvertToString(WebPartHelpMode.Modal)), new ListItem(System.Web.SR.GetString("BehaviorEditorPart_HelpModeModeless"), converter2.ConvertToString(WebPartHelpMode.Modeless)), new ListItem(System.Web.SR.GetString("BehaviorEditorPart_HelpModeNavigate"), converter2.ConvertToString(WebPartHelpMode.Navigate)) });
            controls.Add(this._helpMode);
            this._description         = new TextBox();
            this._description.Columns = 30;
            controls.Add(this._description);
            this._titleUrl         = new TextBox();
            this._titleUrl.Columns = 30;
            controls.Add(this._titleUrl);
            this._titleIconImageUrl         = new TextBox();
            this._titleIconImageUrl.Columns = 30;
            controls.Add(this._titleIconImageUrl);
            this._catalogIconImageUrl         = new TextBox();
            this._catalogIconImageUrl.Columns = 30;
            controls.Add(this._catalogIconImageUrl);
            this._helpUrl         = new TextBox();
            this._helpUrl.Columns = 30;
            controls.Add(this._helpUrl);
            this._importErrorMessage         = new TextBox();
            this._importErrorMessage.Columns = 30;
            controls.Add(this._importErrorMessage);
            this._authorizationFilter         = new TextBox();
            this._authorizationFilter.Columns = 30;
            controls.Add(this._authorizationFilter);
            this._allowEdit = new CheckBox();
            controls.Add(this._allowEdit);
            foreach (Control control in controls)
            {
                control.EnableViewState = false;
            }
        }
Example #22
0
        protected override void CreateChildControls()
        {
            Controls.Clear();

            AddCountLabel();

            AddPageButtons();

            AddPreviousNextHyperLinks();

            AddFirstLastHyperLinks();
        }
Example #23
0
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = Controls;

            controls.Clear();

            _title         = new TextBox();
            _title.Columns = TextBoxColumns;
            controls.Add(_title);

            TypeConverter chromeTypeConverter = TypeDescriptor.GetConverter(typeof(PartChromeType));

            _chromeType = new DropDownList();
            _chromeType.Items.Add(new ListItem(SR.GetString(SR.PartChromeType_Default),
                                               chromeTypeConverter.ConvertToString(PartChromeType.Default)));
            _chromeType.Items.Add(new ListItem(SR.GetString(SR.PartChromeType_TitleAndBorder),
                                               chromeTypeConverter.ConvertToString(PartChromeType.TitleAndBorder)));
            _chromeType.Items.Add(new ListItem(SR.GetString(SR.PartChromeType_TitleOnly),
                                               chromeTypeConverter.ConvertToString(PartChromeType.TitleOnly)));
            _chromeType.Items.Add(new ListItem(SR.GetString(SR.PartChromeType_BorderOnly),
                                               chromeTypeConverter.ConvertToString(PartChromeType.BorderOnly)));
            _chromeType.Items.Add(new ListItem(SR.GetString(SR.PartChromeType_None),
                                               chromeTypeConverter.ConvertToString(PartChromeType.None)));
            controls.Add(_chromeType);

            TypeConverter directionConverter = TypeDescriptor.GetConverter(typeof(ContentDirection));

            _direction = new DropDownList();
            _direction.Items.Add(new ListItem(SR.GetString(SR.ContentDirection_NotSet),
                                              directionConverter.ConvertToString(ContentDirection.NotSet)));
            _direction.Items.Add(new ListItem(SR.GetString(SR.ContentDirection_LeftToRight),
                                              directionConverter.ConvertToString(ContentDirection.LeftToRight)));
            _direction.Items.Add(new ListItem(SR.GetString(SR.ContentDirection_RightToLeft),
                                              directionConverter.ConvertToString(ContentDirection.RightToLeft)));
            controls.Add(_direction);

            _height = new UnitInput();
            controls.Add(_height);

            _width = new UnitInput();
            controls.Add(_width);

            _hidden = new CheckBox();
            controls.Add(_hidden);

            // We don't need viewstate enabled on our child controls.  Disable for perf.
            foreach (Control c in controls)
            {
                c.EnableViewState = false;
            }
        }
Example #24
0
        public void moveCell(R_ListCell rc, int index)
        {
            List <R_ListCell> list = rightControl.Cast <R_ListCell>().ToList <R_ListCell>();

            list.Remove(rc);

            if (index < 0)
            {
                index = 0;
            }

            if (index < list.Count)
            {
                list.Insert(index, rc);
            }
            else
            {
                list.Add(rc);
            }

            rightControl.Clear();
            rightControl.AddRange(list.ToArray());
            lco.Refresh();
        }
Example #25
0
        public void moveCell(L_ListCell lc, int index)
        {
            List <L_ListCell> list = leftControl.Cast <L_ListCell>().ToList <L_ListCell>();

            list.Remove(lc);

            if (index < 0)
            {
                index = 0;
            }

            if (index < list.Count)
            {
                list.Insert(index, lc);
            }
            else
            {
                list.Add(lc);
            }

            leftControl.Clear();
            leftControl.AddRange(list.ToArray());
            lco.Refresh();
        }
Example #26
0
        // *********************************************************************
        //  CreateChildControls
        //
        /// <summary>
        /// This event handler adds the children controls and is resonsible
        /// for determining the template type used for the control.
        /// </summary>
        ///
        // ********************************************************************/
        protected override void CreateChildControls()
        {
            Controls.Clear();

            // Add Page buttons
            //
            AddPageButtons();

            // Add Previous Next child controls
            //
            AddPreviousNextLinkButtons();

            // Add First Last child controls
            //
            AddFirstLastLinkButtons();
        }
Example #27
0
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = this.Controls;

            controls.Clear();
            WebPart webPartToEdit = this.WebPartToEdit;

            foreach (EditorPart part2 in this.EditorParts)
            {
                if (webPartToEdit != null)
                {
                    part2.SetWebPartToEdit(webPartToEdit);
                    part2.SetWebPartManager(base.WebPartManager);
                }
                part2.SetZone(this);
                controls.Add(part2);
            }
        }
Example #28
0
 public static void GenerateRepeatControl(ControlCollection controls, string SystemInfo)
 {
     if (!string.IsNullOrEmpty(SystemInfo)) {
         SystemInfo = SystemInfo.Replace("PP", "P");
         string[] RepeatFormStr = SystemInfo.Split('P');
         if (RepeatFormStr.Length > 0) {
             controls.Clear();
             foreach (String formStr in RepeatFormStr) {
                 if (!string.IsNullOrEmpty(formStr)) {
                     if (controls.Count != 0) {
                         controls.Add(new LiteralControl(" , "));
                     }
                     controls.Add(CommonUtility.GetPostbackURLForRepeatForm(formStr));
                 }
             }
         }
     }
 }
Example #29
0
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = Controls;

            controls.Clear();

            TypeConverter chromeStateConverter = TypeDescriptor.GetConverter(typeof(PartChromeState));

            _chromeState = new DropDownList();
            _chromeState.Items.Add(new ListItem(SR.GetString(SR.PartChromeState_Normal),
                                                chromeStateConverter.ConvertToString(PartChromeState.Normal)));
            _chromeState.Items.Add(new ListItem(SR.GetString(SR.PartChromeState_Minimized),
                                                chromeStateConverter.ConvertToString(PartChromeState.Minimized)));
            controls.Add(_chromeState);

            // Add all zones to dropdown in CreateChildControls.  Items will be selected and/or disabled
            // in SyncChanges.  Assumes no Zones are added or removed during page execution.
            _zone = new DropDownList();
            WebPartManager manager = WebPartManager;

            if (manager != null)
            {
                WebPartZoneCollection zones = manager.Zones;
                if (zones != null)
                {
                    foreach (WebPartZoneBase zone in zones)
                    {
                        ListItem item = new ListItem(zone.DisplayTitle, zone.ID);
                        _zone.Items.Add(item);
                    }
                }
            }
            controls.Add(_zone);

            _zoneIndex         = new TextBox();
            _zoneIndex.Columns = TextBoxColumns;
            controls.Add(_zoneIndex);

            // We don't need viewstate enabled on our child controls.  Disable for perf.
            foreach (Control c in controls)
            {
                c.EnableViewState = false;
            }
        }
Example #30
0
        public static async Task FillControlCollectionForSearch <T, R>(
            this ControlCollection controlCollection,
            IList <T> entities,
            R entityControlView,
            CancellationToken token)
            where T : class, IEntity
            where R : IEntityControlView <T>
        {
            if (await controlCollection.СollectionEqualityTest(entities, token))
            {
                return;
            }

            var controls = await entities.CreateControlCollectionAsync(entityControlView, token);

            controlCollection.Clear();

            controlCollection.AddRange(controls);
        }
Example #31
0
        /// <internalonly/>
        protected internal override void CreateChildControls()
        {
            ControlCollection controls = Controls;

            controls.Clear();

            WebPart webPartToEdit = WebPartToEdit;

            foreach (EditorPart editorPart in EditorParts)
            {
                // webPartToEdit will be null if WebPartManager is null
                if (webPartToEdit != null)
                {
                    editorPart.SetWebPartToEdit(webPartToEdit);
                    editorPart.SetWebPartManager(WebPartManager);
                }
                editorPart.SetZone(this);
                controls.Add(editorPart);
            }
        }