Esempio n. 1
0
        public static void PrintWebControl(Control ControlToPrint, Control MyStyle)
        {
            StringWriter stringWrite = new StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
            if (ControlToPrint is WebControl)
            {
                Unit w = new Unit(100, UnitType.Percentage);
                ((WebControl)ControlToPrint).Width = w;
            }
            System.Web.UI.Page pg = new System.Web.UI.Page();
            pg.EnableEventValidation = false;
            HtmlForm frm = new HtmlForm();

            frm.Controls.Add(MyStyle);

            pg.Controls.Add(frm);
            frm.Attributes.Add("runat", "server");
            frm.Controls.Add(ControlToPrint);
            pg.DesignerInitialize();
            pg.RenderControl(htmlWrite);
            string strHTML = stringWrite.ToString();
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.Write(strHTML);
            HttpContext.Current.Response.Write("<script>window.print();</script>");
            HttpContext.Current.Response.End();
        }
Esempio n. 2
0
 public static void InitGeneralControlLayout(
     System.Web.UI.WebControls.WebControl MyControl,
     System.Drawing.Color BackColor,
     System.Drawing.Color BorderColor,
     System.Web.UI.WebControls.BorderStyle BorderStyle,
     string AccessKey,
     System.Web.UI.WebControls.Unit BorderWidth,
     string MyCsClass,
     bool visible,
     System.Web.UI.WebControls.Unit Width,
     System.Web.UI.WebControls.Unit Height,
     System.Drawing.Color ForeColor
     )
 {
     MyControl.BackColor   = BackColor;
     MyControl.BorderColor = BorderColor;
     MyControl.BorderStyle = BorderStyle;
     MyControl.AccessKey   = AccessKey;
     MyControl.BorderWidth = BorderWidth;
     MyControl.CssClass    = MyCsClass;
     MyControl.Visible     = visible;
     MyControl.Width       = Width;
     MyControl.Height      = Height;
     MyControl.ForeColor   = ForeColor;
 }
Esempio n. 3
0
        internal static double UnitToMillimeters(Unit unit)
        {
            double toRet = unit.Value;

            switch (unit.Type)
            {
                case UnitType.Cm:
                    { toRet = unit.Value * MM_IN_ONE_CENTIMETER; break; }
                case UnitType.Point:
                    { toRet = unit.Value * MM_IN_ONE_POINT; break; }
                case UnitType.Pica:
                    { toRet = unit.Value * MM_IN_ONE_PICA; break; }
                case UnitType.Inch:
                    { toRet = unit.Value * MM_IN_ONE_INCH; break; }
                case UnitType.Mm:
                    { toRet = unit.Value; break; }
                case UnitType.Pixel:
                    {
                        Unit OnePixelWidth = GetOnePixelSize();
                        toRet = UnitToMillimeters(OnePixelWidth)* unit.Value;
                        break;
                    }

                default:
                    {
                        throw new ApplicationException("Pixel, Percentage, Em, Ex - are not supported in ReportViewer");
                    }
            }

            return toRet;
        }
Esempio n. 4
0
        public Size(Unit _value)
        {
            Unit reportUnit;

            if (_value.Value < 0)
            {
                throw new ApplicationException("Value of Common.Report.Model.Size cannot be negative.");
            }

            switch (_value.Type)
            {
                case UnitType.Mm:
                case UnitType.Inch:
                case UnitType.Cm:
                case UnitType.Point:
                case UnitType.Pica:
                    reportUnit = _value;
                    break;
                default:
                    reportUnit = new Unit(MeasureTools.UnitToMillimeters(_value), UnitType.Mm);
                    break;
            }

            this.Value = reportUnit;
        }
Esempio n. 5
0
 public BackgroundPosition(string value, CultureInfo culture)
 {
     this._type = BackgroundPositionType.NotSet;
     this._value = System.Web.UI.WebControls.Unit.Empty;
     if ((value != null) && (value.Length != 0))
     {
         string str = value.ToLower();
         if ((str.Equals("top") || str.Equals("left")) || str.Equals("toporleft"))
         {
             this._type = BackgroundPositionType.TopOrLeft;
         }
         else if (str.Equals("center"))
         {
             this._type = BackgroundPositionType.Center;
         }
         else if ((str.Equals("bottom") || str.Equals("right")) || str.Equals("bottomorright"))
         {
             this._type = BackgroundPositionType.BottomOrRight;
         }
         else
         {
             this._value = System.Web.UI.WebControls.Unit.Parse(value, culture);
             this._type = BackgroundPositionType.Unit;
         }
     }
 }
        public static string UnitString(Unit unit)
        {
            string rv = string.Empty;
            switch (unit.Type)
            {
                case UnitType.Cm:
                case UnitType.Em:
                case UnitType.Ex:
                case UnitType.Mm:
                    rv = string.Format("{0}{1}", unit.Value, unit.Type.ToString().ToLower());
                    break;
                case UnitType.Inch:
                    rv = string.Format("{0}in", unit.Value);
                    break;
                case UnitType.Percentage:
                    rv = string.Format("{0}%", unit.Value);
                    break;
                case UnitType.Pica:
                    rv = string.Format("{0}pc", unit.Value);
                    break;
                case UnitType.Pixel:
                    rv = string.Format("{0}px", unit.Value);
                    break;
                case UnitType.Point:
                    rv = string.Format("{0}pt", unit.Value);
                    break;
                default:
                    //normally will be pixels
                    rv = string.Format("{0}", unit.Value);
                    break;

            }

            return rv;
        }
 public DnnFormNumericTextBoxItem()
 {
     TextBoxWidth = new Unit(100);
     ShowSpinButtons = true;
     Type = NumericType.Number;
     DecimalDigits = 0;
 }
