Inheritance: Control, System.ComponentModel.IComponent, System.IDisposable, IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject, IOleWindow, IViewObject, IViewObject2, IPersist, IPersistStreamInit, IPersistPropertyBag, IPersistStorage, IQuickActivate, ISupportOleDropSource, IDropTarget, System.ComponentModel.ISynchronizeInvoke, IWin32Window, System.Windows.Forms.Layout.IArrangedElement, IBindableComponent
示例#1
0
        public kitDebug(string name)
            : base(name)
        {
            enabled = true;

            base.BackColor = Color.Transparent;

            tmrUpdate = new Timer("tmrUpdate");
            tmrUpdate.Interval = 500;
            tmrUpdate.Elapsed += new EventHandler(tmrUpdate_Elapsed);

            lblFps = new Label("lblFps");
            lblFps.Location = new Point(0, 0);
            lblFps.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            lblFps.Text = "FPS";
            lblFps.AutoSize = true;

            btnTest = new Button("btnTest");
            btnTest.Location = new Point(0, 40);
            btnTest.Size = new Size(40, 20);
            btnTest.Text = "Test!";
            Skins.SkinManager.LoadButtonGui(btnTest);
            btnTest.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTest_Click);

            this.AddWidget(tmrUpdate);
            this.AddWidget(lblFps);
            this.AddWidget(btnTest);
        }
    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        //extract the date being rendered
        DateTime renderedDay = e.Day.Date;

        //check to see if the day and the month of the renderedDay maatch my birthday
        if (e.Day.Date.Month == 3 && e.Day.Date.Day == 28) {
            //instantiate a new label
            Label l = new Label();
            //set the text of the label
            l.Text = "<br />Happy Birthday Travis!";
            //Happy birthday to me!
            e.Cell.Controls.Add(l);
        }

        //check to see if the day and the month of the renderedDay maatch my birthday
        if (e.Day.Date.Month == 1 && e.Day.Date.Day == 25) {
            //instantiate a new label
            Label l = new Label();
            //set the text of the label
            l.Text = "<br />Happy Birthday Andrew!";
            //Happy birthday to me!
            e.Cell.Controls.Add(l);
        }
    }
示例#3
0
	public ElectrocuteAction(RobotController controller, List<Goal> goals, Label target)
		: base(controller, goals, target.labelHandle) {
		this.name = "electrocute";
		this.target = target;
		requiredComponents = new System.Type[] { };

	}
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PowerGrid"/> class.
 /// </summary>
 public PowerGrid()
 {
     lblFooter = new Label();
     PagerStyle.Mode = PagerMode.NumericPages;
     PagerStyle.BackColor = Color.Gainsboro;
     PagerStyle.PageButtonCount = 10;
     PagerStyle.HorizontalAlign = HorizontalAlign.Center;
     FooterStyle.BackColor = Color.Gainsboro;
     FooterStyle.HorizontalAlign = HorizontalAlign.Center;
     ShowFooter = true;
     AutoGenerateColumns = false;
     AllowPaging = true;
     PageSize = 7;
     CellSpacing = 2;
     CellPadding = 2;
     GridLines = GridLines.None;
     BorderColor = Color.Black;
     BorderStyle = BorderStyle.Solid;
     BorderWidth = 1;
     ForeColor = Color.Black;
     Font.Size = FontUnit.XXSmall;
     Font.Name = "Verdana";
     ItemStyle.BackColor = Color.Beige;
     AlternatingItemStyle.BackColor = Color.PaleGoldenrod;
     HeaderStyle.Font.Bold = true;
     HeaderStyle.BackColor = Color.Brown;
     HeaderStyle.ForeColor = Color.White;
     HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
     AllowSorting = true;
     Attributes["SortedAscending"] = "yes";
     ItemCreated += new DataGridItemEventHandler(OnItemCreated);
     SortCommand += new DataGridSortCommandEventHandler(OnSortCommand);
     PageIndexChanged += new DataGridPageChangedEventHandler(OnPageIndexChanged);
 }
示例#5
0
    protected void gvStates_DataBound(object sender, EventArgs e)
    {
        for (int i = 0; i < gvStates.Rows.Count; i++)
        {
            // Copy id from 5th column to invisible label in last column
            Label id = new Label();
            id.Visible = false;
            id.Text = gvStates.Rows[i].Cells[4].Text;
            gvStates.Rows[i].Cells[4].Controls.Add(id);

            GridViewRow row = gvStates.Rows[i];

            // Set unique text box ID
            TextBox txtValue = ControlsHelper.GetChildControl(row, typeof(TextBox), "txtTaxValue") as TextBox;
            txtValue.ID = "txtTaxValue" + id.Text;

            // Set unique check box ID
            CheckBox chkIsFlat = ControlsHelper.GetChildControl(row, typeof(CheckBox), "chkIsFlatValue") as CheckBox;
            chkIsFlat.ID = "chkIsFlatValue" + id.Text;

            Label lblCurrency = ControlsHelper.GetChildControl(row, typeof(Label), "lblCurrency") as Label;
            if (lblCurrency != null)
            {
                chkIsFlat.InputAttributes["onclick"] = "switchCurrency(this.checked, '" + lblCurrency.ClientID + "')";
                chkIsFlat.InputAttributes["onchange"] = "switchCurrency(this.checked, '" + lblCurrency.ClientID + "')";
            }
        }
    }
示例#6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["cadidate"] == null)
     {
         Response.Redirect("ConfirmPage.aspx");
     }
     else
     {
         Dictionary<long, int> mar = (Dictionary<long, int>)Session["result"];
         int m = 0;
         foreach (KeyValuePair<long, int> item in mar)
         {
             m += item.Value;
         }
         long userid = Convert.ToInt64(Session["cadidate"]);
         var ghhgh = OnlineExamHelper.Context.sp_OnlineResultNewInsertCommand(m, userid);
         foreach (var aa in ghhgh)
         {
             foreach (KeyValuePair<long, int> item in mar)
             {
                 Label lbl = new Label();
                 int mark = item.Value;
                 long fk_category = item.Key;
                 OnlineExamHelper.Context.sp_OnlineResultMarksNewInsertCommand(mark, aa.ResultId, fk_category);
                 lbl.Text = OnlineExamHelper.Context.OnlineCategories.Single(a => a.CategoryId == item.Key).Category + " : " + item.Value.ToString() + "<br>";
                 //Page.Controls.Add(lbl);
                 PlaceHolder1.Controls.Add(lbl);
             }
         }
        // Session["accept"] = string.Empty;
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label l2 = new Label();
            Label1.Text = "";
            l2.Text = DateTime.Now.ToString();
             SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
             conn.Open();
             if (TextBox1.Text == null || TextBox1.Text == "") { Response.Write("Please share your thoughts"); }
             else
             {
            string insert = "INSERT INTO [uptext] (Dateandtime,blogdata) VALUES (@date,@blog)";
             SqlCommand comm = new SqlCommand(insert, conn);
             comm.Parameters.AddWithValue("@date", l2.Text);
             comm.Parameters.AddWithValue("@blog", TextBox1.Text);
             comm.ExecuteNonQuery();
             }
             string output = "SELECT * FROM [uptext] ";
             SqlCommand comm2 = new SqlCommand(output, conn);
             SqlDataReader datareader = comm2.ExecuteReader();
             while(datareader.Read())
             {
                 Label1.Text += datareader["Dateandtime"].ToString() + "<br />" + "<br />";
                 Label1.Text += datareader["blogdata"].ToString() + "<br /> " + "<br />";
             }

             datareader.Close();
             conn.Close();
    }
示例#8
0
 private void DeleteEvent(object sender, Label labelInfo)
 {
     if(OnDelete!= null)
     {
         OnDelete(sender, new LabelEventArg(labelInfo));
     }
 }
示例#9
0
 private void AddEvent(object sender, Label label)
 {
     if (OnAdd != null)
     {
         OnAdd(sender, new LabelEventArg(label));
     }
 }
    public void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridCommandItem)
        {
            GridCommandItem commandItem = (e.Item as GridCommandItem);
            PlaceHolder container = (PlaceHolder)commandItem.FindControl("PlaceHolder1");
            Label label = new Label();
            label.Text = "&nbsp;&nbsp;";

            container.Controls.Add(label);

            for (int i = 65; i <= 65 + 25; i++)
            {
                LinkButton linkButton1 = new LinkButton();

                LiteralControl lc = new LiteralControl("&nbsp;&nbsp;");

                linkButton1.Text = "" + (char)i;

                linkButton1.CommandName = "alpha";
                linkButton1.CommandArgument = "" + (char)i;

                container.Controls.Add(linkButton1);
                container.Controls.Add(lc);
            }

            LiteralControl lcLast = new LiteralControl("&nbsp;");
            container.Controls.Add(lcLast);

            LinkButton linkButtonAll = new LinkButton();
            linkButtonAll.Text = "Tất cả";
            linkButtonAll.CommandName = "NoFilter";
            container.Controls.Add(linkButtonAll);
        }
    }
        private void CreateControls(Node node)
        {
            foreach(Node idx in node)
            {
                string caption = idx["Caption"].Get<string>();
                string value = idx["Value"].Get<string>();
                string type = idx["Type"].Get<string>();
                int position = idx["Position"].Get<int>();

                Panel pnl = new Panel();
                pnl.CssClass = "bordered-panel";

                Label cpt = new Label();
                cpt.CssClass = "label-caption";
                cpt.Text = caption;
                pnl.Controls.Add(cpt);

                Label val = new Label();
                val.CssClass = "label-value";
                val.Text = value;
                pnl.Controls.Add(val);

                // Rooting...
                wrpPnl.Controls.Add(pnl);
            }
        }
示例#12
0
    //protected void chkFullance_CheckedChanged(object sender, EventArgs e)
    //{
    //    if (chkFullance.Checked)
    //    {
    //        foreach (GridViewRow gvr in dgrid.Rows)
    //        {
    //            Label lblStudID = new Label();
    //            lblStudID = (Label)gvr.Cells[0].FindControl("lblStaffID");
    //            DataSet ds1 = new DataSet();
    //            int month = Convert.ToInt32(ddlMonth.Items[ddlMonth.SelectedIndex].Value);
    //            int year = Convert.ToInt32(ddlYear.Items[ddlYear.SelectedIndex].Value);
    //            int noofWorkingdays = Convert.ToInt32(txtnoofworkingdays.Text);
    //            TextBox txtNoOfDaysPresents = new TextBox();
    //            txtNoOfDaysPresents = (TextBox)gvr.Cells[2].FindControl("txtDaysPresent");
    //            int leavedays;
    //            ds1 = objStaff.GetStaffAttendanceByLeaves(Convert.ToInt32(lblStudID.Text), month, year);
    //            leavedays =Convert.ToInt32(ds1.Tables[0].Rows[0][2].ToString());
    //            txtNoOfDaysPresents.Text = Convert.ToString((noofWorkingdays - leavedays));
    //        }
    //    }
    //    if (chkFullance.Checked==false)
    //    {
    //        foreach (GridViewRow gvr in dgrid.Rows)
    //        {
    //            TextBox txtNoOfDaysPresents = new TextBox();
    //            TextBox txtnoofworkingdays = new TextBox();
    //            txtNoOfDaysPresents = (TextBox)gvr.Cells[2].FindControl("txtDaysPresent");
    //            txtNoOfDaysPresents.Text = txtnoofworkingdays.Text;
    //        }
    //    }
    //}
    protected void btnAttendance_Click(object sender, EventArgs e)
    {
        foreach (GridViewRow gvr in dgrid.Rows)
        {
            Label lblStudID = new Label();
            lblStudID = (Label)gvr.Cells[0].FindControl("lblStaffID");
            DataSet ds1 = new DataSet();
            int month = Convert.ToInt32(ddlMonth.Items[ddlMonth.SelectedIndex].Value);
            int year = Convert.ToInt32(ddlYear.Items[ddlYear.SelectedIndex].Value);
            int noofWorkingdays = Convert.ToInt32(txtnoofworkingdays.Text);
            TextBox txtNoOfDaysPresents = new TextBox();
            txtNoOfDaysPresents = (TextBox)gvr.Cells[2].FindControl("txtDaysPresent");
            int leavedays;
            ds1 = objStaff.GetStaffAttendanceByLeaves(Convert.ToInt32(lblStudID.Text), month, year);
            if (ds1.Tables.Count > 0)
            {
                if (ds1.Tables[0].Rows.Count > 0)
                {
                    leavedays = Convert.ToInt32(ds1.Tables[0].Rows[0][2].ToString());
                    txtNoOfDaysPresents.Text = Convert.ToString((noofWorkingdays - leavedays));
                }
                else
                {
                    txtNoOfDaysPresents.Text = txtnoofworkingdays.Text;
                }
            }
            txtNoOfDaysPresents.Enabled = false;

        }
    }
 private void UpdateLabel(Label lbl)
 {
     //为了模拟大数据量的处理延迟,这里调用Sleep方法将时间延迟三秒
     System.Threading.Thread.Sleep(10000);
     //更新服务器端时间
     lbl.Text = DateTime.Now.ToString();
 }
示例#14
0
        public StatLabel(string name)
            : base(name)
        {
            base.BackColor = Color.Transparent;

            lblAtk = new Label("lblAtk");
            lblAtk.BackColor = Color.Transparent;
            lblAtk.ForeColor = Color.WhiteSmoke;
            lblAtk.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            lblAtk.Location = new Point(5, 5);
            lblAtk.AutoSize = true;
            lblAtk.Text = "Atk";

            lblDef = new Label("lblDef");
            lblDef.BackColor = Color.Transparent;
            lblDef.ForeColor = Color.WhiteSmoke;
            lblDef.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            lblDef.Location = new Point(lblAtk.X + lblAtk.Width + 5, 5);
            lblDef.AutoSize = true;
            lblDef.Text = "Def";

            lblSpd = new Label("lblSpd");
            lblSpd.BackColor = Color.Transparent;
            lblSpd.ForeColor = Color.WhiteSmoke;
            lblSpd.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            lblSpd.Location = new Point(lblDef.X + lblDef.Width + 5, 5);
            lblSpd.AutoSize = true;
            lblSpd.Text = "Spd";

            lblSpclAtk = new Label("lblSpclAtk");
            lblSpclAtk.BackColor = Color.Transparent;
            lblSpclAtk.ForeColor = Color.WhiteSmoke;
            lblSpclAtk.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            lblSpclAtk.Location = new Point(lblSpd.X + lblSpd.Width + 5, 5);
            lblSpclAtk.AutoSize = true;
            lblSpclAtk.Text = "Sp. Atk";

            lblSpclDef = new Label("lblSpclDef");
            lblSpclDef.BackColor = Color.Transparent;
            lblSpclDef.ForeColor = Color.WhiteSmoke;
            lblSpclDef.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            lblSpclDef.Location = new Point(lblSpclAtk.X + lblSpclAtk.Width + 5, 5);
            lblSpclDef.AutoSize = true;
            lblSpclDef.Text = "Sp. Def";

            lblStats = new Label("lblStats");
            lblStats.BackColor = Color.Transparent;
            lblStats.ForeColor = Color.WhiteSmoke;
            lblStats.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12);
            lblStats.Location = new Point(5, 5);
            lblStats.AutoSize = true;
            lblStats.Text = "Stats";

            this.AddWidget(lblStats);
               // this.AddWidget(lblAtk);
            //this.AddWidget(lblDef);
            //this.AddWidget(lblSpd);
            //this.AddWidget(lblSpclAtk);
            //this.AddWidget(lblSpclDef);
        }
示例#15
0
    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        if (e.Day.IsWeekend)
        {
            //IsSelectable布尔属性控制日期是否可被选择
            e.Day.IsSelectable = false;
        }
        if (e.Day.IsOtherMonth)
        {
            //e.Cell属性代表一个日期框
            e.Cell.Text = "-";
        }

        //检查日期是否为3月5号。
        if (e.Day.Date.Day == 5 && e.Day.Date.Month == 3)
        {
            e.Cell.BackColor = System.Drawing.Color.Yellow;
            //向该列添加静态文本
            Label lbl = new Label();
            lbl.Text = "<br />学习雷锋好榜样!";
            e.Cell.Controls.Add(lbl);
        }
        Calendar1.SelectedDate = DateTime.Now.AddDays(2).Date;
        //下面的代码将使用SelectedDates选中2008年3月的每个星期天
        SelectedDatesCollection theDates = Calendar1.SelectedDates;
        theDates.Clear();
        theDates.Add(new DateTime(2008, 3, 2));
        theDates.Add(new DateTime(2008, 3, 9));
        theDates.Add(new DateTime(2008, 3, 16));
        theDates.Add(new DateTime(2008, 3, 23));
    }
        private LabelSet GetReferenceSet()
        {
            var labelSet = new LabelSet();

            var label0 = new Label(0, "nada");
            var label1 = new Label(1, "casi nada");
            var label2 = new Label(2, "muy poco");
            var label3 = new Label(3, "poco");
            var label4 = new Label(4, "medio");
            var label5 = new Label(5, "algo");
            var label6 = new Label(6, "mucho");
            var label7 = new Label(7, "casi todo");
            var label8 = new Label(8, "todo");
            labelSet.Add(label0);
            labelSet.Add(label1);
            labelSet.Add(label2);
            labelSet.Add(label3);
            labelSet.Add(label4);
            labelSet.Add(label5);
            labelSet.Add(label6);
            labelSet.Add(label7);
            labelSet.Add(label8);

            return labelSet;
        }
        public FacebookLoginPage(FacebookConnection connection)
        {
            this.Title = "FacebookLoginPage";

         //   Connection = new FacebookConnection(key, secret, scope);
         //   connection.SignInCompleted += Connection_SignInCompleted;
            
            this._Connection = connection;

            this._Browser = new WebView();
			//_Browser.Source = new UrlWebViewSource() { Url = _Connection.LoginUri().AbsoluteUri };
            this._Connection.SignIn(this._Browser);

			Label lbl = new Label ()
			{ Text = "Connecting..." };
			lbl.SetBinding(Label.IsVisibleProperty, "IsVisible", BindingMode.OneWay, new BooleanInverterConverter());
            lbl.BindingContext = this._Browser;

            this._BaseLayout = new StackLayout()
            {
				Orientation = StackOrientation.Vertical,
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
			};

            this._BaseLayout.Children.Add(lbl);
            this._BaseLayout.Children.Add(this._Browser);

            this._Browser.IsVisible = false;
                        	

            Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);  // Accomodate iPhone status bar.
            Content = this._BaseLayout;
        }
