protected override void Render(HtmlTextWriter w) { try { EnsureChildControls(); Table t = new Table(); t.BorderWidth = 0; t.CellPadding = 0; t.CellSpacing = 0; TableRow r = null; TableCell c = null; r = new TableRow(); c = new TableCell(); c.Controls.Add(gv); r.Cells.Add(c); t.Rows.Add(r); t.RenderControl(w); } catch (Exception ex) { UWeb.Error(w, ex); } }
public RsListItems(string[] dataKeyNames) { DataKeyNames = dataKeyNames; LoadXsdRes(UWeb.ResNameCtrl(typeof(RsList), "RsListItem.xsd")); UData.AddColumns(base.DataTable, dataKeyNames); }
private string GetIconFileName(string url) { switch (UWeb.GetExtension(url)) { case ".bmp": return("bmp.ico"); case ".doc": return("doc.ico"); case ".docx": return("docx.ico"); case ".exe": return("exe.ico"); case ".gif": return("gif.ico"); case ".hlp": return("hlp.ico"); case ".img": return("img.ico"); case ".jpg": return("jpg.ico"); case ".lnk": return("lnk.ico"); case ".mdb": return("mdb.ico"); case ".mdf": return("mdf.ico"); case ".msg": return("msg.ico"); case ".msi": return("msi.ico"); case ".pdf": return("pdf.ico"); case ".pic": return("pic.ico"); case ".png": return("png.ico"); case ".ppt": return("ppt.ico"); case ".ra": return("ra.ico"); case ".rar": return("rar.ico"); case ".reg": return("reg.ico"); case ".rtf": return("rtf.ico"); case ".tif": return("tif.ico"); case ".wmv": return("wmv.ico"); case ".xls": return("xls.ico"); case ".txt": return("txt.ico"); default: return("_f.ico"); } }
protected override void OnLoad(EventArgs e) { if (ShowCheckBox) { UWeb.ResJs(this, "JScript.js"); } base.OnLoad(e); }
private void ShowToolBar() { if (bs.Visible) { return; } bd.Visible = ShowDeleteButton && UWeb.UrlExists(Url); be.Visible = ShowEditButton; }
public void LoadXsdRes(string xsdResourceName) { try { LoadXsdText(UWeb.ResText(xsdResourceName)); } catch (Exception ex) { throw ex; } }
protected override void CreateChildControls() { img = new RsImageButton(); img.ID = UWeb.GetUniqueName(this, "img"); img.ImageUrl = UWeb.ResUrl(this, "img.ico"); Controls.Add(img); lnk = new RsHyperLink(); lnk.ID = UWeb.GetUniqueName(this, "lnk"); lnk.NavigateUrl = UWeb.ResUrl(this, "lnk.ico"); Controls.Add(img); }
public static bool IsMovie(string url) { switch (UWeb.GetExtension(url)) { case ".mov": case ".flv": case ".wmv": case ".mpeg": case ".rm": case ".ram": return(true); default: return(false); } }
private void Delete() { if (BeforeDelete != null) { BeforeDelete(this, EventArgs.Empty); } UFile.Delete(UWeb.MapPath(Url)); SetValue(Url, ToolTip); if (AfterDelete != null) { AfterDelete(this, EventArgs.Empty); } }
private void InitWaterMarkText() { if (!ShowWaterMarkText) { return; } Page.ClientScript.RegisterClientScriptInclude(this.GetType().ToString(), UWeb.ResUrl(this, "Script.js")); Text = WaterMarkText; CssClass = CssClassWaterMarkTextBlur; Attributes.Add("onfocus", "RsTextBox_onfocus(this, " + UStr.Quote(CssClassWaterMarkTextFocus) + ", " + UStr.Quote(WaterMarkText) + ");"); Attributes.Add("onblur", "RsTextBox_onblur(this, " + UStr.Quote(CssClassWaterMarkTextBlur) + ", " + UStr.Quote(WaterMarkText) + ");"); Attributes.Add("onkeypress", "return RsTextBox_onkeypress(event, " + UStr.Quote(ClickOnEnterButtonClientID) + ")"); }
public static bool IsImage(string url) { switch (UWeb.GetExtension(url)) { case ".bmp": case ".hlp": case ".img": case ".jpg": case ".jpeg": case ".pic": case ".png": case ".tif": case ".tiff": return(true); default: return(false); } }
private void SetUi(string url, string toolTip) { img.ImageUrl = UrlFile(url); if (img.ImageUrl == "" && url != "") { if (toolTip == "") { toolTip = UWeb.GetFileName(url); } img.ImageUrl = UWeb.ResUrl(this, GetIconFileName(url)); img.ToolTip = toolTip; } lnk.Text = toolTip; lnk.NavigateUrl = url; lnk.ToolTip = toolTip; }
private string UrlFile(string url) { if (!UWeb.UrlExists(url) && ShowNoImage) { if (NoImageUrl == "") { return(UWeb.ResUrl(this, "nis.jpg")); } return(NoImageUrl); } if (UWeb.IsImage(url)) { return(url); } return(""); }
protected override void CreateChildControls() { v = new RsFileViewer(); v.ID = UWeb.GetUniqueName(this, "v"); Controls.Add(v); be = new RsImageButton(); be.ID = UWeb.GetUniqueName(this, "be"); be.CommandName = be.ToolTip = "Edit"; be.ImageUrl = UWeb.ResUrl(this, "be.ico"); be.Click += new ImageClickEventHandler(be_Click); Controls.Add(be); bd = new RsImageButton(); bd.ID = UWeb.GetUniqueName(this, "bd"); bd.CommandName = bd.ToolTip = "Delete"; bd.ImageUrl = UWeb.ResUrl(this, "bd.ico"); bd.Click += new ImageClickEventHandler(bd_Click); bd.Attributes.Add("onclick", "return confirm('Are you sure you want to delete?');"); Controls.Add(bd); bs = new RsImageButton(); bs.ID = UWeb.GetUniqueName(this, "bs"); bs.CommandName = bs.ToolTip = "Save"; bs.ImageUrl = UWeb.ResUrl(this, "bs.ico"); bs.Click += new ImageClickEventHandler(bs_Click); bs.Visible = false; Controls.Add(bs); bc = new RsImageButton(); bc.ID = UWeb.GetUniqueName(this, "bc"); bc.CommandName = bc.ToolTip = "Cancel"; bc.ImageUrl = UWeb.ResUrl(this, "bc.ico"); bc.Click += new ImageClickEventHandler(bc_Click); bc.Visible = false; Controls.Add(bc); fu = new FileUpload(); fu.Width = new Unit(200, UnitType.Pixel); fu.ID = UWeb.GetUniqueName(this, "fu"); fu.Visible = false; Controls.Add(fu); }
public virtual void SetValue(string url, string toolTip) { EnsureChildControls(); Url = url; ToolTip = toolTip; if (!UWeb.UrlExists(url) && !ShowNoImage) { img.Visible = false; } else { img.Visible = true; img.ToolTip = toolTip; SetUi(url, toolTip); } ShowToolBar(); }
private void AddControl(string id, Control container) { Literal c = new Literal(); string groupName = GroupName(parent); id = UWeb.GetUniqueName(parent, "ctl" + rowIndex + id); c.Text = "<input type='radio' id='" + id + "' name='" + groupName + "' value='" + rowIndex + "'"; if (RsRadioButtonListTemplate.SelectedIndex(parent) == rowIndex) { c.Text += " checked='checked'"; } c.Text += "/>"; container.Controls.Add(c); rowIndex++; }
private void Save() { if (BeforeSave != null) { BeforeSave(this, EventArgs.Empty); } bs.Visible = bc.Visible = false; be.Visible = bd.Visible = true; fu.Visible = false; if (PostedFileName != "") { string path = UWeb.MapPath(Url); if (path == "") { path = UrlFolder; } { UFile.Delete(path); } if (!RetainFileNameInEdit) { path = UFile.GetFolder(path) + PostedFileName; } SaveAs(path); } SetValue(Url, ToolTip); if (AfterSave != null) { AfterSave(this, EventArgs.Empty); } }
public static bool QsBool(string name, bool defaultValue) { return(BaseItem.ToBool(UWeb.Qs(name, defaultValue))); }
public static int SelectedIndex(Control parent) { return(UWeb.RfInt32(GroupName(parent), -1)); }
protected override void OnRowDataBound(GridViewRowEventArgs e) { base.OnRowDataBound(e); if (e.Row.RowType != DataControlRowType.DataRow) { return; } if (!ShowCheckBox || dataSourceSelected == null) { return; } if (UData.Contains((DataTable)dataSourceSelected, DataKeyNames.GetValue(0).ToString(), UWeb.ToString(e, DataKeyNames.GetValue(0).ToString()))) { CheckBox chk = e.Row.FindControl("chk") as CheckBox; chk.Checked = true; } }
public static int RfInt32(string name, int defaultValue) { return(BaseItem.ToInt32(UWeb.GetRf(name, defaultValue))); }
public virtual void SetValue(string url) { SetValue(url, UWeb.GetFileName(url)); }
public static string Rf(string name) { return(UWeb.GetRf(name, "").ToString()); }
public static string GetUrlActivateAccount(string userName) { return(UWeb.GetUrl("http://RafeySoft.com/Web/Page/Account/Register.aspx", "rt", AccountRequestTypeE.ActivateAccount.ToString("d"), "rid", UCrypto.ToBase64(userName))); }
public static bool Exists(string url) { return(File.Exists(UWeb.MapPath(url))); }
public static string GetFileName(string url) { return(UFile.GetFileName(UWeb.MapPath(url))); }
public RsListFields() { LoadXsdRes(UWeb.ResNameCtrl(typeof(RsList), "RsListField.xsd")); }
public static string GetExtension(string url) { return(UFile.GetExtension(UWeb.MapPath(url))); }
public static string Qs(string name) { return(UWeb.Qs(name, "").ToString()); }