Esempio n. 8
0
 public static void PrintWebControl(Control ctrl, string Script)
 {
     StringWriter stringWrite = new StringWriter();
     System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
     if (ctrl is WebControl)
     {
         Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
     }
     Page pg = new Page();
     pg.EnableEventValidation = false;
     if (Script != string.Empty)
     {
         pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
     }
     HtmlForm frm = new HtmlForm();
     pg.Controls.Add(frm);
     frm.Attributes.Add("runat", "server");
     frm.Controls.Add(ctrl);
     pg.DesignerInitialize();
     pg.RenderControl(htmlWrite);
     string strHTML = stringWrite.ToString();
     HttpContext.Current.Response.Clear();
     HttpContext.Current.Response.Write(strHTML);
     HttpContext.Current.Response.Write("<script>window.print();</script>");
     HttpContext.Current.Response.End();
 }
Esempio n. 9
0
        public static void PrintWebControl(Control ctrl, string Script)
        {
            StringWriter stringWrite = new StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
            if (ctrl is WebControl)
            {
                Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
            }
            Page pg = new Page();
            pg.EnableEventValidation = false;
            pg.StyleSheetTheme = "../CSS/order.css";
            if (Script != string.Empty)
            {
                pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
            }

            HtmlLink link = new HtmlLink();
            link.Href = "../CSS/order.css";
            HtmlForm frm = new HtmlForm();
            pg.Controls.Add(frm);
            frm.Attributes.Add("runat", "server");
            frm.Controls.Add(ctrl);
            pg.DesignerInitialize();
            pg.RenderControl(htmlWrite);
            string strHTML = stringWrite.ToString();
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.Write("<head runat='server'> <title>Printer - Bản in tại Support.evnit.evn.com.vn</title> <link type='text/css' rel='stylesheet' href='../CSS/order.css'><link type='text/css' rel='stylesheet' href='../CSS/style.css'></head>");
            HttpContext.Current.Response.Write(strHTML);
            HttpContext.Current.Response.Write("<script>window.print();</script>");
            HttpContext.Current.Response.End();
        }
Esempio n. 10
0
 public MessageWindowParameters(string message, string title, string windowWidth, string windowHeight)
 {
     _Message = message;
     _Title = title;
     _WindowWidth = Unit.Parse(windowWidth);
     _WindowHeight = Unit.Parse(windowHeight);
 }
Esempio n. 11
0
        public void PrintWebControl(Control ControlToPrint)
        {
            StringWriter stringWrite = new StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
            if (ControlToPrint is WebControl)
            {
                Unit w = new Unit(100, UnitType.Percentage);
                ((WebControl)ControlToPrint).Width = w;

            }

            Page pg = new Page();

            pg.EnableEventValidation = false;
            HtmlForm frm = new HtmlForm();
            pg.Controls.Add(frm);
            frm.Attributes.Add("runat", "server");
            frm.Controls.Add(ControlToPrint);
            pg.DesignerInitialize();
            pg.RenderControl(htmlWrite);

            string strHTML = stringWrite.ToString();
            string wstawka = Server.MapPath("~").ToString();

            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.Write(htmlToImage(strHTML, zmianaAdresu(wstawka)));

            HttpContext.Current.Response.Write("<script>window.print();</script>");
            HttpContext.Current.Response.End();

            Response.Redirect("~/ListaImprez.aspx");
        }
Esempio n. 12
0
        public static Unit GetUnit(string key, Unit defaultValue)
        {
            if (ConfigurationManager.AppSettings[key] != null)
            {
                return Unit.Parse(ConfigurationManager.AppSettings[key], CultureInfo.InvariantCulture);
            }

            return defaultValue;
        }
Esempio n. 13
0
		public DatePicker()
		{
			textBox.ID = "textBox";
			textBox.Width = new Unit("90px");
			textBox.Style[HtmlTextWriterStyle.VerticalAlign] = "bottom";

			Width = new Unit("64px");
			CssClass = "DatePicker";
		}
Esempio n. 14
0
 /// <summary>
 /// Formats the provided unit value ready for use in styles.
 /// </summary>
 /// <param name="value">The unit value to format.</param>
 /// <returns>The provided unit value ready for use in styles.</returns>
 public static string FormatUnit(Unit value)
 {
     string ext = String.Empty;
     if (value.Type == UnitType.Pixel)
         ext = "px";
     else if (value.Type == UnitType.Percentage)
         ext = "%";
     return value.Value + ext;
 }
 public jAutocomplete() : base()
 {
     this.IncludeJqueryUI = true;
     this.UITheme = UIThemes.UiLightness;
     this.DataSource = null;
     this.DataSourceUrl = string.Empty;
     this.DataFieldName = string.Empty;
     this.MaxHeight = 0;
 }
Esempio n. 16
0
        internal Unit UnitPixelTypeCheck(object obj, Unit defaultValue, string propertyName)
        {
            Unit temp = (obj == null) ? defaultValue : (Unit)obj;

            if (temp.Type != UnitType.Pixel)
            {
                throw new InvalidCastException("The Unit Type for the toolbar spacer {0} property must be of Type 'Pixel'. Example: Unit.Pixel(150) or '150px'.".FormatWith(propertyName));
            }

            return temp;
        }
 internal EwfTableFieldOrItemSetup( IEnumerable<string> classes, Unit? size, TextAlignment textAlignment, TableCellVerticalAlignment verticalAlignment,
     ClickScript clickScript, string toolTip, Control toolTipControl)
 {
     Classes = ( classes ?? new string[0] ).ToList();
     Size = size ?? Unit.Empty;
     TextAlignment = textAlignment;
     VerticalAlignment = verticalAlignment;
     ClickScript = clickScript;
     ToolTip = toolTip;
     ToolTipControl = toolTipControl;
 }
Esempio n. 18
0
 public Navigation01()
 {
     this.page_Index = "index.aspx";
     this.page_Add = "add.aspx";
     this.page_Delete = "delete.aspx";
     this.page_Modify = "modify.aspx";
     this.page_Search = "search.aspx";
     this.page_Show = "show.aspx";
     this.page_width = 600;
     this.page_Mode = Mode.Show;
 }
 public void CanParseStringToUnit()
 {
     var stringUnit = "1234px";
     object objUnit = "1234px";
     var result = stringUnit.TryConvertTo<Unit>();
     var result2 = objUnit.TryConvertTo<Unit>();
     var unit = new Unit("1234px");
     Assert.IsTrue(result.Success);
     Assert.IsTrue(result2.Success);
     Assert.AreEqual(unit, result.Result);
     Assert.AreEqual(unit, result2.Result);
 }