示例#18
0
文件: MainForm.cs 项目: mono/gert
	public MainForm ()
	{
		// 
		// _label2
		// 
		_label2 = new Label ();
		_label2.Text = "2";
		_label2.Dock = DockStyle.Bottom;
		Controls.Add (_label2);
		// 
		// _label1
		// 
		_label1 = new Label ();
		_label1.Text = "1";
		_label1.Dock = DockStyle.Top;
		Controls.Add (_label1);
		// 
		// MainForm
		// 
		ClientSize = new Size (ClientSize.Width, _label1.Height);
		Location = new Point (200, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #80792";
		Load += new EventHandler (MainForm_Load);
	}
        public SimplestKeypad()
        {
            // Create a Vertical stack for the entire keypad.
            var mainStack = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };

            // First row is the Label.
            displayLabel = new Label
            {
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                VerticalOptions = LayoutOptions.Center,
                XAlign = TextAlignment.End
            };

            mainStack.Children.Add(displayLabel);

            //Second row is the backspace Button.
            backspaceButton = new Button
            {
                Text = "\u21E6",
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof (Button)),
                IsEnabled = false
            };
            backspaceButton.Clicked += OnBackSpaceButtonClicked;
            mainStack.Children.Add(backspaceButton);

            // Now do the 10 number keys.
            StackLayout rowStack = null;
            for (var num = 1; num <= 10; num++)
            {
                if ((num - 1)%3 == 0)
                {
                    rowStack = new StackLayout
                    {
                        Orientation = StackOrientation.Horizontal
                    };
                    mainStack.Children.Add(rowStack);
                }

                var digitButton = new Button
                {
                    Text = (num % 10).ToString(),
                    FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Button)),
                    StyleId = (num % 10).ToString()
                };
                digitButton.Clicked += OnDigitButtonClicked;

                //For the zero button, expand to fill horizontally.
                if (num == 10)
                {
                    digitButton.HorizontalOptions = LayoutOptions.FillAndExpand;
                }
                rowStack.Children.Add(digitButton);
            }

            this.Content = mainStack;
        }
示例#20
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Application.Init ();

            this.Resize(640,480);
            //menu bar very top
            MenuBar mb = new MenuBar ();
            Menu fileMenu = new Menu ();
            MenuItem menuItem = new MenuItem ("_File");
            menuItem.Submenu = fileMenu;
            mb.Append(menuItem);
            MenuItem menuFileQuit = new MenuItem("Quit");
            fileMenu.Append(menuFileQuit);
            vboxMain.PackStart(mb,false,false,0);

            //toolbar
            Toolbar tbTop = new Toolbar ();
            //toolbutton Staff
            ToolButton tbStaff = new ToolButton (Gtk.Stock.OrientationPortrait);
            tbStaff.Label="Staff";
            tbStaff.IsImportant=true;
            tbStaff.Clicked += HandleTbStaffClicked;
            tbTop.Insert(tbStaff,0);
            //toolbutton Clients
            ToolButton tbClients = new ToolButton (Gtk.Stock.About);
            tbClients.Label="Clients";
            tbClients.IsImportant=true;
            tbClients.Clicked+= HandleTbClientsClicked;
            tbTop.Insert(tbClients,1);
            //media bar
            Label lbMediaTemp = new Label ();
            lbMediaTemp.Text="Media holder";
            lbMediaTemp.Show();
            //pack the toolbar and media bar in the top hbox//
            hbTop.PackStart(tbTop);
            hbTop.PackStart(lbMediaTemp);
            //pack the top hbox in the main vbox
            vboxMain.PackStart(hbTop,false,false,1);
            // horizontal pane
            verticalPane.Position=200;
            verticalPane.Pack1(scrollWindowLeft,false,false);
            verticalPane.Pack2(scrollWindowRight,false,false);
            vboxMain.PackStart(verticalPane);
            scrollWindowLeft.Add(viewPortLeft);

            scrollWindowRight.Add(viewPortRight);
            Label lbMain = new Label ();
            lbMain.Text= "main";
            viewPortRight.Add(lbMain);
            verticalPane.ShowAll();
            //status bar very bottom
            Statusbar sb = new Statusbar ();
            vboxMain.PackStart(sb,false,false,1);

            this.Add(vboxMain);
            //hb1.Add(tbTop);
            this.ShowAll ();
        Build ();
    }
示例#21
0
 void NotificationManager_OnNotification(Dictionary<string, string> parameters)
 {
     Label myLabel;
     myLabel = new Label("Notification received", Color.White, Color.Transparent);
     myLabel.Pivot = Vector2.One / 2;
     AddComponent(myLabel, Preferences.ViewportManager.MiddleCenterAnchor);
 }
示例#22
0
    public void IniciarComponentes()
    {
        lblSaludo = new Label();
        btSaludo = new Button();
        ttToolTip1 = new ToolTip();

        lblSaludo.Name = "lblSaludo";
        lblSaludo.Text = "Label";
        lblSaludo.Font = new Font("Microsoft Sans Serif", 14, FontStyle.Regular);
        lblSaludo.TextAlign = ContentAlignment.MiddleCenter;
        lblSaludo.Location = new Point(53, 48);
        lblSaludo.Size = new Size(187, 35);
        lblSaludo.TabIndex = 1;

        btSaludo.Name = "btSaludo";
        btSaludo.Text = "Haga &clic aquí";
        btSaludo.Location = new Point(53, 90);
        btSaludo.Size = new Size(187, 23);
        btSaludo.TabIndex = 0;
        ttToolTip1.SetToolTip(btSaludo, "Botón de pulsación");

        ClientSize = new Size(292, 191);
        Name = "Form1";
        Text = "Saludo";

        Controls.Add(lblSaludo);
        Controls.Add(btSaludo);
    }
 public void report_count_rows(Label ip_lbl, int ip_i_row_cout, string ip_str_default_message)
 {
     string ip_str_sum_row = "";
     ip_str_sum_row += ip_str_default_message + " (Có ";
     ip_str_sum_row += ip_i_row_cout + " bản ghi)";
     ip_lbl.Text = ip_str_sum_row;
 }
示例#24
0
		public async Task TestNavigationImplPop ()
		{
			NavigationPage nav = new NavigationPage ();
			
			Label child = new Label ();
			Page childRoot = new ContentPage {Content = child};

			Label child2 = new Label ();
			Page childRoot2 = new ContentPage {Content = child2};
			
			await nav.Navigation.PushAsync (childRoot);
			await nav.Navigation.PushAsync (childRoot2);

			bool fired = false;
			nav.Popped += (sender, e) => fired = true;
			var popped = await nav.Navigation.PopAsync ();

			Assert.True (fired);
			Assert.AreSame (childRoot, nav.CurrentPage);
			Assert.AreEqual (childRoot2, popped);

			await nav.PopAsync ();
			var last = await nav.Navigation.PopAsync ();

			Assert.IsNull (last);
		}
示例#25
0
    /// <summary>
    /// DataList控件绑定及分页
    /// </summary>
    /// <param name="intCount">每页显示的记录条数</param>
    /// <param name="ds">DataSet数据集</param>
    /// <param name="labPage">当前页码</param>
    /// <param name="labTPage">总页码</param>
    /// <param name="lbtnUp">上一页</param>
    /// <param name="lbtnNext">下一页</param>
    /// <param name="lbtnBack">最后一页</param>
    /// <param name="lbtnOne">第一页</param>
    /// <param name="dl">DataList控件对象</param>
    public static void dlBind(int intCount, DataSet ds, Label labPage, Label labTPage, LinkButton lbtnUp, LinkButton lbtnNext, LinkButton lbtnBack, LinkButton lbtnOne, Repeater dl)
    {
        int curpage = Convert.ToInt32(labPage.Text);
        PagedDataSource ps = new PagedDataSource();
        ps.DataSource = ds.Tables[0].DefaultView;
        ps.AllowPaging = true; //是否可以分页
        ps.PageSize = intCount; //显示的数量
        ps.CurrentPageIndex = curpage - 1; //取得当前页的页码

        lbtnNext.Visible = true;
        lbtnOne.Visible = true;
        lbtnBack.Visible = true;
        lbtnUp.Visible = true;

        lbtnNext.Enabled = true;
        lbtnBack.Enabled = true;
        lbtnOne.Enabled = true;
        if (curpage == 1)
        {
            lbtnOne.Visible = false;//不显示第一页按钮
            lbtnUp.Visible = false;//不显示上一页按钮
        }
        if (curpage == ps.PageCount)
        {
            lbtnNext.Visible = false;//不显示下一页
            lbtnBack.Visible = false;//不显示最后一页
        }
        labTPage.Text = Convert.ToString(ps.PageCount);
        dl.DataSource = ps;
           // dl.DataKeyField = "ID";
        dl.DataBind();
    }
示例#26
0
        protected override void Init()
        {
            var label = new Label { Text = "Label" };
            var entry = new Entry { AutomationId = "entry" };
            var grid = new Grid();

            grid.Children.Add(label, 0, 0);
            grid.Children.Add(entry, 1, 0);
            var tableView = new TableView
            {
                Root = new TableRoot
                {
                    new TableSection
                    {
                        new ViewCell
                        {
                            View = grid
                        }
                    }
                }
            };

            Content = new StackLayout
            {
                Children = { tableView }
            };
        }
示例#27
0
		protected override void Init ()
		{
			var entry = new Entry {
				Text = "Setec Astronomy",
				FontFamily = "Comic Sans MS",
				HorizontalTextAlignment = TextAlignment.Center,
				Keyboard = Keyboard.Chat
			};

			var label = new Label ();
			var binding = new Binding ("Text") { Source = entry };

			var otherEntry = new Entry ();
			var otherBinding = new Binding ("Text") { Source = entry, Mode = BindingMode.TwoWay };
			otherEntry.SetBinding (Entry.TextProperty, otherBinding);

			label.SetBinding (Label.TextProperty, binding);

			var explanation = new Label() {Text = @"The Text value of the entry at the top should appear in the label and entry below, regardless of whether 'IsPassword' is on. 
Changes to the value in the entry below should be reflected in the entry at the top."};

			var button = new Button { Text = "Toggle IsPassword" };
			button.Clicked += (sender, args) => { entry.IsPassword = !entry.IsPassword; };

			Content = new StackLayout {
				Children = { entry, button, explanation, label, otherEntry }
			};
		}
示例#28
0
 public FunctionEntry(Level level, Label label, Types.RECORD formals, Types.Type result)
 {
     Level = level;
     Label = label;
     Formals = formals;
     Result = result;
 }
示例#29
0
    protected void btn_SearchUsernames_OnClick(object sender, EventArgs e)
    {
        int uID;
        bool result = Int32.TryParse(Request.QueryString["userID"].ToString(), out uID);
        DataTable DT = theCake.searchUsersByUserName(txt_usernameSearch.Text.Trim());

        if (DT.Rows.Count == 0) // No results found
        {
            TableRow TR0 = new TableRow();
            TableCell TC0 = new TableCell();
            Label no_res = new Label();
            no_res.Text = "No matches were found.";
            TC0.Controls.Add(no_res);
            TR0.Cells.Add(TC0);
            tbl_searchResults.Rows.Add(TR0);
        }

        if (DT.Rows.Count >= 1) // Results found
        {
            foreach (DataRow DR in DT.Rows)
            {
                TableRow TR1 = new TableRow();
                TableCell TC1 = new TableCell();
                Label username_res = new Label();
                username_res.Text = "<a href=\"UserProfile.aspx?userID=" + DR["ID"].ToString() + "\">" + DR["ownerAlias"].ToString() + "</a>";
                TC1.Controls.Add(username_res);
                TR1.Cells.Add(TC1);
                tbl_searchResults.Rows.Add(TR1);
            }
        }
    }
示例#30
0
    public HelloWindow () {
      border = 2;

      label1 = new Label();
      label1.Text = catalog.GetString("Hello, world!");
      label1.ClientSize = new Size(label1.PreferredWidth, label1.PreferredHeight);
      Controls.Add(label1);

      label2 = new Label();
      label2.Text =
        String.Format(
            catalog.GetString("This program is running as process number {0}."),
            Process.GetCurrentProcess().Id);
      label2.ClientSize = new Size(label2.PreferredWidth, label2.PreferredHeight);
      Controls.Add(label2);

      ok = new Button();
      Label okLabel = new Label();
      ok.Text = okLabel.Text = "OK";
      ok.ClientSize = new Size(okLabel.PreferredWidth + 12, okLabel.PreferredHeight + 4);
      ok.Click += new EventHandler(Quit);
      Controls.Add(ok);

      Size total = ComputePreferredSizeWithoutBorder();
      LayoutControls(total.Width, total.Height);
      ClientSize = new Size(border + total.Width + border, border + total.Height + border);
    }
        public static Thread loadAssesmblyDataIntoTreeView(Assembly aAssemblyToLoad, TreeView tvTargetTreeView,
                                                           Label lbLastMethodExecuted, bool bOnlyShowStaticMethods)
        {
            tvTargetTreeView.Visible = false;
            tvTargetTreeView.Nodes.Clear();
            tvTargetTreeView.Sorted = true;
            int iTypesAdded = 0;

            return(O2Thread.mtaThread(() =>
            {
                try
                {
                    var treeNodesToAdd = new List <TreeNode>();
                    foreach (Type tType in aAssemblyToLoad.GetTypes())
                    {
                        if ((iTypesAdded++) % 500 == 0)
                        {
                            PublicDI.log.info("{0} types processed", iTypesAdded);
                        }
                        //vars.set_(tType.Name, tType); // set global variable of compiled code
                        //Callbacks.raiseEvent_ScriptCompiledSuccessfully(tType.Name);
                        TreeNode tnType = O2Forms.newTreeNode(tType.Name, tType.Name, 1, tType);
                        foreach (
                            MethodInfo mMethod in
                            tType.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly |
                                             ((bOnlyShowStaticMethods) ? BindingFlags.Static : BindingFlags.Static | BindingFlags.Instance)))
                        {
                            if (mMethod.Name == lbLastMethodExecuted.Text)
                            {
                                lbLastMethodExecuted.Tag = mMethod;
                            }
                            //TreeNode tnMethod = O2Forms.newTreeNode(mMethod.Name, mMethod.Name, 2, mMethod);
                            TreeNode tnMethod =
                                O2Forms.newTreeNode(
                                    new FilteredSignature(mMethod).getReflectorView(),
                                    mMethod.Name, 2, mMethod);
                            tnType.Nodes.Add(tnMethod);
                        }
                        if (tnType.Nodes.Count > 0)
                        {
                            treeNodesToAdd.Add(tnType);
                        }
                        //O2Forms.addNodeToTreeNodeCollection(tvTargetTreeView, tvTargetTreeView.Nodes, tnType);      // thread safe way to add nodes
                    }
                    PublicDI.log.info("{0} types processed , now loading them into treeView", iTypesAdded);
                    tvTargetTreeView.invokeOnThread(() =>
                    {
                        foreach (var treeNode in treeNodesToAdd)
                        {
                            tvTargetTreeView.Nodes.Add(treeNode);
                        }
                        PublicDI.log.info("All nodes loaded");
                        if (tvTargetTreeView.Nodes.Count > 0)
                        {
                            tvTargetTreeView.Nodes[0].Expand();
                        }
                        tvTargetTreeView.Visible = true;
                    });
                }
                catch (Exception ex)
                {
                    PublicDI.log.ex(ex, "in loadAssesmblyDataIntoTreeView");
                }
            }));


            //if (tvTargetTreeView.GetNodeCount(true) < 20)
            //    tvTargetTreeView.ExpandAll();
            //tvTargetTreeView.Visible = true;
        }
