protected override void FireEvent(Gizmox.WebGUI.Common.Interfaces.IEvent objEvent) { if (objEvent.Type == "MouseOver") MessageBox.Show("You got mouseover"); else base.FireEvent(objEvent); }
/// <summary> /// 设置Ajax请求超时时间 /// </summary> /// <param name="objComponent">The component.</param> /// <param name="strId">The unique id.</param> public void SetRequestTimeout(Gizmox.WebGUI.Forms.Control objComponent, int timeoutSeconds) { IAttributeExtender objAttributeExtender = objComponent as IAttributeExtender; if (objAttributeExtender != null) { objAttributeExtender.SetAttribute("XhrTM", timeoutSeconds.ToString()); } }
public int GetRequestTimeout(Gizmox.WebGUI.Forms.Control objComponent) { int result = 0; IAttributeExtender objAttributeExtender = objComponent as IAttributeExtender; if (objAttributeExtender != null) { int.TryParse(objAttributeExtender.GetAttribute("XhrTM"), out result); } return result; }
protected override void FireEvent(Gizmox.WebGUI.Common.Interfaces.IEvent objEvent) { if (objEvent.Type == "RunServerMethod") { var paramters = objEvent["params"]; MessageBox.Show(paramters); } base.FireEvent(objEvent); }
public bool GetIsShowHtml(Gizmox.WebGUI.Forms.Component objComponent) { int result = 0; IAttributeExtender objAttributeExtender = objComponent as IAttributeExtender; if (objAttributeExtender != null) { int.TryParse(objAttributeExtender.GetAttribute("showHtmlx"), out result); } return result==1; }
protected override void PreRenderControl(Gizmox.WebGUI.Common.Interfaces.IContext objContext) { base.PreRenderControl(objContext); if (this.Parent.Controls.IndexOf(_checkBox) == -1) { this.Parent.Controls.Add(_checkBox); } _checkBox.BringToFront(); _checkBox.Location = new Point(Location.X + 5, Location.Y + 2); }
///<summary> /// Gets the Habanero AutoCompleteMode equivalent to the provided Gizmox.WebGUI.Forms AutoCompleteMode ///</summary> ///<param name="autoCompleteMode">A Gizmox.WebGUI.Forms AutoCompleteMode.</param> ///<returns>The equivalent Habanero AutoCompleteMode.</returns> public static Base.AutoCompleteMode GetAutoCompleteMode(Gizmox.WebGUI.Forms.AutoCompleteMode autoCompleteMode) { switch (autoCompleteMode) { case Gizmox.WebGUI.Forms.AutoCompleteMode.None: return Base.AutoCompleteMode.None; case Gizmox.WebGUI.Forms.AutoCompleteMode.Append: return Base.AutoCompleteMode.Append; case Gizmox.WebGUI.Forms.AutoCompleteMode.Suggest: return Base.AutoCompleteMode.Suggest; case Gizmox.WebGUI.Forms.AutoCompleteMode.SuggestAppend: return Base.AutoCompleteMode.SuggestAppend; } return (Base.AutoCompleteMode)autoCompleteMode; }
///<summary> /// Converts Gizmox.WebGUI.Forms.HorizontalAlignment to Converts Habanero.Faces.Base.HorizontalAlignment ///</summary> ///<param name="alignment">A Gizmox.WebGUI.Forms Horizontal Alignment</param> ///<returns>The equivalent Habanero Horizontal Alignment</returns> public static HorizontalAlignment HorizontalAlignmentToHabanero(Gizmox.WebGUI.Forms.HorizontalAlignment alignment) { if (alignment == Gizmox.WebGUI.Forms.HorizontalAlignment.Right) { return HorizontalAlignment.Right; } if (alignment == Gizmox.WebGUI.Forms.HorizontalAlignment.Center) { return HorizontalAlignment.Center; } return HorizontalAlignment.Left; }
///<summary> /// Gets the Habanero AutoCompleteSource equivalent to the provided Gizmox.WebGUI.Forms AutoCompleteSource ///</summary> ///<param name="autoCompleteSource">A Gizmox.WebGUI.Forms AutoCompleteSource.</param> ///<returns>The equivalent Habanero AutoCompleteSource.</returns> public static Base.AutoCompleteSource GetAutoCompleteSource(Gizmox.WebGUI.Forms.AutoCompleteSource autoCompleteSource) { switch (autoCompleteSource) { case Gizmox.WebGUI.Forms.AutoCompleteSource.AllSystemSources: return Base.AutoCompleteSource.AllSystemSources; case Gizmox.WebGUI.Forms.AutoCompleteSource.AllUrl: return Base.AutoCompleteSource.AllUrl; case Gizmox.WebGUI.Forms.AutoCompleteSource.CustomSource: return Base.AutoCompleteSource.CustomSource; case Gizmox.WebGUI.Forms.AutoCompleteSource.FileSystem: return Base.AutoCompleteSource.FileSystem; case Gizmox.WebGUI.Forms.AutoCompleteSource.FileSystemDirectories: return Base.AutoCompleteSource.FileSystemDirectories; case Gizmox.WebGUI.Forms.AutoCompleteSource.HistoryList: return Base.AutoCompleteSource.HistoryList; case Gizmox.WebGUI.Forms.AutoCompleteSource.ListItems: return Base.AutoCompleteSource.ListItems; case Gizmox.WebGUI.Forms.AutoCompleteSource.None: return Base.AutoCompleteSource.None; case Gizmox.WebGUI.Forms.AutoCompleteSource.RecentlyUsedList: return Base.AutoCompleteSource.RecentlyUsedList; } return (Base.AutoCompleteSource)autoCompleteSource; }
protected override Gizmox.WebGUI.Hosting.HostHttpHandler GetHttpHandler(Gizmox.WebGUI.Hosting.HostContext objHostContext, Context objContext) { if (Enable) { RequestType enmRequestType = ((IRequestParams)objContext.Request).Type; if (CommonUtils.IsMono) { objHostContext.Response.Buffer = false; } ApplyContentDispositionIfNeeded(objHostContext, enmRequestType); if (enmRequestType == RequestType.Preload) { return new PreloadEx(objContext); } } return base.GetHttpHandler(objHostContext, objContext); }
protected override void RenderAttributes(Gizmox.WebGUI.Common.Interfaces.IContext objContext, Gizmox.WebGUI.Common.Interfaces.IAttributeWriter objWriter) { base.RenderAttributes(objContext, objWriter); if (AutoEllipsis) { objWriter.WriteAttributeString(WGAttributes.AutoEllipsis, AutoEllipsis ? "1" : "0"); } if (Radius != CornerRadius.Empty) { CornerRadiusValue rd = this.Radius; string style = rd.GetStyle(); objWriter.WriteAttributeString("Radius", style); } if (this.HoverFont != null) { objWriter.WriteAttributeString("HoverFont", GetWebFont(this.HoverFont)); } if (_overImage != null) { objWriter.WriteAttributeString("HoverImage", _overImage.ToString()); } else { objWriter.WriteAttributeString("HoverImage", ""); } objWriter.WriteAttributeString("HoverFore", ColorTranslator.ToHtml(this.HoverForeColor)); objWriter.WriteAttributeString("HoverBgColor", ColorTranslator.ToHtml(this.HoverBackColor)); objWriter.WriteAttributeString("Overable", this._overable ? "1" : "0"); if (LinearGradient != null) { objWriter.WriteAttributeString("Linear", LinearGradient.ToString()); } if (HoverLinearGradient != null) { objWriter.WriteAttributeString("HoverLinear", HoverLinearGradient.ToString()); } if (this.ImagePostionOfText != ArrowPosition.None) { objWriter.WriteAttributeString("ImgPS", this.ImagePostionOfText.ToString()); } objWriter.WriteAttributeString("ImgSpace", this.ImageLabelSpace); if (_overBackgroundImage != null) { objWriter.WriteAttributeString("HoverBgImg", this._overBackgroundImage.ToString()); } else { objWriter.WriteAttributeString("HoverBgImg", ""); } if (ImageWidth>0) { objWriter.WriteAttributeString(WGAttributes.ImageWidth, ImageWidth); } if (ImageHeight > 0) { objWriter.WriteAttributeString(WGAttributes.ImageHeight, ImageHeight); } if (!string.IsNullOrEmpty(OnClientMouseOver)) { objWriter.WriteAttributeString("OverScript", OnClientMouseOver); } if (!string.IsNullOrEmpty(OnClientMouseLeave)) { objWriter.WriteAttributeString("LeaveScript", OnClientMouseLeave); if (RenderRunClientMouseLeave) { this.InvokeScript(OnClientMouseLeave); } } }
protected override void RenderAttributes(Gizmox.WebGUI.Common.Interfaces.IContext objContext, Gizmox.WebGUI.Common.Interfaces.IAttributeWriter objWriter) { //Gizmox.WebGUI.WGAttributes.FullRowSelect base.RenderAttributes(objContext, objWriter); objWriter.WriteAttributeString("showHtml", this.AllowListItemDisplayHtml ? "1" : "0"); }
/// <summary> /// ����Ajax����ʱʱ�� /// </summary> /// <param name="objComponent">The component.</param> /// <param name="strId">The unique id.</param> public void SetIsShowHtml(Gizmox.WebGUI.Forms.Component objComponent, bool isShowHtml) { IAttributeExtender objAttributeExtender = objComponent as IAttributeExtender; if (objAttributeExtender != null) { objAttributeExtender.SetAttribute("showHtmlx", isShowHtml?"1":"0"); } }
private void FillOrderLinesListView(ListViewPanelItem lvpi, Gizmox.WebGUI.Forms.ListView lvSub, string orderID) { var dtOrderLines = _northWind.Order_Details; lvpi.Panel.Height = 0; int cnt = 0; lvSub.Items.Clear(); foreach (DataRow row in dtOrderLines.Rows) { if (row["OrderID"].ToString() == orderID) { var lvi = new ListViewItem(); lvi.SubItems.Add(row["Quantity"].ToString()); lvi.SubItems.Add(GetProductDescrption(row["ProductID"].ToString())); lvi.SubItems.Add("$ " + row["UnitPrice"]); lvSub.Items.Add(lvi); cnt += 1; } } lvpi.Panel.Height = cnt*18; ((RowTag) lvpi.ListView.Items[0].Tag).Container.Panel.Height = ((lvpi.ListView.Items.Count)*19) + lvpi.Panel.Height; }
private void FillOrderListView(ListViewPanelItem lvpi, Gizmox.WebGUI.Forms.ListView lvSub, string customerID) { var dtOrders = _northWind.Orders; lvpi.Panel.Height = 0; int cnt = 0; lvSub.Items.Clear(); foreach (DataRow row in dtOrders.Rows) { if (row["CustomerID"].ToString() == customerID) { var pnl = new Panel(); pnl.DockPadding.Left = 20; var lvspi = new ListViewPanelItem(pnl); var pb = new PictureBox(); pb.Size = new Size(16, 16); pb.Tag = lvspi; pb.Click += pbOrders_Click; lvspi.SubItems.Add(pb); var lbl = new Label(); lbl.Font = new Font("Arial", 10F, FontStyle.Bold, GraphicsUnit.Point, ((byte) (0))); lbl.ForeColor = Color.FromArgb(((int) (((byte) (24)))), ((int) (((byte) (134)))), ((int) (((byte) (231))))); lbl.Text = row["OrderID"].ToString(); lbl.Click += lblOrders_Click; lbl.AutoSize = true; lbl.Tag = lvspi; lbl.Cursor = Cursors.Hand; lvspi.SubItems.Add(lbl); lvSub.Items.Add(lvspi); var rowTag = new RowTag(); rowTag.ID = row["OrderID"].ToString(); rowTag.Container = lvpi; rowTag.RowExpansion = RowExpansionType.Expanded; rowTag.Label = lbl; rowTag.PictureBox = pb; lvspi.Tag = rowTag; ToggleOrdersRowExpansion(lvspi); cnt += 1; } } lvpi.Panel.Height = cnt*19; }
private void FillCustomersListView(Gizmox.WebGUI.Forms.ListView lv) { var dtCustomers = _northWind.Customers; foreach (DataRow row in dtCustomers.Rows) { var pnl = new Panel(); pnl.DockPadding.Left = 20; var lvpi = new ListViewPanelItem(pnl); pnl.Height = 200; var pb = new PictureBox(); pb.Size = new Size(16, 16); pb.Tag = lvpi; pb.Click += pbCustomers_Click; lvpi.SubItems.Add(pb); var lbl = new Label(); lbl.Font = new Font("Arial", 11F, FontStyle.Bold, GraphicsUnit.Point, ((byte) (0))); lbl.ForeColor = Color.FromArgb(24, 134, 231); lbl.Text = row["CompanyName"].ToString(); lbl.Click += lblCustomers_Click; lbl.AutoSize = true; lbl.Tag = lvpi; lbl.Cursor = Cursors.Hand; lvpi.SubItems.Add(lbl); lvMain.Items.Add(lvpi); var rowTag = new RowTag(); rowTag.ID = row["CustomerID"].ToString(); rowTag.RowExpansion = RowExpansionType.Expanded; rowTag.Label = lbl; rowTag.PictureBox = pb; lvpi.Tag = rowTag; ToggleCustomerRowExpansion(lvpi); } }
private void BuildCustomerListView(Gizmox.WebGUI.Forms.ListView lv) { lv.BorderStyle = BorderStyle.None; lv.HeaderStyle = ColumnHeaderStyle.None; var ch = new ColumnHeader(); ch.Text = ""; ch.Width = 16; ch.Type = ListViewColumnType.Control; ch.PreferedItemHeight = 16; lvMain.Columns.Add(ch); ch = new ColumnHeader(); ch.Text = ""; ch.Width = 300; ch.Type = ListViewColumnType.Control; lvMain.Columns.Add(ch); }
protected override void Render(Gizmox.WebGUI.Common.Interfaces.IContext objContext, Gizmox.WebGUI.Common.Interfaces.IResponseWriter objWriter, long lngRequestID) { base.Render(objContext, objWriter, lngRequestID); UpdateMenu(); }
public override void ProcessRequest(Gizmox.WebGUI.Hosting.HostContext objHostContext) { IRequestParams request = (IRequestParams)this.Context.Request; this.CheckValidEnvironment(); this.CheckValidApplication(request); Global.Context = this.Context; try { if (request.IsUserPostback) { ((IContextTerminate)this.Context).Terminate(true); VerboseRecord.Write(this, "Server/Context/Arguments", "Setting", "Setting the 'Context.Arguments' property to reflect external arguments."); //this.Context.Arguments = new ArgumentsProvider(objHostContext.Request); this.Context.Arguments = (NameValueCollection)Activator.CreateInstance(argumentsProviderType, objHostContext.Request); this.Context.Referrer = objHostContext.Request.Form["Referrer"]; } else if (this.Context.IsStatelessApplication) { NameValueCollection arguments = this.Context.Arguments; string currentTheme = this.Context.CurrentTheme; ((IContextTerminate)this.Context).Terminate(true); this.Context.Arguments = arguments; this.Context.CurrentTheme = currentTheme; } bool pageInstanceWasForced; Type tt = request.GetType(); pageInstanceWasForced = (bool)tt.GetProperty("PageInstanceWasForced", BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.Public).GetValue(request, null); if (!request.IsUserPostback && !pageInstanceWasForced) { objHostContext.Response.Expires = -1; objHostContext.Response.Cache.SetCacheability(HttpCacheability.NoCache); objHostContext.Response.ContentType = "text/html"; string strResourceName = null; if (!this.IsSupportedBrowser(objHostContext)) { if (!this.Context.RenderStaticSEOContent(objHostContext)) { strResourceName = this.GetUnsupportedBrowserFileName(); } else { return; } } if (this.IsTimeoutRequest(request)) { strResourceName = this.GetTimeoutFileName(); } //else if (this.IsDebuggerRequest(objHostContext)) //{ // strResourceName = this.GetDebugFrameFileName(); //} if (strResourceName == null) { strResourceName = this.GetBrowserFileName(); } SkinFactory.WriteSkinResource(this.Context, objHostContext.Response.OutputStream, strResourceName, objHostContext.Request.QueryString); } else { var uri = objHostContext.Request.Url; var port = HostRuntime.Config.GetFeatureValue("ForcePort", string.Empty); //uri = GetRedirectionUri(objHostContext.Request.Url, port); uri = GetRedirectionUri(objHostContext.Request.Url,port); string leftPart = uri.GetLeftPart(UriPartial.Path); int index = leftPart.IndexOf("/post.", StringComparison.InvariantCultureIgnoreCase); if (index > -1) { leftPart = leftPart.Substring(0, index + 1) + leftPart.Substring(index + 6); } string pageInstance = request.PageInstance; if (!string.IsNullOrEmpty(pageInstance)) { if (leftPart.Contains("?")) { leftPart = string.Format("{0}&vwginstance={1}", leftPart, pageInstance); } else { leftPart = string.Format("{0}?vwginstance={1}", leftPart, pageInstance); } } objHostContext.Response.Redirect(leftPart); } } catch (Exception exception) { throw exception; } //base.ProcessRequest(objHostContext); }
protected override void RenderAttributes(Gizmox.WebGUI.Common.Interfaces.IContext objContext, Gizmox.WebGUI.Common.Interfaces.IAttributeWriter objWriter) { base.RenderAttributes(objContext, objWriter); if (_overImage != null) { objWriter.WriteAttributeString("HoverImage", _overImage.ToString()); } else { objWriter.WriteAttributeString("HoverImage", ""); } if (this.HoverBackColor!= Color.Empty) { objWriter.WriteAttributeString("HoverColor", ColorTranslator.ToHtml(this.HoverBackColor)); } objWriter.WriteAttributeString("Overable", this._overable ? "1" : "0"); if (!string.IsNullOrEmpty(OnClientMouseOver)) { objWriter.WriteAttributeString("OverScript", OnClientMouseOver); } var invoker = objContext as IContextMethodInvoker; string methodName = invoker.GetMethodName(this, "SupperHoverPanel_Init"); //this.InvokeScript(string.Format("{0}({1},event,window)", name,this.ID)); this.InvokeScript(string.Format("{0}('{1}');", methodName,this.ID)); if (!string.IsNullOrEmpty(OnClientMouseLeave)) { objWriter.WriteAttributeString("LeaveScript", OnClientMouseLeave); if (RenderRunClientMouseLeave) { this.InvokeScript(OnClientMouseLeave); } } }
protected override void RenderAttributes(Gizmox.WebGUI.Common.Interfaces.IContext objContext, Gizmox.WebGUI.Common.Interfaces.IAttributeWriter objWriter) { base.RenderAttributes(objContext, objWriter); if (DisplayMode != VWG.DisplayMode.Normal) { objWriter.WriteAttributeString("Hidden", (int)DisplayMode); if (DisplayMode == VWG.DisplayMode.Hidden) { //通过XLST重写只能设置第二层div的样式,所以还需要通过js隐藏最外层的div this.InvokeScript(string.Format("$('#VWG_{0}').attr('vwgvisible',0);$('#VWG_{0}').css('display','none')", this.ID)); } else if (DisplayMode == VWG.DisplayMode.VisibilityHidden) { //通过XLST重写只能设置第二层div的样式,所以还需要通过js隐藏最外层的div this.InvokeScript(string.Format("$('#VWG_{0}').attr('vwgvisible',0);$('#VWG_{0}').css('visibility','hidden')", this.ID)); } } string url = new Gizmox.WebGUI.Common.Resources.StaticGatewayResourceHandle("Bronze.Controls.VWG.HtcFileLoader", typeof(Bronze.Controls.VWG.HtcFileLoader)).ToString(); //var uuu=new Gizmox.WebGUI.Common.Resources.AssemblyResourceHandle(this.GetType(), "Bronze.Controls.VWG.OtherResources.PIE.htc"); if (Radius != CornerRadius.Empty) { CornerRadiusValue rd = this.Radius; string style = rd.GetStyle(); objWriter.WriteAttributeString("Radius", style); } if (this.BoxShadow != this.DefaultBoxShadow) { BoxShadowValue bs = this.BoxShadow; string style = bs.GetStyle(); objWriter.WriteAttributeString("BoxShadow", style); } if (mobjOpacity != 100) { OpacityValue op = new OpacityValue(mobjOpacity); objWriter.WriteAttributeString(WGAttributes.Opacity, op.GetValue(objContext)); } if (ArrowPosition != VWG.ArrowPosition.None) { objWriter.WriteAttributeString("ArrowPosition", ArrowPosition.ToString().ToLower()); objWriter.WriteAttributeString("ArrowStart", this.ArrowStart); } if (LinearGradient != null) { objWriter.WriteAttributeString("Linear", LinearGradient.ToString()); } }
private void editPassword_EnterKeyDown(object objSender, Gizmox.WebGUI.Forms.KeyEventArgs objArgs) { try { LoginApplication(); } catch (Exception ex) { UtilityError.Write(ex); } }