Esempio n. 20
0
		private void Test(Type ctrlType)
		{
			Unit unit1;
			try
			{
				this.GHTSubTestBegin(ctrlType, "Valid value");
				unit1 = new Unit(120);
				this.TestedControl.Width = unit1;
			}
			catch (Exception exception5)
			{
				// ProjectData.SetProjectError(exception5);
				Exception exception1 = exception5;
				this.GHTSubTestUnexpectedExceptionCaught(exception1);
				// ProjectData.ClearProjectError();
			}
			try
			{
				this.GHTSubTestBegin(ctrlType, "Default value");
				unit1 = this.TestedControl.Width;
				this.GHTSubTestAddResult("Default width = " + unit1.ToString());
			}
			catch (Exception exception6)
			{
				// ProjectData.SetProjectError(exception6);
				Exception exception2 = exception6;
				this.GHTSubTestUnexpectedExceptionCaught(exception2);
				// ProjectData.ClearProjectError();
			}
			this.GHTSubTestEnd();
			try
			{
				this.GHTSubTestBegin(ctrlType, "Negative value");
				unit1 = new Unit(-10);
				this.TestedControl.Width = unit1;
				this.GHTSubTestExpectedExceptionNotCaught("ArgumentException");
			}
			catch (ArgumentException exception7)
			{
				// ProjectData.SetProjectError(exception7);
				// ArgumentException exception3 = exception7;
				this.GHTSubTestAddResult("Test passed. Expected ArgumentException exception was caught.");
				// ProjectData.ClearProjectError();
			}
			catch (Exception exception8)
			{
				// ProjectData.SetProjectError(exception8);
				Exception exception4 = exception8;
				this.GHTSubTestUnexpectedExceptionCaught(exception4);
				// ProjectData.ClearProjectError();
			}
			this.GHTSubTestEnd();
		}
Esempio n. 21
0
 public JQBarChart()
 {
     Width = new Unit(600, UnitType.Pixel);
     Height = new Unit(600, UnitType.Pixel);
     Title = "JQBarChart";
     barWidth = 20;
     labelShow = true;
     LegendShow = false;
     stack = false;
     pointLabels = true;
     dataFields = new JQCollection<JQChartDataField>(this);
 }
        WebControl ActionControlStyle.SetUpControl( WebControl control, string defaultText, Unit width, Unit height, Action<Unit> widthSetter )
        {
            widthSetter( width );

            var cssElement = CssElementCreator.NormalButtonStyleClass;
            if( buttonSize == ButtonSize.ShrinkWrap )
                cssElement = CssElementCreator.ShrinkWrapButtonStyleClass;
            else if( buttonSize == ButtonSize.Large )
                cssElement = CssElementCreator.LargeButtonStyleClass;
            control.CssClass = control.CssClass.ConcatenateWithSpace( CssElementCreator.AllStylesClass + " " + cssElement );

            return control.AddControlsReturnThis( ActionControlIcon.GetIconAndTextControls( icon, text.Any() ? text : defaultText ) );
        }
Esempio n. 23
0
 public BackgroundPosition(System.Web.UI.WebControls.Unit value)
 {
     this._type = BackgroundPositionType.NotSet;
     if (!value.IsEmpty)
     {
         this._type = BackgroundPositionType.Unit;
         this._value = value;
     }
     else
     {
         this._value = System.Web.UI.WebControls.Unit.Empty;
     }
 }
 private FormItemBlock(
     bool hideIfEmpty, string heading, bool useFormItemListMode, int? numberOfColumns, int defaultFormItemCellSpan, Unit? firstColumnWidth,
     Unit? secondColumnWidth, TableCellVerticalAlignment verticalAlignment, IEnumerable<FormItem> formItems)
 {
     this.hideIfEmpty = hideIfEmpty;
     this.heading = heading;
     this.useFormItemListMode = useFormItemListMode;
     this.numberOfColumns = numberOfColumns;
     this.defaultFormItemCellSpan = defaultFormItemCellSpan;
     this.firstColumnWidth = firstColumnWidth;
     this.secondColumnWidth = secondColumnWidth;
     this.verticalAlignment = verticalAlignment;
     this.formItems = ( formItems ?? new FormItem[ 0 ] ).ToList();
 }
Esempio n. 25
0
		public FontUnit (FontSize type)
		{
			int t = (int) type;
			
			if (t < 0 || t > (int)FontSize.XXLarge)
				throw new ArgumentOutOfRangeException ("type");
			
			this.type = type;

			if (type == FontSize.AsUnit)
				unit = new Unit (10, UnitType.Point);
			else
				unit = Unit.Empty;
		}
Esempio n. 26
0
        public GridColumn(string headerName, string fieldName, Unit unit, FieldType type, ButtonType button, string commandName, HorizontalAlign hAlign)
        {
            this.headerName = headerName;
            this.fieldName = fieldName;
            this.unit = unit;
            this.type = type;
            this.button = button;
            this.commandName = commandName;
            this.hAlign = hAlign;

            if (type == FieldType.TextBoxTemplate)
            {
                _textBoxTemplate = new TextBoxTemplate(fieldName);
            }
        }
Esempio n. 27
0
 public ComponentArtReferenceFieldExtension()
     : base()
 {
     cssClass             = "comboBox";
     hoverCssClass        = "comboBoxHover";
     focusedCssClass      = "comboBoxHover";
     textBoxCssClass      = "comboTextBox";
     dropDownCssClass     = "comboDropDown";
     itemCssClass         = "comboItem";
     itemHoverCssClass    = "comboItemHover";
     selectedItemCssClass = "comboItemHover";
     dropHoverImageUrl    = "combobox_images/drop_hover.gif";
     dropImageUrl         = "combobox_images/drop.gif";
     width = Unit.Pixel(300);
 }