示例#32
0
    // Send
    protected void SendReport(object sender, EventArgs f)
    {
        // Format
        lbl_callstats1.ForeColor  = Color.Black;
        lbl_callstats2.ForeColor  = Color.Black;
        lbl_hourstext.ForeColor   = Color.Black;
        lbl_minstext.ForeColor    = Color.Black;
        lbl_hours.Visible         = true;
        lbl_hours.Text            = Server.HtmlEncode(dd_hours.SelectedItem.Text);
        lbl_mins.Visible          = true;
        lbl_mins.Text             = Server.HtmlEncode(dd_minutes.SelectedItem.Text);
        lbl_callstatsinfo.Visible = false;
        dd_hours.Visible          = false;
        dd_minutes.Visible        = false;
        btn_convert.Visible       = false;
        tb_dectime.Visible        = false;
        lbl_tb_callstats2.Text    = String.Empty;
        if (tb_callstats2.Text == String.Empty || tb_callstats2.Text == String.Empty)
        {
            lbl_tb_callstats2.Text = "0";
            tb_callstats2.Text     = "0";
        }
        else
        {
            lbl_tb_callstats2.Text = Server.HtmlEncode(tb_callstats2.Text);
        }

        lbl_tb_callstats2.Visible = true;
        tb_callstats2.Visible     = false;

        // Insert call stats

        // Get date
        String qry        = "SELECT StartDate FROM db_progressreporthead WHERE Office=@office ORDER BY StartDate DESC LIMIT 1";
        String start_date = SQL.SelectString(qry, "StartDate", "@office", tabstrip.SelectedTab.Text);

        if (start_date != String.Empty)
        {
            String iqry = "INSERT INTO db_callstats (Office, WeekStart, CallTime, CallStats) VALUES(@office, @week_start, @call_time, @call_stats)";
            SQL.Insert(iqry,
                       new String[] { "@office", "@week_start", "@call_time", "@call_stats" },
                       new Object[] {
                tabstrip.SelectedTab.Text,
                start_date,
                ((Convert.ToInt32(dd_hours.SelectedItem.Text) * 60) + Convert.ToInt32(dd_minutes.SelectedItem.Text)),
                tb_callstats2.Text
            });
        }

        String tb_unp_approvals_orig = tb_unp_approvals.Text;
        String tb_unp_pr_lg_orig     = tb_unp_pr_lg.Text;
        String tb_unp_pr_s_orig      = tb_unp_pr_s.Text;
        String tb_unp_tr_orig        = tb_unp_tr.Text;

        tb_unp_approvals.Text = tb_unp_approvals.Text.Replace(Environment.NewLine, "--");
        tb_unp_pr_lg.Text     = tb_unp_pr_lg.Text.Replace(Environment.NewLine, "--");
        tb_unp_pr_s.Text      = tb_unp_pr_s.Text.Replace(Environment.NewLine, "--");
        tb_unp_tr.Text        = tb_unp_tr.Text.Replace(Environment.NewLine, "--");
        StringWriter   sw  = new StringWriter();
        HtmlTextWriter hw  = new HtmlTextWriter(sw);
        StringWriter   sw2 = new StringWriter();
        HtmlTextWriter hw2 = new HtmlTextWriter(sw2);
        Label          br  = new Label(); br.Text = "<br/>";

        tbl_gvs.RenderControl(hw2);
        gv.RenderControl(hw);
        br.RenderControl(hw);
        gv_sac.RenderControl(hw);
        br.RenderControl(hw);
        gv_lg.RenderControl(hw);
        br.RenderControl(hw);

        String gid1 = "img1" + r.Next();
        String gid2 = "img2" + r.Next();

        MailMessage mail = new MailMessage();

        if (Security.admin_receives_all_mails)
        {
            mail.Bcc.Add(Security.admin_email.Replace(";", String.Empty));
        }
        mail.To.Add("*****@*****.**");
        mail            = GetHoS(mail);
        mail.From       = new MailAddress("*****@*****.**");
        mail.Subject    = tabstrip.SelectedTab.Text + " 8-Week Report";
        mail.IsBodyHtml = true;
        AlternateView htmlView =
            AlternateView.CreateAlternateViewFromString(
                "<table style=\"font-family:Verdana; font-size:8pt;\" width=\"982\">" +
                "<tr>" +
                "<td colspan=\"2\">" +
                sw2.ToString().Replace("--", "<br/>")
                .Replace("SPA Underperformance Comments", "<b>SPA Underperformance Comments</b>")
                .Replace("Total Revenue Underperformance Comments", "<b>Total Revenue Underperformance Comments</b>")
                .Replace("List Gen Personal Revenue Underperformance Comments", "<b>List Gen Personal Revenue Underperformance Comments</b>")
                .Replace("Sales Personal Revenue Underperformance Comments", "<b>Sales Personal Revenue Underperformance Comments</b>") +
                "</td>" +
                "</tr>" +
                "<tr>" +
                "<td colspan=\"2\" align=\"left\">" +
                tb_comments.Text.Replace(Environment.NewLine, "<br/>") + "<br/>" +
                "</td>" +
                "</tr>" +
                "<tr>" +
                "<td valign=\"top\">" +
                "<img src=cid:" + gid1 + ">" +
                "</td> " +
                "<td valign=\"top\" align=\"left\">" +
                "<img src=cid:" + gid2 + ">" + "<br/><br/>" +
                "</td>" +
                "</tr>" +
                "<tr>" +
                "<td colspan=\"2\">" + sw.ToString() +
                "</td>" +
                "</tr>" +
                "</table>"
                , null, "text/html");

        Bitmap       rc_img1 = new Bitmap(rc_bar.GetBitmap());
        Bitmap       rc_img2 = new Bitmap(rc_line.GetBitmap());
        MemoryStream ms      = new MemoryStream();
        MemoryStream ms2     = new MemoryStream();

        rc_img1.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
        rc_img2.Save(ms2, System.Drawing.Imaging.ImageFormat.Png);
        ms.Seek(0, SeekOrigin.Begin);
        ms2.Seek(0, SeekOrigin.Begin);
        LinkedResource myImg1 = new LinkedResource(ms, "image/png");
        LinkedResource myImg2 = new LinkedResource(ms2, "image/png");

        myImg1.ContentId = gid1;
        myImg2.ContentId = gid2;
        htmlView.LinkedResources.Add(myImg1);
        htmlView.LinkedResources.Add(myImg2);
        mail.AlternateViews.Add(htmlView);
        SmtpClient smtp = new SmtpClient("smtp.gmail.com");

        smtp.EnableSsl = true;
        try
        {
            smtp.Send(mail);
            Util.WriteLogWithDetails("Sending " + tabstrip.SelectedTab.Text + " 8-Week Report.", "8weekreport_log");
            Util.PageMessage(this, "8-Week Report for " + tabstrip.SelectedTab.Text + " successfully sent!");
        }
        catch (Exception p)
        {
            Util.WriteLogWithDetails("An error occured sending 8-Week Report for " + tabstrip.SelectedTab.Text + Environment.NewLine +
                                     p.Message + Environment.NewLine + p.StackTrace, "8weekreport_log");
            Util.PageMessage(this, "An error occured sending 8-Week Report for " + tabstrip.SelectedTab.Text);
        }

        ms.Dispose();
        ms2.Dispose();

        tb_unp_approvals.Text     = tb_unp_approvals_orig;
        tb_unp_pr_lg.Text         = tb_unp_pr_lg_orig;
        tb_unp_pr_s.Text          = tb_unp_pr_s_orig;
        tb_unp_tr.Text            = tb_unp_tr_orig;
        lbl_callstats1.ForeColor  = Color.White;
        lbl_callstats2.ForeColor  = Color.White;
        lbl_hourstext.ForeColor   = Color.White;
        lbl_minstext.ForeColor    = Color.White;
        lbl_hours.Visible         = false;
        lbl_mins.Visible          = false;
        dd_hours.Visible          = true;
        dd_minutes.Visible        = true;
        lbl_callstatsinfo.Visible = true;
        lbl_tb_callstats2.Visible = false;
        tb_callstats2.Visible     = true;
        btn_convert.Visible       = true;
        tb_dectime.Visible        = true;
    }
示例#33
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            Label tahunLabel;
            Label namaBulanLabel;

            this.tahunSpinEdit = new DevExpress.XtraEditors.SpinEdit();
            this.comboBoxEdit1 = new DevExpress.XtraEditors.ComboBoxEdit();
            this.labaRugiBulananBindingSource = new BindingSource(this.components);
            this.autoFormat1 = new SentraWinFramework.AutoFormat(this.components);
            tahunLabel       = new Label();
            namaBulanLabel   = new Label();
            ((System.ComponentModel.ISupportInitialize)(this.tahunSpinEdit.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.labaRugiBulananBindingSource)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.autoFormat1)).BeginInit();
            this.SuspendLayout();
            //
            // tahunLabel
            //
            tahunLabel.AutoSize = true;
            tahunLabel.Location = new System.Drawing.Point(56, 15);
            tahunLabel.Name     = "tahunLabel";
            tahunLabel.Size     = new System.Drawing.Size(41, 13);
            tahunLabel.TabIndex = 1;
            tahunLabel.Text     = "Tahun:";
            //
            // namaBulanLabel
            //
            namaBulanLabel.AutoSize = true;
            namaBulanLabel.Location = new System.Drawing.Point(190, 15);
            namaBulanLabel.Name     = "namaBulanLabel";
            namaBulanLabel.Size     = new System.Drawing.Size(37, 13);
            namaBulanLabel.TabIndex = 2;
            namaBulanLabel.Text     = "Bulan:";
            //
            // tahunSpinEdit
            //
            this.tahunSpinEdit.DataBindings.Add(new Binding("EditValue", this.labaRugiBulananBindingSource, "Tahun", true));
            this.tahunSpinEdit.EditValue = new decimal(new int[] {
                0,
                0,
                0,
                0
            });
            this.tahunSpinEdit.Location = new System.Drawing.Point(103, 12);
            this.tahunSpinEdit.Name     = "tahunSpinEdit";
            this.tahunSpinEdit.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                new DevExpress.XtraEditors.Controls.EditorButton()
            });
            this.tahunSpinEdit.Properties.DisplayFormat.FormatString = "####";
            this.tahunSpinEdit.Properties.DisplayFormat.FormatType   = DevExpress.Utils.FormatType.Custom;
            this.tahunSpinEdit.Properties.EditFormat.FormatString    = "####";
            this.tahunSpinEdit.Properties.EditFormat.FormatType      = DevExpress.Utils.FormatType.Custom;
            this.tahunSpinEdit.Properties.IsFloatValue  = false;
            this.tahunSpinEdit.Properties.Mask.EditMask = "d";
            this.tahunSpinEdit.Size     = new System.Drawing.Size(63, 20);
            this.tahunSpinEdit.TabIndex = 2;
            //
            // comboBoxEdit1
            //
            this.comboBoxEdit1.DataBindings.Add(new Binding("EditValue", this.labaRugiBulananBindingSource, "Bulan", true));
            this.comboBoxEdit1.Location = new System.Drawing.Point(233, 12);
            this.comboBoxEdit1.Name     = "comboBoxEdit1";
            this.comboBoxEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
            });
            this.comboBoxEdit1.Size     = new System.Drawing.Size(99, 20);
            this.comboBoxEdit1.TabIndex = 3;
            //
            // labaRugiBulananBindingSource
            //
            this.labaRugiBulananBindingSource.DataSource = typeof(SentraGL.Report.LabaRugi.LabaRugiBulanan);
            //
            // autoFormat1
            //
            this.autoFormat1.OwnerForm = this;
            //
            // frmLabaRugiBulanan
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(519, 40);
            this.Controls.Add(this.comboBoxEdit1);
            this.Controls.Add(namaBulanLabel);
            this.Controls.Add(tahunLabel);
            this.Controls.Add(this.tahunSpinEdit);
            this.Name = "frmLabaRugiBulanan";
            this.Text = "frmLabaRugiBulanan";
            ((System.ComponentModel.ISupportInitialize)(this.tahunSpinEdit.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.labaRugiBulananBindingSource)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.autoFormat1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
 public DBCBoxContainer(long id, Label nameLabel, int comboBoxIndex)
 {
     ID            = id;
     NameLabel     = nameLabel;
     ComboBoxIndex = comboBoxIndex;
 }
示例#35
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormRegistrationKey));
     this.label1            = new System.Windows.Forms.Label();
     this.textKey1          = new System.Windows.Forms.TextBox();
     this.label2            = new System.Windows.Forms.Label();
     this.checkAgree        = new System.Windows.Forms.CheckBox();
     this.richTextAgreement = new System.Windows.Forms.RichTextBox();
     this.butOK             = new OpenDental.UI.Button();
     this.butCancel         = new OpenDental.UI.Button();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.Location  = new System.Drawing.Point(164, 6);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(266, 19);
     this.label1.TabIndex  = 2;
     this.label1.Text      = "Registration Key";
     this.label1.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
     //
     // textKey1
     //
     this.textKey1.Location     = new System.Drawing.Point(164, 29);
     this.textKey1.Name         = "textKey1";
     this.textKey1.Size         = new System.Drawing.Size(243, 20);
     this.textKey1.TabIndex     = 0;
     this.textKey1.WordWrap     = false;
     this.textKey1.TextChanged += new System.EventHandler(this.textKey1_TextChanged);
     this.textKey1.KeyUp       += new System.Windows.Forms.KeyEventHandler(this.textKey1_KeyUp);
     //
     // label2
     //
     this.label2.Location  = new System.Drawing.Point(26, 66);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(150, 13);
     this.label2.TabIndex  = 6;
     this.label2.Text      = "License Agreement";
     this.label2.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
     //
     // checkAgree
     //
     this.checkAgree.Location = new System.Drawing.Point(26, 559);
     this.checkAgree.Name     = "checkAgree";
     this.checkAgree.Size     = new System.Drawing.Size(373, 17);
     this.checkAgree.TabIndex = 7;
     this.checkAgree.Text     = "I agree to the terms of the above license agreement in its entirety.";
     this.checkAgree.UseVisualStyleBackColor = true;
     this.checkAgree.CheckedChanged         += new System.EventHandler(this.checkAgree_CheckedChanged);
     //
     // richTextAgreement
     //
     this.richTextAgreement.Location = new System.Drawing.Point(26, 82);
     this.richTextAgreement.Name     = "richTextAgreement";
     this.richTextAgreement.Size     = new System.Drawing.Size(675, 465);
     this.richTextAgreement.TabIndex = 8;
     this.richTextAgreement.Text     = "";
     //
     // butOK
     //
     this.butOK.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.butOK.Enabled  = false;
     this.butOK.Location = new System.Drawing.Point(546, 557);
     this.butOK.Name     = "butOK";
     this.butOK.Size     = new System.Drawing.Size(75, 26);
     this.butOK.TabIndex = 4;
     this.butOK.Text     = "&OK";
     this.butOK.Click   += new System.EventHandler(this.butOK_Click);
     //
     // butCancel
     //
     this.butCancel.Anchor   = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.butCancel.Location = new System.Drawing.Point(627, 557);
     this.butCancel.Name     = "butCancel";
     this.butCancel.Size     = new System.Drawing.Size(75, 26);
     this.butCancel.TabIndex = 0;
     this.butCancel.Text     = "&Cancel";
     this.butCancel.Click   += new System.EventHandler(this.butCancel_Click);
     //
     // FormRegistrationKey
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(720, 597);
     this.Controls.Add(this.richTextAgreement);
     this.Controls.Add(this.checkAgree);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.textKey1);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.butOK);
     this.Controls.Add(this.butCancel);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon            = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.Name            = "FormRegistrationKey";
     this.ShowInTaskbar   = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "Registration Key";
     this.Load           += new System.EventHandler(this.FormRegistrationKey_Load);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
示例#36
0
        private void InitializeComponent()
        {
            DataGridViewCellStyle dataGridViewCellStyle  = new DataGridViewCellStyle();
            DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
            DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();

            this.addTransparencyButton = new Button();
            this.colorGrid             = new DataGridView();
            this.color     = new DataGridViewImageColumn();
            this.Epsilon   = new DataGridViewTextBoxColumn();
            this.HaloWidth = new DataGridViewTextBoxColumn();
            this.removeTransparencyButton   = new Button();
            this.normalTransparencyButton   = new RadioButton();
            this.invertedTransparencyButton = new RadioButton();
            this.noTransparencyButton       = new RadioButton();
            this.fuzzSpinner = new NumericUpDown();
            this.haloSpinner = new NumericUpDown();
            this.label1      = new Label();
            this.label2      = new Label();
            this.useDocumentTransparencyCheckbox = new CheckBox();
            ((ISupportInitialize)this.colorGrid).BeginInit();
            ((ISupportInitialize)this.fuzzSpinner).BeginInit();
            ((ISupportInitialize)this.haloSpinner).BeginInit();
            base.SuspendLayout();
            this.addTransparencyButton.Anchor   = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
            this.addTransparencyButton.Location = new Point(3, 95);
            this.addTransparencyButton.Name     = "addTransparencyButton";
            this.addTransparencyButton.Size     = new Size(210, 23);
            this.addTransparencyButton.TabIndex = 0;
            this.addTransparencyButton.Text     = "Add Color Under Crosshairs";
            this.addTransparencyButton.UseVisualStyleBackColor = true;
            this.addTransparencyButton.Click    += new EventHandler(this.addTransparencyButton_Click);
            this.colorGrid.AllowUserToAddRows    = false;
            this.colorGrid.AllowUserToDeleteRows = false;
            this.colorGrid.AllowUserToResizeRows = false;
            this.colorGrid.Anchor                        = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            dataGridViewCellStyle.Alignment              = DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle.BackColor              = SystemColors.Control;
            dataGridViewCellStyle.Font                   = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
            dataGridViewCellStyle.ForeColor              = SystemColors.WindowText;
            dataGridViewCellStyle.SelectionBackColor     = SystemColors.Highlight;
            dataGridViewCellStyle.SelectionForeColor     = SystemColors.HighlightText;
            dataGridViewCellStyle.WrapMode               = DataGridViewTriState.True;
            this.colorGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle;
            this.colorGrid.ColumnHeadersHeightSizeMode   = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.colorGrid.Columns.AddRange(new DataGridViewColumn[]
            {
                this.color,
                this.Epsilon,
                this.HaloWidth
            });
            this.colorGrid.Location          = new Point(3, 124);
            this.colorGrid.MultiSelect       = false;
            this.colorGrid.Name              = "colorGrid";
            this.colorGrid.ReadOnly          = true;
            this.colorGrid.RowHeadersVisible = false;
            this.colorGrid.SelectionMode     = DataGridViewSelectionMode.FullRowSelect;
            this.colorGrid.Size              = new Size(213, 158);
            this.colorGrid.TabIndex          = 1;
            this.colorGrid.SelectionChanged += new EventHandler(this.pinList_SelectedIndexChanged);
            this.color.AutoSizeMode          = DataGridViewAutoSizeColumnMode.Fill;
            this.color.HeaderText            = "Color";
            this.color.Name                        = "color";
            this.color.ReadOnly                    = true;
            this.color.Resizable                   = DataGridViewTriState.True;
            this.color.SortMode                    = DataGridViewColumnSortMode.Automatic;
            this.Epsilon.AutoSizeMode              = DataGridViewAutoSizeColumnMode.Fill;
            dataGridViewCellStyle2.Alignment       = DataGridViewContentAlignment.MiddleCenter;
            this.Epsilon.DefaultCellStyle          = dataGridViewCellStyle2;
            this.Epsilon.HeaderText                = "Fuzziness (+/--)";
            this.Epsilon.Name                      = "Epsilon";
            this.Epsilon.ReadOnly                  = true;
            this.HaloWidth.AutoSizeMode            = DataGridViewAutoSizeColumnMode.Fill;
            dataGridViewCellStyle3.Alignment       = DataGridViewContentAlignment.MiddleCenter;
            this.HaloWidth.DefaultCellStyle        = dataGridViewCellStyle3;
            this.HaloWidth.HeaderText              = "Halo";
            this.HaloWidth.Name                    = "HaloWidth";
            this.HaloWidth.ReadOnly                = true;
            this.removeTransparencyButton.Anchor   = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
            this.removeTransparencyButton.Location = new Point(3, 288);
            this.removeTransparencyButton.Name     = "removeTransparencyButton";
            this.removeTransparencyButton.Size     = new Size(213, 23);
            this.removeTransparencyButton.TabIndex = 2;
            this.removeTransparencyButton.Text     = "Remove Selected Color";
            this.removeTransparencyButton.UseVisualStyleBackColor = true;
            this.removeTransparencyButton.Click   += new EventHandler(this.removeTransparencyButton_Click);
            this.normalTransparencyButton.AutoSize = true;
            this.normalTransparencyButton.Checked  = true;
            this.normalTransparencyButton.Location = new Point(3, 31);
            this.normalTransparencyButton.Name     = "normalTransparencyButton";
            this.normalTransparencyButton.Size     = new Size(182, 17);
            this.normalTransparencyButton.TabIndex = 3;
            this.normalTransparencyButton.TabStop  = true;
            this.normalTransparencyButton.Text     = "Make selected colors transparent";
            this.normalTransparencyButton.UseVisualStyleBackColor = true;
            this.normalTransparencyButton.CheckedChanged         += new EventHandler(this.normalTransparencyButton_CheckedChanged);
            this.invertedTransparencyButton.AutoSize = true;
            this.invertedTransparencyButton.Location = new Point(3, 55);
            this.invertedTransparencyButton.Name     = "invertedTransparencyButton";
            this.invertedTransparencyButton.Size     = new Size(155, 17);
            this.invertedTransparencyButton.TabIndex = 4;
            this.invertedTransparencyButton.TabStop  = true;
            this.invertedTransparencyButton.Text     = "Display only selected colors";
            this.invertedTransparencyButton.UseVisualStyleBackColor = true;
            this.invertedTransparencyButton.CheckedChanged         += new EventHandler(this.invertedTransparencyButton_CheckedChanged);
            this.noTransparencyButton.AutoSize = true;
            this.noTransparencyButton.Location = new Point(3, 78);
            this.noTransparencyButton.Name     = "noTransparencyButton";
            this.noTransparencyButton.Size     = new Size(124, 17);
            this.noTransparencyButton.TabIndex = 5;
            this.noTransparencyButton.TabStop  = true;
            this.noTransparencyButton.Text     = "Disable transparency";
            this.noTransparencyButton.UseVisualStyleBackColor = true;
            this.noTransparencyButton.CheckedChanged         += new EventHandler(this.noTransparencyButton_CheckedChanged);
            this.fuzzSpinner.Anchor        = (AnchorStyles.Bottom | AnchorStyles.Left);
            this.fuzzSpinner.Location      = new Point(62, 321);
            this.fuzzSpinner.Name          = "fuzzSpinner";
            this.fuzzSpinner.Size          = new Size(42, 20);
            this.fuzzSpinner.TabIndex      = 6;
            this.fuzzSpinner.ValueChanged += new EventHandler(this.exactnessSpinner_ValueChanged);
            this.haloSpinner.Anchor        = (AnchorStyles.Bottom | AnchorStyles.Left);
            this.haloSpinner.Location      = new Point(165, 321);
            this.haloSpinner.Name          = "haloSpinner";
            this.haloSpinner.Size          = new Size(48, 20);
            this.haloSpinner.TabIndex      = 7;
            this.haloSpinner.ValueChanged += new EventHandler(this.haloSpinner_ValueChanged);
            this.label1.Anchor             = (AnchorStyles.Bottom | AnchorStyles.Left);
            this.label1.AutoSize           = true;
            this.label1.Location           = new Point(0, 323);
            this.label1.Name     = "label1";
            this.label1.Size     = new Size(53, 13);
            this.label1.TabIndex = 8;
            this.label1.Text     = "Fuzziness";
            this.label2.Anchor   = (AnchorStyles.Bottom | AnchorStyles.Left);
            this.label2.AutoSize = true;
            this.label2.Location = new Point(129, 323);
            this.label2.Name     = "label2";
            this.label2.Size     = new Size(29, 13);
            this.label2.TabIndex = 9;
            this.label2.Text     = "Halo";
            this.useDocumentTransparencyCheckbox.AutoSize = true;
            this.useDocumentTransparencyCheckbox.Location = new Point(3, 8);
            this.useDocumentTransparencyCheckbox.Name     = "useDocumentTransparencyCheckbox";
            this.useDocumentTransparencyCheckbox.Size     = new Size(159, 17);
            this.useDocumentTransparencyCheckbox.TabIndex = 10;
            this.useDocumentTransparencyCheckbox.Text     = "Use document transparency";
            this.useDocumentTransparencyCheckbox.UseVisualStyleBackColor = true;
            this.useDocumentTransparencyCheckbox.CheckedChanged         += new EventHandler(this.useDocumentTransparencyCheckbox_CheckedChanged);
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode       = AutoScaleMode.Font;
            base.Controls.Add(this.useDocumentTransparencyCheckbox);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.haloSpinner);
            base.Controls.Add(this.fuzzSpinner);
            base.Controls.Add(this.noTransparencyButton);
            base.Controls.Add(this.invertedTransparencyButton);
            base.Controls.Add(this.normalTransparencyButton);
            base.Controls.Add(this.removeTransparencyButton);
            base.Controls.Add(this.colorGrid);
            base.Controls.Add(this.addTransparencyButton);
            base.Name = "TransparencyPanel";
            base.Size = new Size(216, 345);
            ((ISupportInitialize)this.colorGrid).EndInit();
            ((ISupportInitialize)this.fuzzSpinner).EndInit();
            ((ISupportInitialize)this.haloSpinner).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
        private void FormatLabelText(Label label, int size)
        {
            Contract.Requires(label != null);

            label.Text = $"0x{size:X} / {size}";
        }
示例#38
0
        void diplomacyLabel_MouseEnter(object sender, EventArgs e)
        {
            Label label = sender as Label;

            label.Font = new Font(label.Font, FontStyle.Underline);
        }
示例#39
0
        int mNumTeams = 4; //if this number changes, the table layout should be made dynamic
        public void LoadTable()
        {
            this.tableLayoutPanel1.Controls.Clear();
            Label newLabel;

            if (mSimMain.DiplomacyData.Count == 0)
            {
                DiplomacyXml.InitDiplomacyData(mSimMain.DiplomacyData, mNumTeams);
            }

            for (int i = 0; i <= mNumTeams; i++)
            {
                for (int j = 0; j <= mNumTeams; j++)
                {
                    if ((i == 0) && (j == 0))
                    {
                        newLabel      = new Label();
                        newLabel.Text = "Teams";
                        tableLayoutPanel1.Controls.Add(newLabel, j, i);
                    }
                    else if (i == 0)
                    {
                        newLabel      = new Label();
                        newLabel.Text = j.ToString();
                        tableLayoutPanel1.Controls.Add(newLabel, j, i);
                    }
                    else if (j == 0)
                    {
                        newLabel      = new Label();
                        newLabel.Text = i.ToString() + " -->";
                        tableLayoutPanel1.Controls.Add(newLabel, j, i);
                    }
                    else if (j == i)
                    {
                        newLabel      = new Label();
                        newLabel.Text = "Ally";
                        tableLayoutPanel1.Controls.Add(newLabel, j, i);
                    }
                    else
                    {
                        Label diplomacyLabel = new Label();
                        diplomacyLabel.ForeColor = System.Drawing.Color.Blue;

                        //code to expand # teams...  not tested
                        //if (i > mSimMain.DiplomacyData.Count)
                        //{
                        //   DiplomacyXml dipl = new DiplomacyXml();
                        //   dipl.mTeam = i;
                        //   mSimMain.DiplomacyData.Add(dipl);
                        //}
                        //if (j > mSimMain.DiplomacyData[i - 1].mTeams.Count)
                        //{
                        //      DiplomacyTeamXml t = new DiplomacyTeamXml();
                        //      t.mId = j;
                        //      t.mStatus = "Neutral";
                        //      mSimMain.DiplomacyData[i - 1].mTeams.Add(t);
                        //      if (j == i)
                        //         t.mStatus = "Ally";
                        //}

                        diplomacyLabel.Text        = mSimMain.DiplomacyData[i - 1].mTeams[j - 1].mStatus;
                        diplomacyLabel.Tag         = new Point(i, j);
                        diplomacyLabel.Click      += new EventHandler(newLabel_Click);
                        diplomacyLabel.MouseEnter += new EventHandler(diplomacyLabel_MouseEnter);
                        diplomacyLabel.MouseLeave += new EventHandler(diplomacyLabel_MouseLeave);
                        tableLayoutPanel1.Controls.Add(diplomacyLabel, j, i);
                    }
                }
            }
        }
示例#40
0
        void Init()
        {
            main   = new VBox(false, 6);
            widget = main;

            buttonCommit = new Gtk.Button()
            {
                Image = new Xwt.ImageView(Xwt.Drawing.Image.FromResource("commit-light-16.png")).ToGtkWidget(),
                Label = GettextCatalog.GetString("Commit...")
            };
            buttonCommit.Image.Show();
            buttonRevert = new Gtk.Button()
            {
                Image = new Xwt.ImageView(Xwt.Drawing.Image.FromResource("revert-light-16.png")).ToGtkWidget(),
                Label = GettextCatalog.GetString("Revert")
            };
            buttonRevert.Image.Show();
            showRemoteStatus = new Gtk.Button()
            {
                Image = new Xwt.ImageView(Xwt.Drawing.Image.FromResource("remote-status-light-16.png")).ToGtkWidget(),
                Label = GettextCatalog.GetString("Show Remote Status")
            };
            showRemoteStatus.Image.Show();

            status = new Label("");
            main.PackStart(status, false, false, 0);

            scroller                = new ScrolledWindow();
            scroller.ShadowType     = Gtk.ShadowType.None;
            filelist                = new FileTreeView();
            filelist.Selection.Mode = Gtk.SelectionMode.Multiple;

            scroller.Add(filelist);
            scroller.HscrollbarPolicy   = PolicyType.Automatic;
            scroller.VscrollbarPolicy   = PolicyType.Automatic;
            filelist.RowActivated      += OnRowActivated;
            filelist.DiffLineActivated += OnDiffLineActivated;

            cellToggle          = new CellRendererToggle();
            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            var crc = new CellRendererImage();

            crc.StockId       = "vc-comment";
            colCommit         = new TreeViewColumn();
            colCommit.Spacing = 2;
            colCommit.Widget  = new Xwt.ImageView(Xwt.Drawing.Image.FromResource("commit-light-16.png")).ToGtkWidget();
            colCommit.Widget.Show();
            colCommit.PackStart(cellToggle, false);
            colCommit.PackStart(crc, false);
            colCommit.AddAttribute(cellToggle, "active", ColCommit);
            colCommit.AddAttribute(cellToggle, "visible", ColShowToggle);
            colCommit.AddAttribute(crc, "visible", ColShowComment);

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererImage();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.AddAttribute(crp, "image", ColIcon);
            colStatus.AddAttribute(crp, "visible", ColShowStatus);
            colStatus.AddAttribute(crt, "text", ColStatus);
            colStatus.AddAttribute(crt, "foreground", ColStatusColor);

            colFile         = new TreeViewColumn();
            colFile.Title   = GettextCatalog.GetString("File");
            colFile.Spacing = 2;
            crp             = new CellRendererImage();
            diffRenderer    = new CellRendererDiff();
            colFile.PackStart(crp, false);
            colFile.PackStart(diffRenderer, true);
            colFile.AddAttribute(crp, "image", ColIconFile);
            colFile.AddAttribute(crp, "visible", ColShowStatus);
            colFile.SetCellDataFunc(diffRenderer, new TreeCellDataFunc(SetDiffCellData));

            crt             = new CellRendererText();
            crp             = new CellRendererImage();
            colRemote       = new TreeViewColumn();
            colRemote.Title = GettextCatalog.GetString("Remote Status");
            colRemote.PackStart(crp, false);
            colRemote.PackStart(crt, true);
            colRemote.AddAttribute(crp, "image", ColRemoteIcon);
            colRemote.AddAttribute(crt, "text", ColRemoteStatus);
            colRemote.AddAttribute(crt, "foreground", ColStatusColor);

            filelist.AppendColumn(colStatus);
            filelist.AppendColumn(colRemote);
            filelist.AppendColumn(colCommit);
            filelist.AppendColumn(colFile);

            colRemote.Visible = false;

            filestore               = new TreeStore(typeof(Xwt.Drawing.Image), typeof(string), typeof(string[]), typeof(string), typeof(bool), typeof(bool), typeof(string), typeof(bool), typeof(bool), typeof(Xwt.Drawing.Image), typeof(bool), typeof(Xwt.Drawing.Image), typeof(string), typeof(bool), typeof(bool));
            filelist.Model          = filestore;
            filelist.TestExpandRow += new Gtk.TestExpandRowHandler(OnTestExpandRow);

            commitBox = new VBox();

            HeaderBox commitMessageLabelBox = new HeaderBox();

            commitMessageLabelBox.SetPadding(6, 6, 6, 6);
            commitMessageLabelBox.SetMargins(1, 1, 0, 0);

            HBox labBox = new HBox();

            labelCommit        = new Gtk.Label(GettextCatalog.GetString("Commit message:"));
            labelCommit.Xalign = 0;
            labBox.PackStart(new Xwt.ImageView(Xwt.Drawing.Image.FromResource("comment-light-16.png")).ToGtkWidget(), false, false, 0);
            labBox.PackStart(labelCommit, true, true, 3);

            commitMessageLabelBox.Add(labBox);
            commitMessageLabelBox.ShowAll();
            //commitBox.PackStart (commitMessageLabelBox, false, false, 0);

            Gtk.ScrolledWindow frame = new Gtk.ScrolledWindow();
            frame.HeightRequest        = 75;
            frame.ShadowType           = ShadowType.None;
            commitText                 = new TextView();
            commitText.WrapMode        = WrapMode.WordChar;
            commitText.Buffer.Changed += OnCommitTextChanged;
            frame.Add(commitText);
            commitBox.PackStart(frame, true, true, 0);

            var paned = new VPanedThin();

            paned.HandleWidget = commitMessageLabelBox;
            paned.Pack1(scroller, true, true);
            paned.Pack2(commitBox, false, false);
            main.PackStart(paned, true, true, 0);

            main.ShowAll();
            status.Visible = false;

            filelist.Selection.Changed += new EventHandler(OnCursorChanged);
            VersionControlService.FileStatusChanged += OnFileStatusChanged;

            filelist.HeadersClickable = true;
            filestore.SetSortFunc(0, CompareNodes);
            colStatus.SortColumnId = 0;
            filestore.SetSortFunc(1, CompareNodes);
            colRemote.SortColumnId = 1;
            filestore.SetSortFunc(2, CompareNodes);
            colCommit.SortColumnId = 2;
            filestore.SetSortFunc(3, CompareNodes);
            colFile.SortColumnId = 3;

            filestore.SetSortColumnId(3, Gtk.SortType.Ascending);

            filelist.DoPopupMenu = DoPopupMenu;

            StartUpdate();
        }