Esempio n. 28
0
 public BackgroundPosition(BackgroundPositionType type)
 {
     if ((type < BackgroundPositionType.NotSet) || (type > BackgroundPositionType.BottomOrRight))
     {
         throw new ArgumentOutOfRangeException("type");
     }
     this._type = type;
     if (type == BackgroundPositionType.Unit)
     {
         this._value = System.Web.UI.WebControls.Unit.Pixel(0);
     }
     else
     {
         this._value = System.Web.UI.WebControls.Unit.Empty;
     }
 }
Esempio n. 29
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public TabControl()
        {
            this.SelectedTab = new HtmlInputHidden();
            this._SelectedIndex = -1;
            this.SelectedTab.Value = string.Empty;
            this._Width = Unit.Pixel(350);
            this._Height = Unit.Pixel(150);
            this._Items = new TabPageCollection(this);
            this._SelectionMode = SelectionModeEnum.Client;

            this.Height = Unit.Pixel(100);
            this.Width = Unit.Pixel(100);
            this._HeightUnitMode = HeightUnitEnum.percent;
            this._WidthUnitMode = WidthUnitEnum.percent;
            this.LeftOffSetX = 0;
        }
Esempio n. 30
0
 protected void GridViewArticle_RowCreated(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
     {
         System.Web.UI.WebControls.Unit unit1 = Unit.Parse("5%");
         System.Web.UI.WebControls.Unit unit2 = Unit.Parse("10%");
         System.Web.UI.WebControls.Unit unit3 = Unit.Parse("65%");
         System.Web.UI.WebControls.Unit unit4 = Unit.Parse("10%");
         System.Web.UI.WebControls.Unit unit5 = Unit.Parse("10%");
         e.Row.Cells[0].Width = unit1;
         e.Row.Cells[1].Width = unit2;
         e.Row.Cells[1].Width = unit3;
         e.Row.Cells[1].Width = unit4;
         e.Row.Cells[1].Width = unit5;
     }
 }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            TransactionGridView.Style.Add(HtmlTextWriterStyle.Width, "100%");
            TransactionGridView.BorderWidth = Unit.Pixel(1);

            if (Request.Browser.Browser == "IE" || Request.Browser.Browser == "Firefox")
            {
                //TransactionGridView.SettingsBehavior.ColumnResizeMode = ColumnResizeMode.NextColumn;
            }
            else
            {
                //TransactionGridView.Settings.UseFixedTableLayout = false;
                System.Web.UI.WebControls.Unit xWidth = new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage);
                TransactionGridView.Width = xWidth;
                TransactionGridView.Attributes.Add("style", "table-layout:auto;width:100%;column-width: auto;");
            }
        }
Esempio n. 32
0
            public override void Apply(Calendar wc)
            {
                ClearCalendar(wc);

                wc.DayNameFormat  = DayNameFormat.FirstLetter;
                wc.NextPrevFormat = NextPrevFormat.FullMonth;
                wc.TitleFormat    = TitleFormat.Month;

                wc.CellPadding   = 2;
                wc.CellSpacing   = 0;
                wc.ShowGridLines = false;

                wc.Height      = Unit.Pixel(220);
                wc.Width       = Unit.Pixel(400);
                wc.BackColor   = Color.White;
                wc.BorderColor = Color.Black;
                wc.ForeColor   = Color.Black;
                wc.Font.Name   = "Times New Roman";
                wc.Font.Size   = FontUnit.Point(10);

                wc.TitleStyle.Font.Bold     = true;
                wc.TitleStyle.ForeColor     = Color.White;
                wc.TitleStyle.BackColor     = Color.Black;
                wc.TitleStyle.Font.Size     = FontUnit.Point(13);
                wc.TitleStyle.Height        = Unit.Point(14);
                wc.NextPrevStyle.ForeColor  = Color.White;
                wc.NextPrevStyle.Font.Size  = FontUnit.Point(8);
                wc.DayHeaderStyle.Font.Bold = true;
                wc.DayHeaderStyle.Font.Size = FontUnit.Point(7);
                wc.DayHeaderStyle.Font.Name = "Verdana";
                wc.DayHeaderStyle.BackColor = Color.FromArgb(0xCC, 0xCC, 0xCC);
                wc.DayHeaderStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33);
                wc.DayHeaderStyle.Height    = Unit.Pixel(10);
                wc.SelectorStyle.BackColor  = Color.FromArgb(0xCC, 0xCC, 0xCC);
                wc.SelectorStyle.ForeColor  = Color.FromArgb(0x33, 0x33, 0x33);
                wc.SelectorStyle.Font.Bold  = true;
                wc.SelectorStyle.Font.Size  = FontUnit.Point(8);
                wc.SelectorStyle.Font.Name  = "Verdana";
                wc.SelectorStyle.Width      = Unit.Percentage(1);

                wc.DayStyle.Width               = Unit.Percentage(14);
                wc.TodayDayStyle.BackColor      = Color.FromArgb(0xCC, 0xCC, 0x99);
                wc.SelectedDayStyle.BackColor   = Color.FromArgb(0xCC, 0x33, 0x33);
                wc.SelectedDayStyle.ForeColor   = Color.White;
                wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99);
            }