示例#41
0
    //NOTE: SaveDataInDb() method will save all the member'fields in DB
    //and also will check an Email Id is already exist or not
    //Will return true if not exist and false if exist

    private void SaveDataInDb(RequiredFieldValidator validatorEmail, Label lblError)
    {
        string selectSqlQuery = "SELECT CustEmailAddr";

        selectSqlQuery += "WHERE CustEmailAddr = @CustEmailAddr";

        string insertSqlQuery = "INSERT INTO customer (";

        insertSqlQuery += "CustId, CustFirstName, CustLastName, CustPwd, CustMobNo, CustEmailAddr) ";
        insertSqlQuery += "VALUES (";
        insertSqlQuery += "@CustId, @CustFirstName, @CustLastName, @CustPwd, @CustMobNo, @CustEmailAddr )";

        MySqlConnection connection = new MySqlConnection(connectionString);

        MySqlCommand cmd = new MySqlCommand(selectSqlQuery, connection);

        MySqlCommand cmdInsert = new MySqlCommand(insertSqlQuery, connection);

        MySqlDataAdapter adapter = new MySqlDataAdapter();

        MySqlDataReader reader;

        // Add the parameters
        cmdInsert.Parameters.AddWithValue("@CustId", MyId);

        cmd.Parameters.AddWithValue("@CustEmailAddr", EmailId);

        cmdInsert.Parameters.AddWithValue("@CustFirstName", CustFirstName);

        cmdInsert.Parameters.AddWithValue("@CustLastName", CustLastName);

        cmdInsert.Parameters.AddWithValue("@CustPwd", GetPwd);

        cmdInsert.Parameters.AddWithValue("@CustMobNo", CustMobNo);

        cmdInsert.Parameters.AddWithValue("@CustEmailAddr", EmailId);

        //Will use Try & catch block to be suscessful connection
        int added = 0;

        try
        {
            //To dispose the connection Obj successfully

            using (connection)
            {
                //Open Databse connection
                connection.Open();
                reader = cmd.ExecuteReader();

                //Will check an Email id is already exist or not

                while (reader.Read())
                {
                    //If exist

                    if (EmailId == reader["CustEmailAddr"].ToString())
                    {
                        validatorEmail.Text  = "Email Id is already exist";
                        validatorEmail.Text += "Click on forgot password";
                    }

                    //If not

                    else
                    {
                        //If inserted successfully it returns 1

                        added = cmdInsert.ExecuteNonQuery();
                    }
                }
            }
        }
        catch (Exception error)
        {
            lblError.Text = error.ToString();
        }

        //If record is added sucessfully set cookie and mail info to client

        if (added > 0)
        {
            //Create cookie
            cookie = new HttpCookie("CustomerInfo");

            // Store CustId to cookie
            cookie["CustId"] = MyId.ToString();
            cookie.Expires   = DateTime.Now.AddDays(2);

            //Add it to the current web response
            System.Web.HttpContext.Current.Response.Cookies.Add(cookie);

            //Navigate customer to home page
            System.Web.HttpContext.Current.Response.Redirect("Home.aspx");

            //Mail info to client
            SendSignUpMail();
        }
    }
示例#42
0
        void diplomacyLabel_MouseLeave(object sender, EventArgs e)
        {
            Label label = sender as Label;

            label.Font = new Font(label.Font, FontStyle.Regular);
        }
示例#43
0
    /* Note: If customer Signs up successfully
     * Retrive all customer data with associated customer Id
     * i.e Troughout their name to what they ardered
     */
    public void DisplayCustomerData()
    {
        string selectSqlQueryCust = "SELECT  CustId, CustFirstName, CustLastName, CustMobNo,  CustEmailAddr, CustImg, CustShippingAddr, CustShipCountry, CustShipState, CustShipCity, CustShipPinCode, CustComment FROM customer";

        selectSqlQueryCust += "WHERE CustId = @CustId";

        MySqlConnection connection = new MySqlConnection(connectionString);

        MySqlCommand cmd;

        MySqlDataAdapter adaptor;

        MySqlDataReader reader;

        cmd = new MySqlCommand(selectSqlQueryCust, connection);

        //Add the paramaters
        cmd.Parameters.AddWithValue("@CustId", MyId);

        adaptor = new MySqlDataAdapter(cmd);

        try
        {
            //To automatically dispose the connction Obj
            using (connection)
            {
                // Open the database connection
                connection.Open();
                reader = cmd.ExecuteReader();

                //Read the data from Customer table
                //and Set the Customer's Object fields
                while (reader.Read())
                {
                    MyId = Convert.ToInt32(reader["CustId"]);

                    CustFirstName = reader["CustFirstName"].ToString();

                    CustLastName = reader["CustLastName"].ToString();

                    CustMobNo = Convert.ToInt32(reader["CustMobNo"]);

                    EmailId = reader["CustEmailAddr"].ToString();

                    CustImg = reader["CustImg"].ToString();

                    CustShippAddr = reader["CustShippingAddr"].ToString();

                    CustShipCountry = reader["CustShipCountry"].ToString();

                    CustShipState = reader["CustShipState"].ToString();

                    CustShipPinCode = Convert.ToInt32(reader["CustShipPinCode"]);

                    CustComment = reader["CustComment"].ToString();
                }
            }
        }

        catch (Exception error)
        {
            Label errorLbl = new Label();
            errorLbl.Text = error.ToString();
        }
    }
示例#44
0
文件: General.cs 项目: GAMEBOOK/Titan
        public TabPage GetIdleTabPage()
        {
            var games = new List <int> {
                730
            };

            var labelGames = new Label {
                Text = GetFormattedGameIDList(games)
            };

            var nsGameID = new NumericStepper
            {
                MinValue = 0,
                MaxValue = double.MaxValue
            };

            var btnAddGame = new Button {
                Text = "Add"
            };

            btnAddGame.Click += delegate
            {
                var available = true;
                var gameID    = Convert.ToInt32(Math.Round(nsGameID.Value));

                for (var i = 0; i < games.Count; i++)
                {
                    if (games[i] == gameID)
                    {
                        Titan.Instance.UIManager.SendNotification("Titan - Error", "The game id is already in the " +
                                                                  "list of idle games.");

                        available = false;
                    }
                }

                if (available)
                {
                    if (gameID == 0)
                    {
                        Titan.Instance.UIManager.ShowForm(UIType.ExtraGameInfo);

                        Titan.Instance.UIManager.SendNotification("Titan", "You inputted game id 0. Please specify " +
                                                                  "the custom game for your game in the popup.");
                    }

                    games.Add(gameID);
                    labelGames.Text = GetFormattedGameIDList(games);
                }
            };

            var btnRemoveGame = new Button {
                Text = "Remove"
            };

            btnRemoveGame.Click += delegate
            {
                var available = false;
                var gameID    = Convert.ToInt32(Math.Round(nsGameID.Value));

                for (var i = 0; i < games.Count; i++)
                {
                    if (games[i] == gameID)
                    {
                        games.RemoveAt(i);
                        labelGames.Text = GetFormattedGameIDList(games);

                        Titan.Instance.UIManager.SendNotification("Titan", "Successfully removed game id "
                                                                  + gameID + " from the list of" +
                                                                  "idle games.");

                        available = true;
                    }
                }

                if (!available)
                {
                    Titan.Instance.UIManager.SendNotification("Titan - Error", "Could not find game id "
                                                              + gameID + " in the list of " +
                                                              "idle games.");
                }
            };

            ////////////////////////////////////////////////////////////////////////////

            var nsMinutes = new NumericStepper
            {
                MinValue  = 0,
                Increment = 10
            };

            var dropIndexes = new DropDown();

            foreach (var i in Titan.Instance.AccountManager.Accounts)
            {
                if (i.Key != -1)
                {
                    dropIndexes.Items.Add("#" + i.Key + " (" + i.Value.Count + " accounts)");
                }
            }
            dropIndexes.SelectedIndex = Titan.Instance.AccountManager.Index;

            var cbAllIndexes = new CheckBox {
                Text = "Use all accounts", Checked = false
            };

            cbAllIndexes.CheckedChanged += delegate
            {
                if (cbAllIndexes.Checked != null)
                {
                    dropIndexes.Enabled = (bool)!cbAllIndexes.Checked;
                }
                else
                {
                    cbAllIndexes.Checked = false;
                }
            };

            var btnIdle = new Button {
                Text = "Idle"
            };

            btnIdle.Click += delegate
            {
                if (games.Count > 0)
                {
                    var minutes = Convert.ToInt32(Math.Round(nsMinutes.Value));

                    Titan.Instance.AccountManager.StartIdleing(
                        cbAllIndexes.Checked != null && (bool)cbAllIndexes.Checked ? -1 : dropIndexes.SelectedIndex,
                        new IdleInfo
                    {
                        GameID  = games.ToArray(),
                        Minutes = minutes
                    }
                        );
                }
                else
                {
                    Titan.Instance.UIManager.SendNotification("Titan - Error", "Please enter atleast one game " +
                                                              "to idle in.");
                }
            };

            return(new TabPage
            {
                Text = "Idle",
                Content = new TableLayout
                {
                    Spacing = new Size(5, 5),
                    Padding = new Padding(10, 10, 10, 10),
                    Rows =
                    {
                        new GroupBox
                        {
                            Text = "Games",
                            Content = new TableLayout
                            {
                                Spacing = new Size(5, 5),
                                Padding = new Padding(10, 10, 10, 10),
                                Rows =
                                {
                                    new TableRow(
                                        new TableCell(new Label
                                    {
                                        Text = "List of games: ", Font = new Font(SystemFont.Bold)
                                    }, true),
                                        new TableCell(labelGames, true)
                                        ),
                                    new TableRow(
                                        new TableCell(new Label {
                                        Text = "Game ID"
                                    }),
                                        new TableCell(nsGameID)
                                        ),
                                    new TableRow(
                                        new TableCell(btnAddGame),
                                        new TableCell(btnRemoveGame)
                                        )
                                }
                            }
                        },
                        new GroupBox
                        {
                            Text = "Time",
                            Content = new TableLayout
                            {
                                Spacing = new Size(5, 5),
                                Padding = new Padding(10, 10, 10, 10),
                                Rows =
                                {
                                    new TableRow(
                                        new TableCell(new Label {
                                        Text = "Idle for minutes"
                                    }, true),
                                        new TableCell(nsMinutes, true)
                                        )
                                }
                            }
                        },
                        new GroupBox
                        {
                            Text = "Bots",
                            Content = new TableLayout
                            {
                                Spacing = new Size(5, 5),
                                Padding = new Padding(10, 10, 10, 10),
                                Rows =
                                {
                                    new TableRow(
                                        new TableCell(new Label {
                                        Text = "Use Index"
                                    }, true),
                                        new TableCell(dropIndexes, true)
                                        ),
                                    new TableRow(
                                        new TableCell(new Panel()),
                                        new TableCell(cbAllIndexes)
                                        )
                                }
                            }
                        },
                        new TableLayout
                        {
                            Spacing = new Size(5, 5),
                            Padding = new Padding(10, 10, 10, 10),
                            Rows =
                            {
                                new TableRow(
                                    new TableCell(new Panel(), true),
                                    new TableCell(new Panel(), true),
                                    new TableCell(btnIdle)
                                    ),
                                new TableRow
                                {
                                    ScaleHeight = true
                                }
                            }
                        }
                    }
                }
            });
        }
示例#45
0
        private void LoadFoodItems()
        {
            for (int i = 0; i < MasterModel.tempMeal.items.Count; i++)
            {
                Grid itemGrid = new Grid();
                itemGrid.ColumnDefinitions.Add(new ColumnDefinition());
                itemGrid.ColumnDefinitions.Add(new ColumnDefinition());
                itemGrid.ColumnDefinitions.Add(new ColumnDefinition());
                itemGrid.RowDefinitions.Add(new RowDefinition());
                itemGrid.RowDefinitions.Add(new RowDefinition());
                itemGrid.RowDefinitions.Add(new RowDefinition());
                itemGrid.RowDefinitions.Add(new RowDefinition());

                itemGrid.RowDefinitions[1].Height = new GridLength(0.5, GridUnitType.Star);
                itemGrid.RowDefinitions[2].Height = new GridLength(0.5, GridUnitType.Star);

                Frame frame = new Frame();
                frame.Content         = itemGrid;
                frame.BackgroundColor = Color.DarkRed;
                frame.Padding         = new Thickness(10, 10);
                frame.CornerRadius    = 5;

                //save index number per foodItem... To fix a bug
                MasterModel.tempMeal.items[i].index = i;

                FoodItem item = MasterModel.tempMeal.items[i];

                Label lblName = new Label();
                lblName           = CreateLabelTemplate(lblName, LayoutOptions.Start, 0, 0, 1, item.name);
                lblName.TextColor = Color.White;
                Label lblEnergy = new Label();
                lblEnergy           = CreateLabelTemplate(lblEnergy, LayoutOptions.Start, 0, 1, 2, $"Energy: {item.energyKcal.ToString("0.00")} kcal");
                lblEnergy.TextColor = Color.White;
                Label lblProtein = new Label();
                lblProtein           = CreateLabelTemplate(lblProtein, LayoutOptions.Start, 0, 2, 1, $"P: {item.protein.ToString("0.00")} g");
                lblProtein.TextColor = Color.White;
                Label lblCarbs = new Label();
                lblCarbs           = CreateLabelTemplate(lblCarbs, LayoutOptions.Center, 1, 2, 1, $"C: {item.carbs.ToString("0.00")} g");
                lblCarbs.TextColor = Color.White;
                Label lblFat = new Label();
                lblFat           = CreateLabelTemplate(lblFat, LayoutOptions.End, 2, 2, 1, $"F: {item.fat.ToString("0.00")} g");
                lblFat.TextColor = Color.White;
                Label lblServing = new Label();
                lblServing           = CreateLabelTemplate(lblServing, LayoutOptions.End, 1, 3, 2, $"Serving: {item.serving.ToString("0.00")} g");
                lblServing.TextColor = Color.White;

                itemGrid.Children.Add(lblName);
                itemGrid.Children.Add(lblEnergy);
                itemGrid.Children.Add(lblProtein);
                itemGrid.Children.Add(lblCarbs);
                itemGrid.Children.Add(lblFat);
                itemGrid.Children.Add(lblServing);

                StackLayout stack = new StackLayout();
                stack.Orientation = StackOrientation.Horizontal;
                Grid.SetColumnSpan(stack, 3);
                stack.HorizontalOptions = LayoutOptions.End;

                Button btnEdit = new Button()
                {
                    Text            = "Edit",
                    FontSize        = Device.GetNamedSize(NamedSize.Micro, typeof(Button)),
                    BackgroundColor = Color.Black,
                    BorderColor     = Color.White,
                    BorderWidth     = 1,
                    TextColor       = Color.White,
                    HeightRequest   = 35,
                    WidthRequest    = 50,
                    CornerRadius    = 5,
                    Padding         = new Thickness(0, 0),
                    VerticalOptions = LayoutOptions.Center
                };

                Button btnDelete = new Button()
                {
                    Text            = "Del",
                    FontSize        = Device.GetNamedSize(NamedSize.Micro, typeof(Button)),
                    BackgroundColor = Color.Black,
                    BorderColor     = Color.White,
                    BorderWidth     = 1,
                    TextColor       = Color.White,
                    HeightRequest   = 35,
                    WidthRequest    = 50,
                    CornerRadius    = 5,
                    Padding         = new Thickness(0, 0),
                    VerticalOptions = LayoutOptions.Center
                };

                btnEdit.Clicked += (sender, args) =>
                {
                    MasterModel.currentFoodResult               = new FoodResult();
                    MasterModel.currentFoodResult.resultName    = item.name;
                    MasterModel.currentFoodResult.resultKcal    = item.energyKcal;
                    MasterModel.currentFoodResult.resultCarb    = item.carbs;
                    MasterModel.currentFoodResult.resultFat     = item.fat;
                    MasterModel.currentFoodResult.resultProtein = item.protein;
                    MasterModel.currentFoodResult.resultServing = item.serving;

                    UpdateText();

                    //updatetext method doesn't do name
                    entryName.Text = item.name;

                    btnAddFood.IsVisible  = false;
                    btnEditFood.IsVisible = true;

                    //update current index to class variable
                    currentFoodItemIndex = item.index;
                };

                btnDelete.Clicked += (sender, args) =>
                {
                    MasterModel.tempMeal.items.RemoveAt(item.index);
                    RefreshPage();
                };

                stack.Children.Add(btnEdit);
                stack.Children.Add(btnDelete);

                itemGrid.Children.Add(stack);

                stackFoodItems.Children.Add(frame);
            }
        }
示例#46
0
    //Member Methods

    public void SignUp(RequiredFieldValidator validatorEmail, Label lblError)
    {
        SaveDataInDb(validatorEmail, lblError);
    }