Esempio n. 33
0
            public override void Apply(Calendar wc)
            {
                ClearCalendar(wc);

                wc.DayNameFormat  = DayNameFormat.FirstLetter;
                wc.NextPrevFormat = NextPrevFormat.CustomText;
                wc.TitleFormat    = TitleFormat.MonthYear;

                wc.CellPadding   = 1;
                wc.CellSpacing   = 0;
                wc.ShowGridLines = false;

                wc.Height      = Unit.Pixel(200);
                wc.Width       = Unit.Pixel(220);
                wc.BackColor   = Color.White;
                wc.BorderColor = Color.FromArgb(0x33, 0x66, 0xCC);
                wc.BorderWidth = Unit.Pixel(1);
                wc.ForeColor   = Color.FromArgb(0x00, 0x33, 0x99);
                wc.Font.Name   = "Verdana";
                wc.Font.Size   = FontUnit.Point(8);

                wc.TitleStyle.Font.Bold     = true;
                wc.TitleStyle.Font.Size     = FontUnit.Point(10);
                wc.TitleStyle.BackColor     = Color.FromArgb(0x00, 0x33, 0x99);
                wc.TitleStyle.ForeColor     = Color.FromArgb(0xCC, 0xCC, 0xFF);
                wc.TitleStyle.BorderColor   = Color.FromArgb(0x33, 0x66, 0xCC);
                wc.TitleStyle.BorderStyle   = UI.WebControls.BorderStyle.Solid;
                wc.TitleStyle.BorderWidth   = Unit.Pixel(1);
                wc.TitleStyle.Height        = Unit.Pixel(25);
                wc.NextPrevStyle.ForeColor  = Color.FromArgb(0xCC, 0xCC, 0xFF);
                wc.NextPrevStyle.Font.Size  = FontUnit.Point(8);
                wc.DayHeaderStyle.BackColor = Color.FromArgb(0x99, 0xCC, 0xCC);
                wc.DayHeaderStyle.ForeColor = Color.FromArgb(0x33, 0x66, 0x66);
                wc.DayHeaderStyle.Height    = Unit.Pixel(1);
                wc.SelectorStyle.BackColor  = Color.FromArgb(0x99, 0xCC, 0xCC);
                wc.SelectorStyle.ForeColor  = Color.FromArgb(0x33, 0x66, 0x66);

                wc.SelectedDayStyle.BackColor   = Color.FromArgb(0x00, 0x99, 0x99);
                wc.SelectedDayStyle.ForeColor   = Color.FromArgb(0xCC, 0xFF, 0x99);
                wc.SelectedDayStyle.Font.Bold   = true;
                wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99);
                wc.TodayDayStyle.ForeColor      = Color.White;
                wc.TodayDayStyle.BackColor      = Color.FromArgb(0x99, 0xCC, 0xCC);
                wc.WeekendDayStyle.BackColor    = Color.FromArgb(0xCC, 0xCC, 0xFF);
            }
Esempio n. 34
0
        public void PrintWebControl(Control ControlToPrint)
        {
            StringWriter stringWrite = new StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
            if (ControlToPrint is WebControl)
            {
                Unit w = new Unit(100, UnitType.Percentage);
                ((WebControl)ControlToPrint).Width = w;

            }

            Page pg = new Page();

            pg.EnableEventValidation = false;
            HtmlForm frm = new HtmlForm();
            pg.Controls.Add(frm);
            frm.Attributes.Add("runat", "server");
            frm.Controls.Add(ControlToPrint);
            pg.DesignerInitialize();
            pg.RenderControl(htmlWrite);

            string strHTML = stringWrite.ToString();
            string wstawka = Server.MapPath("~").ToString();
            string path = String.Format("{0}\\Images\\Rezerwacje\\{1}.gif", Server.MapPath("~"), Session["ZamowienieId"]);

            //korzystanie z biblioteki websiteScreenshote

            WebsitesScreenshot.WebsitesScreenshot _Obj = new WebsitesScreenshot.WebsitesScreenshot();
            WebsitesScreenshot.WebsitesScreenshot.Result _Result = _Obj.CaptureHTML(htmlToImage(strHTML, zmianaAdresu(wstawka)));

            if (_Result == WebsitesScreenshot.WebsitesScreenshot.Result.Captured)
            {
                _Obj.ImageFormat = WebsitesScreenshot.WebsitesScreenshot.ImageFormats.GIF;
                _Obj.SaveImage(path);
            }
            _Obj.Dispose();

            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.Write(strHTML);
            Session[Cart.Ident] = null;
            HttpContext.Current.Response.Write("<script>window.print();</script>");
            HttpContext.Current.Response.End();

            Response.Redirect("~/ListaImprez.aspx");
        }
Esempio n. 35
0
		public static string CreateProgressBar(float progress, Orientation orientation, Unit width, Unit height, Unit borderWidth)
		{
			return CreateProgressBar(
				progress,
				orientation,
				width,
				height,
				borderWidth,
				string.Empty,
				string.Empty,
				string.Empty,
				string.Empty,
				string.Empty,
				string.Empty,
				string.Empty,
				string.Empty
				);
		}
 public ClsBindGridColumn_Web_Telerik(
     string FieldName
     , string FieldDesc
     , Unit? Width = null
     , string DataFormat = ""
     , Layer01_Constants.eSystem_Lookup_FieldType FieldType = Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Static
     , bool IsVisible = true
     , bool Enabled = true
     , bool IsFilter = true)
     : base(FieldName
     , FieldDesc
     , Width
     , DataFormat
     , FieldType
     , IsVisible
     , Enabled
     , IsFilter)
 {
 }
Esempio n. 37
0
            public override void Apply(Calendar wc)
            {
                ClearCalendar(wc);

                wc.DayNameFormat  = DayNameFormat.Short;
                wc.NextPrevFormat = NextPrevFormat.ShortMonth;
                wc.TitleFormat    = TitleFormat.MonthYear;

                wc.CellPadding   = 2;
                wc.CellSpacing   = 1;
                wc.ShowGridLines = false;

                wc.Height      = Unit.Pixel(250);
                wc.Width       = Unit.Pixel(330);
                wc.BackColor   = Color.White;
                wc.BorderColor = Color.Black;
                wc.BorderStyle = UI.WebControls.BorderStyle.Solid;
                wc.ForeColor   = Color.Black;
                wc.Font.Name   = "Verdana";
                wc.Font.Size   = FontUnit.Point(9);

                wc.TitleStyle.Font.Bold     = true;
                wc.TitleStyle.ForeColor     = Color.White;
                wc.TitleStyle.BackColor     = Color.FromArgb(0x33, 0x33, 0x99);
                wc.TitleStyle.Font.Size     = FontUnit.Point(12);
                wc.TitleStyle.Height        = Unit.Point(12);
                wc.NextPrevStyle.Font.Bold  = true;
                wc.NextPrevStyle.Font.Size  = FontUnit.Point(8);
                wc.NextPrevStyle.ForeColor  = Color.White;
                wc.DayHeaderStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33);
                wc.DayHeaderStyle.Font.Bold = true;
                wc.DayHeaderStyle.Font.Size = FontUnit.Point(8);
                wc.DayHeaderStyle.Height    = Unit.Point(8);

                wc.DayStyle.BackColor           = Color.FromArgb(0xCC, 0xCC, 0xCC);
                wc.TodayDayStyle.BackColor      = Color.FromArgb(0x99, 0x99, 0x99);
                wc.TodayDayStyle.ForeColor      = Color.White;
                wc.SelectedDayStyle.BackColor   = Color.FromArgb(0x33, 0x33, 0x99);
                wc.SelectedDayStyle.ForeColor   = Color.White;
                wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99);
            }