示例#47
0
        protected void btnAsignar04_Click(object sender, EventArgs e)
        {
            bool Continuar = true;

            lblMsjCat04.Text = "";

            if (ddlTipo04.SelectedValue == "lst" || ddlTipo04.SelectedValue == "lchk")
            {
                int Cat_Id = 0;

                int.TryParse(ddlCat04.SelectedValue, out Cat_Id);

                if (Cat_Id <= 0)
                {
                    Continuar        = false;
                    lblMsjCat04.Text = "Debe seleccionar un catálogo.";
                }
            }

            txtCampoDesc.Text = txtCampoDesc.Text.Trim();

            if (string.IsNullOrWhiteSpace(txtCampoDesc.Text))
            {
                Continuar        = false;
                lblMsjCat04.Text = "Debe ingresar una descripción.";
            }

            if (Continuar)
            {
                GridViewRow row = grdParams.SelectedRow;

                Label lblE = (Label)row.FindControl("lblEntrada");

                lblE.Text = ddlTipo04.SelectedValue;

                Label lblB = (Label)row.FindControl("lblBAprox");

                if (chkAprox04.Checked)
                {
                    lblB.Text = "Si";
                }
                else
                {
                    lblB.Text = "No";
                }

                Label lblN = (Label)row.FindControl("lblNull");

                if (chkNull04.Checked)
                {
                    lblN.Text = "Si";
                }
                else
                {
                    lblN.Text = "No";
                }

                Label lblD = (Label)row.FindControl("lblDesc");

                lblD.Text = txtCampoDesc.Text;

                if (ddlTipo04.SelectedValue == "lst" || ddlTipo04.SelectedValue == "lchk")
                {
                    Label lblC = (Label)row.FindControl("lblCat");

                    lblC.Text = ddlCat04.SelectedValue;

                    if (ddlCat04.Items.Count > 0)
                    {
                        ddlCat04.SelectedIndex = 0;
                    }
                }

                ddlTipo04.SelectedIndex = 0;
                pnlTipo04.Visible       = false;
                pnlCat04.Visible        = false;
                grdParams.SelectedIndex = -1;
            }
        }
示例#48
0
        //protected void txtNo_TextChanged(object sender, EventArgs e)
        //{
        //    if (txtNo.Text != string.Empty)
        //    {
        //        Int16 CuType = Converter.GetSmallInteger(lblCuType.Text);
        //        int CuNo = Converter.GetInteger(lblCuNo.Text);
        //        int MemNo = Converter.GetInteger(lblmemno.Text);
        //        Int16 AType = Converter.GetSmallInteger(lblType.Text);
        //        int ANo = Converter.GetInteger(lblAccNo.Text);

        //        int NomCode = Converter.GetInteger(txtNo.Text);
        //        A2ZACCNOMINEEDTO getDTO = new A2ZACCNOMINEEDTO();
        //        getDTO = (A2ZACCNOMINEEDTO.GetInformation(NomCode,AType,MemNo,ANo,CuType,CuNo));
        //        if (getDTO.Record > 0)
        //        {
        //            txtName.Text = Converter.GetString(getDTO.NomineeName);
        //            txtAddressL1.Text = Converter.GetString(getDTO.NomAddress1);
        //            txtAddressL2.Text = Converter.GetString(getDTO.NomAddress2);
        //            txtAddressL3.Text = Converter.GetString(getDTO.NomAddress3);
        //            txtTelNo.Text = Converter.GetString(getDTO.NomTelephoneNo);
        //            txtMobileNo.Text = Converter.GetString(getDTO.NomMobileNo);
        //            txtEmail.Text = Converter.GetString(getDTO.NomEmail);
        //            ddlDivision.SelectedValue = Converter.GetString(getDTO.NomDivision);
        //            ddlDistrict.SelectedValue = Converter.GetString(getDTO.NomDistrict);
        //            ddlThana.SelectedValue = Converter.GetString(getDTO.NomThana);
        //            txtRelation.Text = Converter.GetString(getDTO.NomRelation);
        //            txtNomSharePer.Text = Converter.GetString(getDTO.NomSharePercentage);
        //            BtnSubmit.Visible = false;
        //            BtnUpdate.Visible = true;
        //            txtName.Focus();
        //        }
        //        else
        //        {
        //            clearInfo();
        //            BtnSubmit.Visible = true;
        //            BtnUpdate.Visible = false;
        //            txtName.Focus();
        //        }

        //    }
        //}

        protected void gvDetailInfo_SelectedIndexChanged(object sender, EventArgs e)
        {
            DivisionDropdown();
            DistrictInFo();
            UpzilaInfo();
            ThanaInfo();

            //foreach (GridViewRow r in gvDetailInfo.Rows)
            //{
            GridViewRow row   = gvDetailInfo.SelectedRow;
            Label       lblId = (Label)gvDetailInfo.Rows[row.RowIndex].Cells[0].FindControl("lblId");
            int         ID    = Converter.GetInteger(lblId.Text);

            lblID.Text = Converter.GetString(ID);

            A2ZACCNOMINEEDTO DTO = (A2ZACCNOMINEEDTO.WFGetInformation(ID));

            txtName.Text = Converter.GetString(DTO.NomineeName);

            txtAddressL1.Text = Converter.GetString(DTO.NomAddress1);
            txtAddressL2.Text = Converter.GetString(DTO.NomAddress2);
            txtAddressL3.Text = Converter.GetString(DTO.NomAddress3);
            txtTelNo.Text     = Converter.GetString(DTO.NomTelephoneNo);
            txtMobileNo.Text  = Converter.GetString(DTO.NomMobileNo);

            txtRelation.Text    = Converter.GetString(DTO.NomRelation);
            txtNomSharePer.Text = Converter.GetString(DTO.NomSharePercentage);
            HoldPerc.Text       = Converter.GetString(DTO.NomSharePercentage);


            txtEmail.Text = Converter.GetString(DTO.NomEmail);


            ddlDivision.SelectedValue = Converter.GetString(DTO.NomDivision);


            ddlDistrict.SelectedValue = Converter.GetString(DTO.NomDistrict);

            ddlUpzila.SelectedValue = Converter.GetString(DTO.NomUpzila);

            ddlThana.SelectedValue = Converter.GetString(DTO.NomThana);



            //txtName.Text = row.Cells[1].Text;
            //txtAddressL1.Text = row.Cells[2].Text;
            //txtAddressL2.Text = row.Cells[3].Text;
            //txtAddressL3.Text = row.Cells[4].Text;
            //txtTelNo.Text = row.Cells[5].Text;
            //txtMobileNo.Text = row.Cells[6].Text;

            //txtRelation.Text = row.Cells[7].Text;
            //txtNomSharePer.Text = row.Cells[8].Text;
            //HoldPerc.Text = row.Cells[8].Text;

            //Label lblNomEmail = (Label)gvDetailInfo.Rows[row.RowIndex].Cells[9].FindControl("lblNomEmail");
            //txtEmail.Text = lblNomEmail.Text;

            //Label lblNomDivi = (Label)gvDetailInfo.Rows[row.RowIndex].Cells[10].FindControl("lblNomDivi");
            //int divi = Converter.GetInteger(lblNomDivi.Text);
            //ddlDivision.SelectedValue = Converter.GetString(divi);

            //Label lblNomDist = (Label)gvDetailInfo.Rows[row.RowIndex].Cells[11].FindControl("lblNomDist");
            //int dist = Converter.GetInteger(lblNomDist.Text);
            //ddlDistrict.SelectedValue = Converter.GetString(dist);

            //Label lblNomThana = (Label)gvDetailInfo.Rows[row.RowIndex].Cells[12].FindControl("lblNomThana");
            //int thana = Converter.GetInteger(lblNomThana.Text);
            //ddlThana.SelectedValue = Converter.GetString(thana);



            BtnUpdate.Visible = true;
            BtnDelete.Visible = true;
            BtnSubmit.Visible = false;
        }
示例#49
0
        public MyForm()
        {
            Size = new Size(1000, 800);
            AutoSizeMode = AutoSizeMode;
          

            TableLayoutPanel panel = new TableLayoutPanel
            {
                RowCount = 7,
                ColumnCount = 2,
                Dock = DockStyle.Fill,

                BackColor = Color.Gold

            };
            Controls.Add(panel);
            panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 60));
            panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 5));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 2));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 10));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 10));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 10));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 40));
            panel.RowStyles.Add(new ColumnStyle(SizeType.Percent, 10));

            var headerLabel = new Label
            {
                Text = "Inköpslista",
                BackColor = Color.AntiqueWhite,
                Font = new Font("Impact", 17F),
                Anchor = AnchorStyles.Bottom,
                
                Dock = DockStyle.Fill
            };
            panel.Controls.Add(headerLabel);
            panel.SetColumnSpan(headerLabel, 2);
            var fyllPa = new Label
            {
                Text = "Fyll på:",
                BackColor = Color.AntiqueWhite,
                Anchor = AnchorStyles.Left,
                Dock = DockStyle.Fill
            };
            panel.Controls.Add(fyllPa);
            panel.SetColumnSpan(fyllPa, 2);
            varuInput = new TextBox
            {
                Dock = DockStyle.Fill,
                Anchor = AnchorStyles.Left,
                Height = 350,
                Width = 550
            };
            panel.Controls.Add(varuInput);
            varuInput.KeyDown += new KeyEventHandler(VaruInput_KeyDown);


            var button1 = new Button
            {
                Dock = DockStyle.Fill,
                Font = new Font("Impact", 12F),
                Text = "Maxi, Kungälv"
            };
            panel.Controls.Add(button1);
            button1.Click += Button1_Click;
            varuDisplay = new ListBox
            {
                Dock = DockStyle.Fill,
                Font = new Font("Liberation Sans", 9F)
            };
            panel.Controls.Add(varuDisplay);
            panel.SetRowSpan(varuDisplay, 3);
            varuDisplay.Items.Add("Din lista: \n");

            var button2 = new Button
            {
                Dock = DockStyle.Fill,
                Font = new Font("Impact", 12F),
                Text = "City Gross, Ytterby"
            };
            panel.Controls.Add(button2);
            button2.Click += Button2_Click;

            var button3 = new Button
            {
                Dock = DockStyle.Fill,
                Font = new Font("Impact", 12F),
                Text = "Willys, Stenungsund"
            };
            panel.Controls.Add(button3);
            button3.Click += Button3_Click;
            var empty = new Label
            {
                Anchor = AnchorStyles.Left,
                Dock = DockStyle.Fill
            };
            panel.Controls.Add(empty);
            var mejlaTill = new Label
            {
                Text = "Mejla till:",
                BackColor = Color.AntiqueWhite,
                Anchor = AnchorStyles.Left,
                Dock = DockStyle.Fill
            };
            panel.Controls.Add(mejlaTill);
            var mejlInput = new TextBox
            {
                Dock = DockStyle.Fill
            };
            panel.Controls.Add(mejlInput);
            this.ShoppingCart = new Shop();
           this.Assortment = new StoreStructure();

        }
示例#50
0
        protected void grdParamsQ_RowSelected(object sender, EventArgs e)
        {
            if (grdParamsQ.SelectedIndex != -1)
            {
                Label    lbl  = (Label)grdParamsQ.SelectedRow.FindControl("lblBAprox");
                CheckBox chkO = (CheckBox)grdParamsQ.SelectedRow.FindControl("chkObligatorio");
                Label    lblE = (Label)grdParamsQ.SelectedRow.FindControl("lblEntrada");
                Label    lblN = (Label)grdParamsQ.SelectedRow.FindControl("lblNull");
                Label    lblC = (Label)grdParamsQ.SelectedRow.FindControl("lblCat");
                Label    lblD = (Label)grdParamsQ.SelectedRow.FindControl("lblDesc");

                pnlTipo04Q.Visible = true;
                pnlCat04Q.Visible  = false;

                ddlTipo04Q.SelectedIndex = 0;
                chkAprox04Q.Checked      = false;
                chkNull04Q.Checked       = false;
                txtLongitud04Q.Text      = "";

                if (lblN.Text == "Si" && !chkO.Checked)
                {
                    chkNull04Q.Checked = true;
                }
                else
                {
                    chkNull04Q.Checked = false;
                }

                if (lbl.Text != "N/A")
                {
                    pnlAprox04Q.Visible = true;
                }
                else
                {
                    pnlAprox04Q.Visible = false;
                }

                if (lbl.Text == "Si")
                {
                    chkAprox04Q.Checked = true;
                }
                else
                {
                    chkAprox04Q.Checked = false;
                }

                if (chkO.Checked)
                {
                    pnlNull04Q.Visible = false;
                }
                else
                {
                    pnlNull04Q.Visible = true;
                }

                txtLongitud04Q.Text = grdParamsQ.SelectedRow.Cells[CeldaLongitud].Text;
                txtCampoDescQ.Text  = lblD.Text;

                if (!string.IsNullOrWhiteSpace(lblE.Text))
                {
                    ddlTipo04Q.SelectedValue = lblE.Text;
                }

                if (!string.IsNullOrWhiteSpace(grdParamsQ.SelectedRow.Cells[CeldaTipoDato].Text) && grdParamsQ.SelectedRow.Cells[CeldaTipoDato].Text != "&nbsp;")
                {
                    ddlTipoDatoQ.SelectedValue = grdParamsQ.SelectedRow.Cells[CeldaTipoDato].Text;
                }
                else
                {
                    ddlTipoDatoQ.SelectedIndex = 0;
                }

                if (ddlTipo04Q.SelectedValue == "lst" || ddlTipo04Q.SelectedValue == "lchk")
                {
                    BLCatalogos objCat = new BLCatalogos();

                    pnlCat04Q.Visible = true;

                    if (ddlTipo04Q.SelectedValue == "lst")
                    {
                        objCat.ListaCatalogos(ref ddlCat04Q, ddlCnx.SelectedValue, (int)DatosGenerales.EstiloReportesDinamicos.eDropDownList);
                    }
                    else
                    {
                        objCat.ListaCatalogos(ref ddlCat04Q, ddlCnx.SelectedValue, (int)DatosGenerales.EstiloReportesDinamicos.eCheckBoxList);
                    }

                    if (ddlCat04Q.Items.Count > 0 && lblC.Text != "0")
                    {
                        ddlCat04Q.SelectedValue = lblC.Text;
                    }
                }
                else
                {
                    pnlCat04Q.Visible = false;
                }

                ValidarTD();
            }
        }
示例#51
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
     {
         base.GotoResourceNotFound();
     }
     this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
     this.litArticleContent     = (Literal)this.FindControl("litArticleContent");
     this.litArticleDescription = (Literal)this.FindControl("litArticleDescription");
     this.litArticleTitle       = (Literal)this.FindControl("litArticleTitle");
     this.lblFront      = (Label)this.FindControl("lblFront");
     this.lblNext       = (Label)this.FindControl("lblNext");
     this.lblFrontTitle = (Label)this.FindControl("lblFrontTitle");
     this.lblNextTitle  = (Label)this.FindControl("lblNextTitle");
     this.aFront        = (HtmlAnchor)this.FindControl("front");
     this.aNext         = (HtmlAnchor)this.FindControl("next");
     this.ariticlative  = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
     if (!this.Page.IsPostBack)
     {
         ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
         if ((article != null) && article.IsRelease)
         {
             PageTitle.AddTitle(article.Title, HiContext.Current.Context);
             if (!string.IsNullOrEmpty(article.MetaKeywords))
             {
                 MetaTags.AddMetaKeywords(article.MetaKeywords, HiContext.Current.Context);
             }
             if (!string.IsNullOrEmpty(article.MetaDescription))
             {
                 MetaTags.AddMetaDescription(article.MetaDescription, HiContext.Current.Context);
             }
             this.litArticleTitle.Text       = article.Title;
             this.litArticleDescription.Text = article.Description;
             string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { this.articleId });
             this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litArticleAddedDate.Time = article.AddedDate;
             ArticleInfo info2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
             if ((info2 != null) && (info2.ArticleId > 0))
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible   = true;
                     this.aFront.HRef        = Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { info2.ArticleId });
                     this.lblFrontTitle.Text = info2.Title;
                 }
             }
             else if (this.lblFront != null)
             {
                 this.lblFront.Visible = false;
             }
             ArticleInfo info3 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
             if ((info3 != null) && (info3.ArticleId > 0))
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible   = true;
                     this.aNext.HRef        = Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[] { info3.ArticleId });
                     this.lblNextTitle.Text = info3.Title;
                 }
             }
             else if (this.lblNext != null)
             {
                 this.lblNext.Visible = false;
             }
             DataSet articlProductList = CommentBrowser.GetArticlProductList(this.articleId);
             if (((articlProductList == null) || (articlProductList.Tables.Count <= 0)) || (articlProductList.Tables[0].Rows.Count <= 0))
             {
                 this.BindList();
             }
             else
             {
                 this.ariticlative.DataSource = articlProductList.Tables[0];
                 this.ariticlative.DataBind();
             }
         }
     }
 }