Esempio n. 38
0
            public override void Apply(Calendar wc)
            {
                ClearCalendar(wc);

                wc.DayNameFormat  = DayNameFormat.FirstLetter;
                wc.NextPrevFormat = NextPrevFormat.CustomText;
                wc.TitleFormat    = TitleFormat.MonthYear;

                wc.CellPadding   = 4;
                wc.CellSpacing   = 0;
                wc.ShowGridLines = false;

                wc.Height      = Unit.Pixel(180);
                wc.Width       = Unit.Pixel(200);
                wc.BorderColor = Color.FromArgb(0x99, 0x99, 0x99);
                wc.ForeColor   = Color.Black;
                wc.BackColor   = Color.White;
                wc.Font.Name   = "Verdana";
                wc.Font.Size   = FontUnit.Point(8);

                wc.TitleStyle.Font.Bold        = true;
                wc.TitleStyle.BorderColor      = Color.Black;
                wc.TitleStyle.BackColor        = Color.FromArgb(0x99, 0x99, 0x99);
                wc.NextPrevStyle.VerticalAlign = VerticalAlign.Bottom;
                wc.DayHeaderStyle.Font.Bold    = true;
                wc.DayHeaderStyle.Font.Size    = FontUnit.Point(7);
                wc.DayHeaderStyle.BackColor    = Color.FromArgb(0xCC, 0xCC, 0xCC);
                wc.SelectorStyle.BackColor     = Color.FromArgb(0xCC, 0xCC, 0xCC);

                wc.TodayDayStyle.BackColor      = Color.FromArgb(0xCC, 0xCC, 0xCC);
                wc.TodayDayStyle.ForeColor      = Color.Black;
                wc.SelectedDayStyle.BackColor   = Color.FromArgb(0x66, 0x66, 0x66);
                wc.SelectedDayStyle.ForeColor   = Color.White;
                wc.SelectedDayStyle.Font.Bold   = true;
                wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x80, 0x80, 0x80);
                wc.WeekendDayStyle.BackColor    = Color.FromArgb(0xFF, 0xFF, 0xCC);
            }
Esempio n. 39
0
    }//

    /// <summary>
    /// Responsabile della creazione dinamica degli indici di pagina disponibili.
    /// Visualizza massimo dieci pagine, centrate in quella selezionata.
    /// Se ce ne sono meno di dieci vanno visualizzate tutte quelle disponibili, centrate
    /// in quella selezionata.
    /// Il raggiungimento di pagina va fatto mediante Session["lastBurnIndex"], indifferentemente
    /// con Cacher::GetPreviousChunk o Cacher::GetnextChunk, passando il Session["lastBurnIndex"]
    /// appropriato.
    /// </summary>
    /// <param name="paginaDesiderata">viene decisa dal chiamante, che e' Page_Load, in base
    /// al parametro "parPage", passato in Request, dallo href dell'indice selezionato.
    /// Nel caso (!IsPostBack) viene passato "1" di default, e la visualizzazione va da uno
    /// alla ultima disponibile, col vincolo di non superare l'indice dieci.
    /// </param>
    protected void PageIndexManager(int paginaDesiderata)
    {
        object objlastBurnIndex = this.Session["lastBurnIndex"];

        if (null != objlastBurnIndex)
        {
            this.lastBurnIndex = (int)objlastBurnIndex;
        }
        else
        {
            this.lastBurnIndex = -1;// default
        }
        //
        int    totaleRighe    = 20;
        object objtotaleRighe = this.Session["RowsInCache"];

        if (null != objtotaleRighe)
        {
            totaleRighe = (int)objtotaleRighe;
        }
        else
        {
            totaleRighe = ((Cacher)(this.Session["Cacher"])).GetRowsInCache();
        }
        //
        int pagineDisponibili =
            (int)System.Math.Ceiling((double)totaleRighe /
                                     (double)this.RowsInChunk);
        int pagineDisponibiliLeft     = paginaDesiderata - 1;
        int pagineDisponibiliRight    = pagineDisponibili - paginaDesiderata;
        int paginaMinima              = (paginaDesiderata - 4 > 0) ? paginaDesiderata - 4 : 1;
        int pagineUtilizzateASinistra = paginaDesiderata - paginaMinima;
        int pagineDisponibiliADestra  = 10 - (pagineUtilizzateASinistra + 1);
        int paginaMassima             = (paginaDesiderata + pagineDisponibiliADestra <= pagineDisponibili) ? paginaDesiderata + pagineDisponibiliADestra : pagineDisponibili;

        //
        this.lastBurnIndex = (paginaDesiderata - 1) * this.RowsInChunk - 1;
        //
        // decorazione html.table all'interno del panel
        string currentFullPath         = base.Request.AppRelativeCurrentExecutionFilePath;
        string currentPage             = currentFullPath.Substring(currentFullPath.LastIndexOf('/') + 1);
        string rawUrl                  = base.Request.RawUrl;
        string remainingQueryString    = "";
        string queryStringPreesistente = "";
        int    questionMarkIndex       = rawUrl.IndexOf('?', 0, rawUrl.Length);

        if (-1 == questionMarkIndex)       // caso NON esistano altri get-params
        {
            queryStringPreesistente = "?"; // NB. dbg 20100712
            remainingQueryString    = "";
        }// end caso NON esistano altri get-params
        else// caso esistano altri get-params
        {
            remainingQueryString = rawUrl.Substring(questionMarkIndex + 1);
            int    indexStartParPage = remainingQueryString.IndexOf("parPage=", 0, remainingQueryString.Length);
            int    indexEndParPage   = -1;
            string prefix            = ""; // porzione queryString precedente "parPage=xxx"
            string suffix            = ""; // porzione queryString successiva "parPage=xxx"
            if (-1 == indexStartParPage)
            {
                indexEndParPage = -1;
                prefix          = rawUrl.Substring(questionMarkIndex + 1);
            }
            else
            {
                if (0 == indexStartParPage)
                {
                    prefix = "";
                }
                else if (0 < indexStartParPage)
                {
                    prefix = remainingQueryString.Substring(0, indexStartParPage - 1);// exclude '&' at end.
                }
                indexEndParPage = remainingQueryString.IndexOf("&", indexStartParPage);
            }

            if (-1 != indexEndParPage)
            {
                suffix = remainingQueryString.Substring(indexEndParPage);// da '&' compreso
            }
            else
            {
                suffix = "";
            }
            queryStringPreesistente = "?" + prefix + suffix;// Query String privata del parPage
            if (1 < queryStringPreesistente.Length)
            {
                queryStringPreesistente += "&";
            }
        }// end caso esistano altri get-params
        //
        for (int c = paginaMinima; c <= paginaMassima; c++)
        {
            System.Web.UI.WebControls.LinkButton x = new System.Web.UI.WebControls.LinkButton();
            x.ID      = "pag_" + c.ToString();
            x.Text    = "&nbsp;" + c.ToString() + "&nbsp;";
            x.Visible = true;
            x.Enabled = true;
            x.Attributes.Add("href", currentPage + queryStringPreesistente + "parPage=" + c.ToString());//   parametro_Get per specificare la redirect_Page
            this.pnlPageNumber.Controls.Add(x);
            //
            if (paginaDesiderata == c)
            {
                x.ForeColor = System.Drawing.Color.Yellow;
                System.Web.UI.WebControls.Unit selectedPage_fontSize = x.Font.Size.Unit;
                x.Font.Size = new FontUnit(selectedPage_fontSize.Value + 24.0);
                x.Font.Bold = true;
            }
        }// end loop of addition of dynamic link buttons
        System.Web.UI.WebControls.Label y = new System.Web.UI.WebControls.Label();
        y.Text = " (totale " + pagineDisponibili.ToString() + " pagine)";
        this.pnlPageNumber.Controls.Add(y);
        //
        Cacher cacher = null;

        try
        {
            object objCacher         = this.Session["Cacher"];
            System.Data.DataTable dt = null;// default
            if (null != objCacher)
            {
                cacher = (Cacher)objCacher;
                dt     =
                    cacher.GetNextChunk(
                        this.RowsInChunk, ref this.lastBurnIndex);
            }
            this.Session["lastBurnIndex"] = this.lastBurnIndex; // update
            this.Session["DataChunk"]     = dt;                 // update
        }
        catch (System.Exception ex)
        {
            string s = ex.Message;
        }
    }// end PageIndexManager