示例#52
0
        protected void btnAsignar04Q_Click(object sender, EventArgs e)
        {
            bool Continuar = true;
            int  longitud  = 0;

            int.TryParse(txtLongitud04Q.Text, out longitud);
            lblMsjCat04Q.Text = "";

            if (ddlTipo04Q.SelectedValue == "lst" || ddlTipo04Q.SelectedValue == "lchk")
            {
                int Cat_Id = 0;

                int.TryParse(ddlCat04Q.SelectedValue, out Cat_Id);

                if (Cat_Id <= 0)
                {
                    Continuar         = false;
                    lblMsjCat04Q.Text = "Debe seleccionar un catálogo.";
                }
            }

            if (string.IsNullOrWhiteSpace(txtCampoDescQ.Text))
            {
                Continuar         = false;
                lblMsjCat04Q.Text = "Debe ingresar una descripción.";
            }

            if (hddAplicaLongitud.Value == "1")
            {
                if (longitud == 0)
                {
                    Continuar         = false;
                    lblMsjCat04Q.Text = "Debe ingresar una longitud.";
                    txtLongitud04Q.Focus();
                }
            }

            if (Continuar)
            {
                GridViewRow row = grdParamsQ.SelectedRow;

                Label lblE = (Label)row.FindControl("lblEntrada");

                lblE.Text = ddlTipo04Q.SelectedValue;

                Label lblB = (Label)row.FindControl("lblBAprox");

                if (chkAprox04Q.Checked)
                {
                    lblB.Text = "Si";
                }
                else
                {
                    lblB.Text = "No";
                }

                Label lblN = (Label)row.FindControl("lblNull");

                if (chkNull04Q.Checked)
                {
                    lblN.Text = "Si";
                }
                else
                {
                    lblN.Text = "No";
                }

                Label lblD = (Label)row.FindControl("lblDesc");

                lblD.Text = txtCampoDescQ.Text;

                if (ddlTipo04Q.SelectedValue == "lst" || ddlTipo04Q.SelectedValue == "lchk")
                {
                    Label lblC = (Label)row.FindControl("lblCat");

                    lblC.Text = ddlCat04Q.SelectedValue;

                    if (ddlCat04Q.Items.Count > 0)
                    {
                        ddlCat04Q.SelectedIndex = 0;
                    }
                }

                ddlTipo04Q.SelectedIndex = 0;
                pnlTipo04Q.Visible       = false;
                pnlCat04Q.Visible        = false;
                grdParamsQ.SelectedIndex = -1;

                if (longitud < 0)
                {
                    longitud = -1;
                }
                else if (longitud > 8000)
                {
                    longitud = 8000;
                }

                if (hddAplicaLongitud.Value == "1")
                {
                    row.Cells[CeldaLongitud].Text = longitud.ToString();
                }
                else
                {
                    row.Cells[CeldaLongitud].Text = "";
                }

                row.Cells[CeldaTipoDato].Text = ddlTipoDatoQ.SelectedValue.ToLower();
            }
        }
示例#53
0
 private void InitializeComponent()
 {
     this.addButton    = new Button();
     this.label1       = new Label();
     this.label2       = new Label();
     this.versionText  = new TextBox();
     this.pathText     = new TextBox();
     this.browseButton = new Button();
     base.SuspendLayout();
     this.addButton.Location = new Point(12, 0x24);
     this.addButton.Name     = "addButton";
     this.addButton.Size     = new Size(370, 0x17);
     this.addButton.TabIndex = 0;
     this.addButton.Text     = "Add";
     this.addButton.UseVisualStyleBackColor = true;
     this.addButton.Click      += new EventHandler(this.AddButtonClick);
     this.label1.AutoSize       = true;
     this.label1.Location       = new Point(13, 13);
     this.label1.Name           = "label1";
     this.label1.Size           = new Size(0x2d, 13);
     this.label1.TabIndex       = 1;
     this.label1.Text           = "Version:";
     this.label2.AutoSize       = true;
     this.label2.Location       = new Point(0x71, 13);
     this.label2.Name           = "label2";
     this.label2.Size           = new Size(0x20, 13);
     this.label2.TabIndex       = 2;
     this.label2.Text           = "Path:";
     this.versionText.Location  = new Point(0x40, 10);
     this.versionText.MaxLength = 5;
     this.versionText.Name      = "versionText";
     this.versionText.Size      = new Size(0x2b, 20);
     this.versionText.TabIndex  = 3;
     this.pathText.Location     = new Point(0x97, 10);
     this.pathText.Name         = "pathText";
     this.pathText.Size         = new Size(0xa5, 20);
     this.pathText.TabIndex     = 4;
     this.browseButton.Location = new Point(0x142, 9);
     this.browseButton.Name     = "browseButton";
     this.browseButton.Size     = new Size(60, 0x16);
     this.browseButton.TabIndex = 5;
     this.browseButton.Text     = "Browse...";
     this.browseButton.UseVisualStyleBackColor = true;
     this.browseButton.Click += new EventHandler(this.BrowseButtonClick);
     base.AutoScaleDimensions = new SizeF(6f, 13f);
     base.AutoScaleMode       = AutoScaleMode.Font;
     base.ClientSize          = new Size(0x185, 0x42);
     base.Controls.Add(this.browseButton);
     base.Controls.Add(this.pathText);
     base.Controls.Add(this.versionText);
     base.Controls.Add(this.label2);
     base.Controls.Add(this.label1);
     base.Controls.Add(this.addButton);
     base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
     base.MaximizeBox     = false;
     base.MinimizeBox     = false;
     base.Name            = "FrmAddTibiaClient";
     base.ShowInTaskbar   = false;
     base.SizeGripStyle   = SizeGripStyle.Hide;
     base.StartPosition   = FormStartPosition.Manual;
     this.Text            = "Add new Tibia client";
     base.ResumeLayout(false);
     base.PerformLayout();
 }
示例#54
0
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.button1 = new Syncfusion.Windows.Forms.ButtonAdv();
            this.label3 = new System.Windows.Forms.Label();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.label4 = new System.Windows.Forms.Label();
            this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
            this.label20 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.checkBox1 = new Syncfusion.Windows.Forms.Tools.CheckBoxAdv();
            this.checkBox2 = new Syncfusion.Windows.Forms.Tools.CheckBoxAdv();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.label1 = new System.Windows.Forms.Label();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.wordDocxRadioBtn = new Syncfusion.Windows.Forms.Tools.RadioButtonAdv();
            this.wordDocRadioBtn = new Syncfusion.Windows.Forms.Tools.RadioButtonAdv();
            this.pdfRadioBtn = new Syncfusion.Windows.Forms.Tools.RadioButtonAdv();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.checkBox1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.checkBox2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.wordDocxRadioBtn)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.wordDocRadioBtn)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pdfRadioBtn)).BeginInit();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
            this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
            this.button1.BeforeTouchSize = new System.Drawing.Size(108, 23);
            this.button1.BorderStyleAdv = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.Dashed;
            this.button1.ComboEditBackColor = System.Drawing.Color.Silver;
            this.button1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.button1.ForeColor = System.Drawing.Color.White;
            this.button1.IsBackStageButton = false;
            this.button1.KeepFocusRectangle = false;
            this.button1.Location = new System.Drawing.Point(269, 325);
            this.button1.Name = "button1";
            this.button1.Office2007ColorScheme = Syncfusion.Windows.Forms.Office2007Theme.Managed;
            this.button1.Size = new System.Drawing.Size(108, 23);
            this.button1.TabIndex = 26;
            this.button1.Text = "Generate";
            this.button1.UseVisualStyle = true;
            this.button1.UseVisualStyleBackColor = false;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(196, 156);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(87, 13);
            this.label3.TabIndex = 30;
            this.label3.Text = "Number Format";
            // 
            // comboBox1
            // 
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Location = new System.Drawing.Point(284, 153);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(93, 21);
            this.comboBox1.TabIndex = 31;
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(196, 192);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(47, 13);
            this.label4.TabIndex = 32;
            this.label4.Text = "Start at:";
            // 
            // numericUpDown1
            // 
            this.numericUpDown1.Location = new System.Drawing.Point(284, 190);
            this.numericUpDown1.Name = "numericUpDown1";
            this.numericUpDown1.Size = new System.Drawing.Size(93, 22);
            this.numericUpDown1.TabIndex = 33;
            this.numericUpDown1.Value = new decimal(new int[] {
            1,
            0,
            0,
            0});
            // 
            // label20
            // 
            this.label20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(143)))), ((int)(((byte)(164)))), ((int)(((byte)(190)))));
            this.label20.Location = new System.Drawing.Point(199, 133);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(178, 1);
            this.label20.TabIndex = 34;
            // 
            // label5
            // 
            this.label5.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.ForeColor = System.Drawing.Color.Black;
            this.label5.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.label5.Location = new System.Drawing.Point(199, 103);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(102, 27);
            this.label5.TabIndex = 35;
            this.label5.Text = "Page Number";
            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.Color.Black;
            this.label2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.label2.Location = new System.Drawing.Point(7, 103);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(132, 27);
            this.label2.TabIndex = 37;
            this.label2.Text = "Header And Footer";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label6
            // 
            this.label6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(143)))), ((int)(((byte)(164)))), ((int)(((byte)(190)))));
            this.label6.Location = new System.Drawing.Point(7, 133);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(170, 1);
            this.label6.TabIndex = 36;
            // 
            // checkBox1
            // 
            this.checkBox1.BeforeTouchSize = new System.Drawing.Size(186, 29);
            this.checkBox1.Border3DStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
            this.checkBox1.BorderColor = System.Drawing.Color.Black;
            this.checkBox1.Checked = true;
            this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
            this.checkBox1.DrawFocusRectangle = false;
            this.checkBox1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.checkBox1.GradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
            this.checkBox1.GradientStart = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.checkBox1.Location = new System.Drawing.Point(6, 155);
            this.checkBox1.MetroColor = System.Drawing.Color.Gray;
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(186, 29);
            this.checkBox1.StretchImage = false;
            this.checkBox1.Style = Syncfusion.Windows.Forms.Tools.CheckBoxAdvStyle.Metro;
            this.checkBox1.TabIndex = 38;
            this.checkBox1.Tag = "scrolls";
            this.checkBox1.Text = "Header and Footer For First Page";
            this.checkBox1.ThemesEnabled = false;
            // 
            // checkBox2
            // 
            this.checkBox2.BeforeTouchSize = new System.Drawing.Size(182, 32);
            this.checkBox2.Border3DStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
            this.checkBox2.BorderColor = System.Drawing.Color.Black;
            this.checkBox2.Checked = true;
            this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked;
            this.checkBox2.DrawFocusRectangle = false;
            this.checkBox2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.checkBox2.GradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
            this.checkBox2.GradientStart = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.checkBox2.Location = new System.Drawing.Point(6, 190);
            this.checkBox2.MetroColor = System.Drawing.Color.Gray;
            this.checkBox2.Name = "checkBox2";
            this.checkBox2.Size = new System.Drawing.Size(182, 32);
            this.checkBox2.StretchImage = false;
            this.checkBox2.Style = Syncfusion.Windows.Forms.Tools.CheckBoxAdvStyle.Metro;
            this.checkBox2.TabIndex = 39;
            this.checkBox2.Tag = "scrolls";
            this.checkBox2.Text = "Header and Footer For All Pages";
            this.checkBox2.ThemesEnabled = false;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(0, 0);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(389, 82);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.pictureBox1.TabIndex = 61;
            this.pictureBox1.TabStop = false;
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64)))));
            this.label1.Location = new System.Drawing.Point(4, 237);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(373, 56);
            this.label1.TabIndex = 27;
            this.label1.Text = "Click the button to view the generated Word document or PDF. Please note that Microsoft Word Viewer or Microsoft Word is required to view the resultant Word document and PDF viewer is required to view the resultant PDF.";
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.wordDocxRadioBtn);
            this.groupBox1.Controls.Add(this.wordDocRadioBtn);
            this.groupBox1.Controls.Add(this.pdfRadioBtn);
            this.groupBox1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.groupBox1.Location = new System.Drawing.Point(6, 308);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(237, 51);
            this.groupBox1.TabIndex = 101;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Save As";
            // 
            // worddocxRadioBtn
            // 
            this.wordDocxRadioBtn.BeforeTouchSize = new System.Drawing.Size(54, 20);
            this.wordDocxRadioBtn.Border3DStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
            this.wordDocxRadioBtn.Checked = true;
            this.wordDocxRadioBtn.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.wordDocxRadioBtn.GradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
            this.wordDocxRadioBtn.GradientStart = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.wordDocxRadioBtn.Location = new System.Drawing.Point(93, 20);
            this.wordDocxRadioBtn.MetroColor = System.Drawing.Color.Empty;
            this.wordDocxRadioBtn.Name = "wordDocxRadioBtn";
            this.wordDocxRadioBtn.Size = new System.Drawing.Size(54, 20);
            this.wordDocxRadioBtn.TabIndex = 103;
            this.wordDocxRadioBtn.Text = "DOCX";
            this.wordDocxRadioBtn.ThemesEnabled = true;
            // 
            // worddocRadioBtn
            // 
            this.wordDocRadioBtn.BeforeTouchSize = new System.Drawing.Size(47, 20);
            this.wordDocRadioBtn.Border3DStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
            this.wordDocRadioBtn.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
            this.wordDocRadioBtn.GradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
            this.wordDocRadioBtn.GradientStart = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.wordDocRadioBtn.Location = new System.Drawing.Point(6, 20);
            this.wordDocRadioBtn.MetroColor = System.Drawing.Color.Empty;
            this.wordDocRadioBtn.Name = "wordDocRadioBtn";
            this.wordDocRadioBtn.Size = new System.Drawing.Size(47, 20);
            this.wordDocRadioBtn.TabIndex = 44;
            this.wordDocRadioBtn.Text = "DOC";
            this.wordDocRadioBtn.ThemesEnabled = true;
            // 
            // pdfRadioBtn
            // 
            this.pdfRadioBtn.BeforeTouchSize = new System.Drawing.Size(45, 20);
            this.pdfRadioBtn.Border3DStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
            this.pdfRadioBtn.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(161)));
            this.pdfRadioBtn.GradientEnd = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
            this.pdfRadioBtn.GradientStart = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.pdfRadioBtn.Location = new System.Drawing.Point(192, 20);
            this.pdfRadioBtn.MetroColor = System.Drawing.Color.Empty;
            this.pdfRadioBtn.Name = "pdfRadioBtn";
            this.pdfRadioBtn.Size = new System.Drawing.Size(45, 20);
            this.pdfRadioBtn.TabIndex = 45;
            this.pdfRadioBtn.Text = "PDF";
            this.pdfRadioBtn.ThemesEnabled = true;
            // 
            // Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
            this.BackColor = System.Drawing.Color.White;
            this.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
            this.ClientSize = new System.Drawing.Size(389, 373);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.checkBox2);
            this.Controls.Add(this.checkBox1);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.comboBox1);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.label20);
            this.Controls.Add(this.numericUpDown1);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.label1);
            this.DropShadow = true;
            this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Header and Footer";
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.checkBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.checkBox2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.groupBox1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.wordDocxRadioBtn)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.wordDocRadioBtn)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pdfRadioBtn)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
        private void DrawBars(Graphics gr, Bitmap bmpChart)
        {
            #region Variables
            HBarData bar;
            RectangleF rectBar = new Rectangle();
            SizeF sizeDesc = Size.Empty;
            SizeF sizeBar = Size.Empty;
            float nLabelHeight = 0;
            float fValueHeight = 0;
            float nStartX = 0;
            #endregion

            if (description == null) return;
            if (label == null) return;
            if (values == null) return;

            // Store some original values
            #region StoreObjects

            int nLastBarGaps = nBarsGap;
            //Font fntTip = fontTooltip;

            Description.SaveObject();
            Label.SaveObject();
            Values.SaveObject();

            #endregion

            #region Calculations
            if (SizingMode == BarSizingMode.AutoScale)
            {
                // Calculate gap size
                if (bars.Count > 0) nBarsGap = 4 + (12 * bmpChart.Size.Width) / (int)(345 * bars.Count * 7);
                if (nBarsGap > 50) nBarsGap = 50;

                // Calculate maximum bar size
                sizeBar = new SizeF(this.nBarWidth, bmpChart.Size.Height - 2 * nBarsGap);
                if (bars.Count > 0) sizeBar.Width = (bmpChart.Size.Width - ((bars.Count + 1) * nBarsGap)) / bars.Count;
                if (sizeBar.Width <= 0) sizeBar.Width = 24;

                // Calcuate font sizes & create fonts
                CreateLabelFont(gr, sizeBar);
                nLabelHeight = Label.Font.GetHeight(gr);

                CreateValueFont(gr, sizeBar);
                fValueHeight = Values.Font.GetHeight(gr);

                CreateDescFont(gr, bmpChart.Size);
                sizeDesc = new SizeF(bmpChart.Size.Width - 2 * nBarsGap, description.Font.GetHeight(gr) + 2 * nBarsGap);

                // Calculate actual bar size (depends to font sizes)
                if (description.Visible) sizeBar.Height -= sizeDesc.Height;
                if (Label.Visible) sizeBar.Height -= nLabelHeight;
                if (Values.Visible) sizeBar.Height -= fValueHeight;
                nStartX = this.ClientRectangle.Left;
            }
            else if (SizingMode == BarSizingMode.Normal)
            {
                //fontTooltip = fntTip;
                Values.RestoreObject();
                nBarsGap = nLastBarGaps;

                Description.RestoreObject();
                Label.RestoreObject();

                float fFntHeight = description.Font.GetHeight(gr) + 2 * nBarsGap;
                sizeDesc = new SizeF(bmpChart.Size.Width - 2 * nBarsGap, fFntHeight);

                nLabelHeight = Label.Font.GetHeight(gr);
                fValueHeight = Values.Font.GetHeight(gr);

                sizeBar = new SizeF(this.nBarWidth, bmpChart.Size.Height - 2 * nBarsGap);
                if (Description.Visible) sizeBar.Height -= sizeDesc.Height;
                if (Label.Visible) sizeBar.Height -= nLabelHeight;
                if (Values.Visible) sizeBar.Height -= fValueHeight;

                // Bars start from here (This align graph to the center of the control)
                nStartX = (bmpChart.Size.Width - bars.Count * sizeBar.Width - (bars.Count + 1) * nBarsGap) / 2;
            }
            #endregion

            // Draw description label
            if (description.Visible)
            {

                StringFormat stringFormat = StringFormat.GenericDefault;
                stringFormat.LineAlignment = StringAlignment.Center;
                stringFormat.Alignment = StringAlignment.Center;
                stringFormat.Trimming = StringTrimming.None;
                stringFormat.FormatFlags = StringFormatFlags.NoWrap |
                                            StringFormatFlags.LineLimit;

                gr.DrawString(
                    description.Text,
                    description.Font,
                    new SolidBrush(description.Colour),
                    new RectangleF(
                        nBarsGap,
                        bmpChart.Height - sizeDesc.Height,
                        sizeDesc.Width,
                        sizeDesc.Height),
                        stringFormat);
            }

            // Draw bars (A bar, label and it's value)
            for (int i = 0; i < bars.Count; i++)
            {
                if (bars.GetAt(i, out bar))
                {
                    rectBar.Width = sizeBar.Width;
                    rectBar.Height = (float)((bar.Value * sizeBar.Height) / bars.MaxValue);
                    rectBar.X = nStartX + i * sizeBar.Width + (i + 1) * nBarsGap;
                    rectBar.Y = nBarsGap + sizeBar.Height - rectBar.Height;
                    if (Values.Visible) rectBar.Y += fValueHeight;


                    // Set this bar rectangle area on screen. This will be used later for displaying
                    // tooltips for example. Note that the saved value is not the bar bounding rectangle
                    // it's the rectangle that bar is drawn inside, so height might be longer than
                    // the bar.
                    // If you need to have exact rectangle, replace current value with commented value below
                    bar.BarRect = new RectangleF(rectBar.Left, /*rectBar.Top*/0, sizeBar.Width, /*sizeBar.Height*/ this.ClientRectangle.Height);

                    DrawBar(gr, rectBar, bar);
                }
            }

            // restore values that changed during the transition to auto scale mode
            #region RestoreObjects

            nBarsGap = nLastBarGaps;
            //fontTooltip = fntTip;
            Description.RestoreObject();
            Label.RestoreObject();
            Values.RestoreObject();

            #endregion
        }