Esempio n. 40
0
    }//

    /// <summary>
    ///
    /// Responsabile della creazione dinamica degli indici di pagina disponibili.
    /// Visualizza massimo dieci pagine, centrate in quella selezionata.
    /// Se ce ne sono meno di dieci vanno visualizzate tutte quelle disponibili, centrate
    /// in quella selezionata.
    /// </summary>
    ///
    /// <param name="paginaDesiderata">viene decisa dal chiamante, che e' this.Pager_EntryPoint, in base
    /// al parametro "parPage", passato in Request, dallo href dell'indice selezionato.
    /// In ogni caso in cui manchi il parametro parPage nella url la paginaDesiderata viene portata
    /// ad "1" di default, e la visualizzazione va da uno alla ultima disponibile,
    /// col vincolo di non superare l'indice dieci.
    /// </param>
    ///
    private void PageIndexManager(
        System.Web.SessionState.HttpSessionState Session
        , System.Web.HttpRequest Request
        , int paginaDesiderata
        , System.Web.UI.WebControls.Panel pnlPageNumber
        , out System.Data.DataTable dt
        )
    {
        int totaleRighe = this.rowCardinality;// tested.

        //----range check-------
        if (0 >= this.RowsInChunk)
        {
            throw new System.Exception(" non-positive number of rowsPerPage required. ");
        }// can continue.
        //
        int pagineDisponibili =
            (int)System.Math.Ceiling((double)totaleRighe /
                                     (double)this.RowsInChunk);
        int pagineDisponibiliLeft     = paginaDesiderata - 1;
        int pagineDisponibiliRight    = pagineDisponibili - paginaDesiderata;
        int paginaMinima              = (paginaDesiderata - 4 > 0) ? paginaDesiderata - 4 : 1;
        int pagineUtilizzateASinistra = paginaDesiderata - paginaMinima;
        int pagineDisponibiliADestra  = 10 - (pagineUtilizzateASinistra + 1);
        int paginaMassima             = (paginaDesiderata + pagineDisponibiliADestra <= pagineDisponibili) ? paginaDesiderata + pagineDisponibiliADestra : pagineDisponibili;
        //
        // decorazione html.table all'interno del panel
        string currentFullPath = Request.AppRelativeCurrentExecutionFilePath;
        string currentPage     = currentFullPath.Substring(currentFullPath.LastIndexOf('/') + 1);
        string rawUrl          = Request.RawUrl;

        LoggingToolsContainerNamespace.LoggingToolsContainer.LogBothSinks_DbFs(
            "App_Code::CacherDbView::PageIndexManager: debug QueryStringParser. "
            + " whole_Query_string = " + rawUrl
            , 0);
        string remainingQueryString    = "";
        string queryStringPreesistente = "";
        int    questionMarkIndex       = rawUrl.IndexOf('?', 0, rawUrl.Length);

        if (-1 == questionMarkIndex)       // caso NON esistano altri get-params
        {
            queryStringPreesistente = "?"; // NB. dbg 20100712
            remainingQueryString    = "";
        }// end caso NON esistano altri get-params
        else// caso esistano altri get-params
        {
            remainingQueryString = rawUrl.Substring(questionMarkIndex + 1);
            int    indexStartParPage = remainingQueryString.IndexOf("parPage=", 0, remainingQueryString.Length);
            int    indexEndParPage   = -1;
            string prefix            = ""; // porzione queryString precedente "parPage=xxx"
            string suffix            = ""; // porzione queryString successiva "parPage=xxx"
            if (-1 == indexStartParPage)
            {
                indexEndParPage = -1;
                prefix          = rawUrl.Substring(questionMarkIndex + 1);
            }
            else
            {
                if (0 == indexStartParPage)
                {
                    prefix = "";
                }
                else if (0 < indexStartParPage)
                {
                    prefix = remainingQueryString.Substring(0, indexStartParPage - 1);// exclude '&' at end.
                }
                indexEndParPage = remainingQueryString.IndexOf("&", indexStartParPage);
            }

            if (-1 != indexEndParPage)
            {
                suffix = remainingQueryString.Substring(indexEndParPage);// da '&' compreso
            }
            else
            {
                suffix = "";
            }
            queryStringPreesistente = "?" + prefix + suffix;// Query String privata del parPage
            if (1 < queryStringPreesistente.Length)
            {
                queryStringPreesistente += "&";
            } // else nothing to add.
        }     // end caso esistano altri get-params
        //
        // clean the dynamic-html panel-content, before re-filling.
        int dbg_controlsInDynamicPanel = pnlPageNumber.Controls.Count;

        pnlPageNumber.Controls.Clear();
        //
        for (int c = paginaMinima; c <= paginaMassima; c++)
        {
            System.Web.UI.WebControls.LinkButton x = new System.Web.UI.WebControls.LinkButton();
            x.ID      = "pag_" + c.ToString();
            x.Text    = "&nbsp;" + c.ToString() + "&nbsp;";
            x.Visible = true;
            x.Enabled = true;
            x.Attributes.Add("href", currentPage + queryStringPreesistente + "parPage=" + c.ToString());//   parametro_Get per specificare la redirect_Page
            //
            if (paginaDesiderata == c)
            {
                x.ForeColor = System.Drawing.Color.Yellow;
                System.Web.UI.WebControls.Unit selectedPage_fontSize = x.Font.Size.Unit;
                x.Font.Size = new FontUnit(/*selectedPage_fontSize.Value + */ 24.0);
                x.Font.Bold = true;
            }
            //
            pnlPageNumber.Controls.Add(x);
        }// end loop of addition of dynamic link buttons
        System.Web.UI.WebControls.Label y = new System.Web.UI.WebControls.Label();
        y.Text = " (totale " + pagineDisponibili.ToString() + " pagine)";
        pnlPageNumber.Controls.Add(y);
        //-----------------------------------------END dynamic html-------------------------------------
        //
        dt = // out par------------------------------
             this.GetChunk(
            Session
            , paginaDesiderata
            );
    }// end PageIndexManager
Esempio n. 41
0
 protected void PagerWork(int PageSize, System.Web.UI.WebControls.PagerMode pager, System.Drawing.Color BackColor, System.Drawing.Color BorderColor, System.Web.UI.WebControls.Unit BorderWidth, string MyClass, System.Web.UI.WebControls.Unit Height, System.Web.UI.WebControls.HorizontalAlign HorizontalAlign, string NextPageText, int PageButtonCount, System.Web.UI.WebControls.PagerPosition PagerPosition, string PrevPageText, System.Web.UI.WebControls.VerticalAlign VerticalAlign, bool Visible, bool Wrap)
 {
     MyDataGrid.PageSize                   = PageSize;
     MyDataGrid.PagerStyle.Mode            = pager;
     MyDataGrid.PagerStyle.BackColor       = BackColor;
     MyDataGrid.PagerStyle.BorderColor     = BorderColor;
     MyDataGrid.PagerStyle.BorderWidth     = BorderWidth;
     MyDataGrid.PagerStyle.CssClass        = MyClass;
     MyDataGrid.PagerStyle.Height          = Height;
     MyDataGrid.PagerStyle.HorizontalAlign = HorizontalAlign;
     MyDataGrid.PagerStyle.NextPageText    = NextPageText;
     MyDataGrid.PagerStyle.PageButtonCount = PageButtonCount;
     MyDataGrid.PagerStyle.Position        = PagerPosition;
     MyDataGrid.PagerStyle.PrevPageText    = PrevPageText;
     MyDataGrid.PagerStyle.VerticalAlign   = VerticalAlign;
     MyDataGrid.PagerStyle.Visible         = Visible;
     MyDataGrid.PagerStyle.Wrap            = Wrap;
 }
Esempio n. 42
0
 public static void InitGeneralTableLayout(System.Web.UI.WebControls.TableItemStyle TableItemStyle, System.Drawing.Color ForeColor, System.Drawing.Color BackColor, System.Drawing.Color BorderColor, System.Web.UI.WebControls.BorderStyle BorderStyle, System.Web.UI.WebControls.Unit BorderWidth, string MyCsClass, System.Web.UI.WebControls.HorizontalAlign HorizontalAlign, System.Web.UI.WebControls.VerticalAlign VerticalAlign, System.Web.UI.WebControls.Unit Width, System.Web.UI.WebControls.Unit Height)
 {
     TableItemStyle.BackColor       = BackColor;
     TableItemStyle.BorderColor     = BorderColor;
     TableItemStyle.BorderStyle     = BorderStyle;
     TableItemStyle.BorderWidth     = BorderWidth;
     TableItemStyle.CssClass        = MyCsClass;
     TableItemStyle.HorizontalAlign = HorizontalAlign;
     TableItemStyle.VerticalAlign   = VerticalAlign;
     TableItemStyle.ForeColor       = ForeColor;
     TableItemStyle.Width           = Width;
     TableItemStyle.Height          = Height;
 }
Esempio n. 43
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 public BackgroundPosition(System.Web.UI.WebControls.Unit x, System.Web.UI.WebControls.Unit y)
 {
     _X = x;
     _Y = y;
 }