示例#56
0
        private void InitializeComponent()
        {
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(WF_About));

            this.labelCopyright     = new Label();
            this.labelProductName   = new Label();
            this.button1            = new Button();
            this.labelConfig        = new Label();
            this.labelFileVersion   = new Label();
            this.textBoxDescription = new Label();
            this.pictureBox1        = new PictureBox();
            this.labelCompanyName   = new Label();
            this.labelVersion       = new Label();
            this.Authorization      = new Label();
            this.Copy              = new Button();
            this.label1            = new Label();
            this.trialday          = new Label();
            this.license           = new Label();
            this.label2            = new Label();
            this.label3            = new Label();
            this.tableLayoutPanel1 = new TableLayoutPanel();
            this.A_Code            = new TextBox();
            this.textBox1          = new TextBox();
            this.button2           = new Button();
            this.linkLabel2        = new LinkLabel();
            this.linkLabel1        = new LinkLabel();
            ((ISupportInitialize)this.pictureBox1).BeginInit();
            this.tableLayoutPanel1.SuspendLayout();
            base.SuspendLayout();
            this.labelCopyright.AutoSize   = true;
            this.labelCopyright.Location   = new Point(3, 150);
            this.labelCopyright.Name       = "labelCopyright";
            this.labelCopyright.Size       = new Size(73, 13);
            this.labelCopyright.TabIndex   = 2;
            this.labelCopyright.Text       = "labelCopyright";
            this.labelProductName.AutoSize = true;
            this.labelProductName.Location = new Point(3, 30);
            this.labelProductName.Name     = "labelProductName";
            this.labelProductName.Size     = new Size(94, 13);
            this.labelProductName.TabIndex = 3;
            this.labelProductName.Text     = "labelProductName";
            this.button1.Location          = new Point(504, 268);
            this.button1.Name     = "button1";
            this.button1.Size     = new Size(75, 23);
            this.button1.TabIndex = 4;
            this.button1.Text     = "OK";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click              += this.button1_Click;
            this.labelConfig.AutoSize        = true;
            this.labelConfig.Location        = new Point(3, 90);
            this.labelConfig.Name            = "labelConfig";
            this.labelConfig.Size            = new Size(59, 13);
            this.labelConfig.TabIndex        = 12;
            this.labelConfig.Text            = "labelConfig";
            this.labelFileVersion.AutoSize   = true;
            this.labelFileVersion.Location   = new Point(3, 120);
            this.labelFileVersion.Name       = "labelFileVersion";
            this.labelFileVersion.Size       = new Size(80, 13);
            this.labelFileVersion.TabIndex   = 11;
            this.labelFileVersion.Text       = "labelFileVersion";
            this.textBoxDescription.AutoSize = true;
            this.textBoxDescription.Location = new Point(3, 180);
            this.textBoxDescription.Name     = "textBoxDescription";
            this.textBoxDescription.Size     = new Size(95, 13);
            this.textBoxDescription.TabIndex = 10;
            this.textBoxDescription.Text     = "textBoxDescription";
            this.pictureBox1.ErrorImage      = null;
            this.pictureBox1.Image           = Resources.gear;
            this.pictureBox1.Location        = new Point(12, 12);
            this.pictureBox1.Name            = "pictureBox1";
            this.pictureBox1.Size            = new Size(250, 250);
            this.pictureBox1.SizeMode        = PictureBoxSizeMode.StretchImage;
            this.pictureBox1.TabIndex        = 9;
            this.pictureBox1.TabStop         = false;
            this.labelCompanyName.AutoSize   = true;
            this.labelCompanyName.Location   = new Point(3, 0);
            this.labelCompanyName.Name       = "labelCompanyName";
            this.labelCompanyName.Size       = new Size(101, 13);
            this.labelCompanyName.TabIndex   = 8;
            this.labelCompanyName.Text       = "labelCompanyName";
            this.labelVersion.AutoSize       = true;
            this.labelVersion.Location       = new Point(3, 60);
            this.labelVersion.Name           = "labelVersion";
            this.labelVersion.Size           = new Size(64, 13);
            this.labelVersion.TabIndex       = 6;
            this.labelVersion.Text           = "labelVersion";
            this.Authorization.AutoSize      = true;
            this.Authorization.Location      = new Point(9, 294);
            this.Authorization.Name          = "Authorization";
            this.Authorization.Size          = new Size(75, 13);
            this.Authorization.TabIndex      = 13;
            this.Authorization.Text          = "Request Code";
            this.Authorization.Visible       = false;
            this.Copy.Image    = Resources.page_copy;
            this.Copy.Location = new Point(549, 304);
            this.Copy.Name     = "Copy";
            this.Copy.Size     = new Size(30, 30);
            this.Copy.TabIndex = 15;
            this.Copy.UseVisualStyleBackColor = true;
            this.Copy.Visible                  = false;
            this.Copy.Click                   += this.Copy_Click;
            this.label1.AutoSize               = true;
            this.label1.Location               = new Point(9, 338);
            this.label1.Name                   = "label1";
            this.label1.Size                   = new Size(65, 13);
            this.label1.TabIndex               = 16;
            this.label1.Text                   = "Active Code";
            this.label1.Visible                = false;
            this.trialday.AutoSize             = true;
            this.trialday.Location             = new Point(9, 273);
            this.trialday.Name                 = "trialday";
            this.trialday.Size                 = new Size(49, 13);
            this.trialday.TabIndex             = 18;
            this.trialday.Text                 = "Trial Day";
            this.trialday.Visible              = false;
            this.license.AutoSize              = true;
            this.license.Location              = new Point(3, 210);
            this.license.Name                  = "license";
            this.license.Size                  = new Size(44, 13);
            this.license.TabIndex              = 13;
            this.license.Text                  = "License";
            this.label2.AutoSize               = true;
            this.label2.Location               = new Point(271, 249);
            this.label2.Name                   = "label2";
            this.label2.Size                   = new Size(81, 13);
            this.label2.TabIndex               = 14;
            this.label2.Text                   = "Support Email : ";
            this.label3.AutoSize               = true;
            this.label3.Location               = new Point(11, 273);
            this.label3.Name                   = "label3";
            this.label3.Size                   = new Size(60, 13);
            this.label3.TabIndex               = 21;
            this.label3.Text                   = "Web Site : ";
            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f));
            this.tableLayoutPanel1.Controls.Add(this.labelCompanyName, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.textBoxDescription, 0, 6);
            this.tableLayoutPanel1.Controls.Add(this.labelFileVersion, 0, 4);
            this.tableLayoutPanel1.Controls.Add(this.labelConfig, 0, 3);
            this.tableLayoutPanel1.Controls.Add(this.labelProductName, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.labelVersion, 0, 2);
            this.tableLayoutPanel1.Controls.Add(this.labelCopyright, 0, 5);
            this.tableLayoutPanel1.Controls.Add(this.license, 0, 7);
            this.tableLayoutPanel1.Location = new Point(268, 12);
            this.tableLayoutPanel1.Name     = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 8;
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 30f));
            this.tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f));
            this.tableLayoutPanel1.Size     = new Size(314, 228);
            this.tableLayoutPanel1.TabIndex = 13;
            this.A_Code.Location            = new Point(12, 310);
            this.A_Code.Name       = "A_Code";
            this.A_Code.ReadOnly   = true;
            this.A_Code.Size       = new Size(531, 20);
            this.A_Code.TabIndex   = 14;
            this.A_Code.Visible    = false;
            this.textBox1.Location = new Point(12, 354);
            this.textBox1.Name     = "textBox1";
            this.textBox1.Size     = new Size(567, 20);
            this.textBox1.TabIndex = 17;
            this.textBox1.Visible  = false;
            this.button2.Location  = new Point(426, 388);
            this.button2.Name      = "button2";
            this.button2.Size      = new Size(75, 23);
            this.button2.TabIndex  = 19;
            this.button2.Text      = "Active";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Visible         = false;
            this.button2.Click          += this.button2_Click;
            this.linkLabel2.AutoSize     = true;
            this.linkLabel2.Location     = new Point(349, 249);
            this.linkLabel2.Name         = "linkLabel2";
            this.linkLabel2.Size         = new Size(133, 13);
            this.linkLabel2.TabIndex     = 20;
            this.linkLabel2.TabStop      = true;
            this.linkLabel2.Text         = "*****@*****.**";
            this.linkLabel2.LinkClicked += this.linkLabel2_LinkClicked;
            this.linkLabel1.AutoSize     = true;
            this.linkLabel1.Location     = new Point(69, 273);
            this.linkLabel1.Name         = "linkLabel1";
            this.linkLabel1.Size         = new Size(190, 13);
            this.linkLabel1.TabIndex     = 22;
            this.linkLabel1.TabStop      = true;
            this.linkLabel1.Text         = "https://hotgearproject.wordpress.com/";
            this.linkLabel1.LinkClicked += this.linkLabel1_LinkClicked;
            base.AutoScaleDimensions     = new SizeF(6f, 13f);
            base.AutoScaleMode           = AutoScaleMode.Font;
            base.ClientSize              = new Size(601, 296);
            base.Controls.Add(this.linkLabel1);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.linkLabel2);
            base.Controls.Add(this.button2);
            base.Controls.Add(this.trialday);
            base.Controls.Add(this.textBox1);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.Copy);
            base.Controls.Add(this.A_Code);
            base.Controls.Add(this.Authorization);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.tableLayoutPanel1);
            base.Controls.Add(this.pictureBox1);
            base.Controls.Add(this.button1);
            base.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            base.Icon            = (Icon)componentResourceManager.GetObject("$this.Icon");
            base.Name            = "WF_About";
            this.Text            = "About";
            ((ISupportInitialize)this.pictureBox1).EndInit();
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            base.ResumeLayout(false);
            base.PerformLayout();
        }
示例#57
0
 private void cbbShiftRulecycName_SelectedIndexChanged(object sender, EventArgs e)
 {
     txtShiftRulecyc.Enabled = cbbShiftRulecycName.SelectedIndex == 0;
     if (cbbShiftRulecycName.SelectedIndex == 0)
     {
         foreach (Control control in this.groupBox1.Controls)
         {
             control.Visible = false;
         }
         if (txtShiftRulecyc.Text.ToString() == "")
         {
             txtShiftRulecyc.Text = "1";
         }
         if (int.Parse(txtShiftRulecyc.Text) > 31)
         {
             txtShiftRulecyc.Text = "1";
         }
         for (int No = 1; No <= int.Parse(txtShiftRulecyc.Text.Trim()); No++)
         {
             ComboBox cbb = (ComboBox)this.groupBox1.Controls["cbb" + No.ToString()];
             Label    lbl = (Label)this.groupBox1.Controls["lbl" + No.ToString()];
             lbl.Visible = true;
             cbb.Visible = true;
         }
     }
     else if (cbbShiftRulecycName.SelectedIndex == 1)
     {
         foreach (Control control in this.groupBox1.Controls)
         {
             control.Visible = false;
         }
         txtShiftRulecyc.Text = "7";
         label32.Visible      = true;
         label33.Visible      = true;
         label34.Visible      = true;
         label35.Visible      = true;
         label36.Visible      = true;
         label37.Visible      = true;
         label38.Visible      = true;
         for (int No = 1; No <= 7; No++)
         {
             ComboBox cbb = (ComboBox)this.groupBox1.Controls["cbb" + No.ToString()];
             cbb.Visible = true;
         }
     }
     else if (cbbShiftRulecycName.SelectedIndex == 2)
     {
         foreach (Control control in this.groupBox1.Controls)
         {
             control.Visible = false;
         }
         txtShiftRulecyc.Text = "31";
         for (int No = 1; No <= 31; No++)
         {
             ComboBox cbb = (ComboBox)this.groupBox1.Controls["cbb" + No.ToString()];
             Label    lbl = (Label)this.groupBox1.Controls["lbl" + No.ToString()];
             lbl.Visible = true;
             cbb.Visible = true;
         }
     }
 }
示例#58
0
        /// <summary>
        /// 初期化する
        /// </summary>
        /// <param name="pluginScreenSpace">Pluginタブ</param>
        /// <param name="pluginStatusText">Pluginステータスラベル</param>
        void IActPluginV1.InitPlugin(
            TabPage pluginScreenSpace,
            Label pluginStatusText)
        {
            try
            {
                Logger.Begin();
                Logger.Write("Plugin Start.");

                // WPFアプリケーションを開始する
                if (System.Windows.Application.Current == null)
                {
                    new System.Windows.Application()
                    {
                        ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown
                    };
                }

                // 設定ファイルを読み込む
                Settings.Default.Load();

                pluginScreenSpace.Text = Translate.Get("LN_Tabname");
                this.PluginStatusLabel = pluginStatusText;

                // アップデートを確認する
                Task.Run(() =>
                {
                    this.Update();
                });

                // 自身の場所を格納しておく
                var plugin = ActGlobals.oFormActMain.PluginGetSelfData(this);
                if (plugin != null)
                {
                    SpecialSpellTimerPlugin.Location = plugin.pluginFile.DirectoryName;
                }

                // 設定Panelを追加する
                ConfigPanel = new ConfigPanel();
                pluginScreenSpace.Controls.Add(ConfigPanel);
                ConfigPanel.Size   = pluginScreenSpace.Size;
                ConfigPanel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;

                // 設定ファイルのバックアップを作成する
                SpellTimerTable.Backup();
                OnePointTelopTable.Default.Backup();
                PanelSettings.Default.Backup();

                // 本体を開始する
                SpellTimerCore.Default.Begin();

                this.SetSwitchVisibleButton();
                this.PluginStatusLabel.Text = "Plugin Started";

                Logger.Write("Plugin Started.");
            }
            catch (Exception ex)
            {
                Logger.Write(Utility.Translate.Get("ACTPluginStartError"), ex);

                this.PluginStatusLabel.Text = "Plugin Initialize Error";
            }
        }
示例#59
0
 public override void _Ready()
 {
     _global = (Global) GetNode("/root/Global");
     _score = GetNode<Label>("MarginContainer/ScoreLabel");
     _score.Text = Convert.ToString(_global.Score);
 }
        public SkyddarePageCS()
        {
            Title = "Skyddare";

            Label resultsLabel;
            resultsLabel = new Label
            {
                Text = "Result will appear here.",
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            searchBar = new SearchBar
            {
                Placeholder = "Sök personer...",
                SearchCommand = new Command(() => { resultsLabel.Text = "Result: " + searchBar.Text + " is what you asked for."; })
            };
            /*
            TableView tableView = new TableView
            {
                
                Intent = TableIntent.Form,
                Root = new TableRoot
                {


                    new TableSection("Här väljer du skyddare")
                    {
                        new SwitchCell
                        {
                            Text = "Alla användare av den här applikationen:"
                        }

                    }
                }
            };*/
            Switch sw = new Switch
            {
                HorizontalOptions = LayoutOptions.EndAndExpand
            };

            Label lb = new Label
            {
                Text = " Alla användare av den här applikationen:",
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions = LayoutOptions.CenterAndExpand
            };
            



            Content = new StackLayout
            {
                
                Children =
                {
                    new StackLayout {
                        Padding = new Thickness(10,15,10,0),
                        Orientation = StackOrientation.Horizontal,
                        Children = {
                        lb, sw
                        }
                    },
                    searchBar
                }
            };

        }