Inheritance: MonoBehaviour
コード例 #1
0
        private void addUI()
        {
            Panel panel = new Panel();
            panel.Width = Director.Instance.GL.Context.GetViewport().Width;
            panel.Height = Director.Instance.GL.Context.GetViewport().Height;
            ImageBox backgroundImageBox = new ImageBox();
            backgroundImageBox.Width = panel.Width;
            backgroundImageBox.Height = panel.Height;
            backgroundImageBox.SetPosition(0.0f,0.0f);
            backgroundImageBox.Image = new ImageAsset(backgroundImagePath, false);

            Button playButton = new Button();
            playButton.Name = "Play Game";
            playButton.Text = "Play Game";
            playButton.Width = 300;
            playButton.Height = 50;
            playButton.Alpha = 0.8f;
            playButton.SetPosition(panel.Width/2 - 150, 200.0f);
            playButton.TouchEventReceived += (sender, e) => {
                Director.Instance.ReplaceScene(new MainGameScene());
            };

            panel.AddChildLast(backgroundImageBox);
            panel.AddChildLast(playButton);

            this.uiScene = new Sce.PlayStation.HighLevel.UI.Scene();
            this.uiScene.RootWidget.AddChildLast(panel);
            UISystem.SetScene(this.uiScene);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: mono/gert
	public MainForm ()
	{
		_resizeControl = new ResizeControl ();
		// 
		// _panel
		// 
		_panel = new Panel ();
		_panel.Anchor = ((AnchorStyles) ((((AnchorStyles.Top | AnchorStyles.Bottom)
					| AnchorStyles.Left)
					| AnchorStyles.Right)));
		_panel.BackColor = SystemColors.Window;
		_panel.Controls.Add (_resizeControl);
		_panel.Location = new Point (12, 25);
		_panel.Size = new Size (265, 230);
		_panel.TabIndex = 0;
		Controls.Add (_panel);
		// 
		// _resizeControl
		// 
		_resizeControl.Dock = DockStyle.Fill;
		_resizeControl.Location = new Point (0, 0);
		_resizeControl.Size = new Size (795, 265);
		_resizeControl.TabIndex = 0;
		// 
		// MainForm
		// 
		ClientSize = new Size (500, 326);
		Location = new Point (100, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81199";
		Load += new EventHandler (MainForm_Load);
	}
コード例 #4
0
ファイル: TaskAutoScroll.cs プロジェクト: GodLesZ/svn-dump
		public TaskAutoScroll(Manager manager)
			: base(manager) {
			Height = 360;
			MinimumHeight = 99;
			MinimumWidth = 78;
			Text = "Auto Scrolling";
			Center();

			pnl1 = new Panel(manager);
			pnl1.Init();
			pnl1.Parent = this;
			pnl1.Width = 400;
			pnl1.Height = 180;
			pnl1.Left = 20;
			pnl1.Top = 20;
			pnl1.BevelBorder = EBevelBorder.All;
			pnl1.BevelStyle = EBevelStyle.Flat;
			pnl1.BevelMargin = 1;
			pnl1.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
			pnl1.AutoScroll = true;

			pnl2 = new Panel(manager);
			pnl2.Init();
			pnl2.Parent = this;
			pnl2.Width = 400;
			pnl2.Height = 320;
			pnl2.Left = 40;
			pnl2.Top = 80;
			pnl2.BevelBorder = EBevelBorder.All;
			pnl2.BevelStyle = EBevelStyle.Flat;
			pnl2.BevelMargin = 1;
			pnl2.Text = "2";
			pnl2.Anchor = EAnchors.Left | EAnchors.Top;
			pnl2.Color = Color.White;
		}
コード例 #5
0
ファイル: career.aspx.cs プロジェクト: jacqueline27hh/Dryden
 private void _panelControl(Panel pnl)
 {
     pnl_all.Visible = false;
     pnl_delete.Visible = false;
     pnl_update.Visible = false;
     pnl.Visible = true;
 }
コード例 #6
0
ファイル: Map.cs プロジェクト: zdawson/Marooned
        public Map(Panel hud)
            : base(hud)
        {
            Visible = false;

            hud.OnResize += () => LayoutInvalidate(); //< Force ourselves to remake our layout.
        }
コード例 #7
0
	private void displayInformationForUnit(IGameEntity entity) {

		//Remove previous values
		hideExtendedInformationPanel();
		    
		//Display window info
		windowInfo.GetComponent<Image>().enabled = true;

		currentPanel = Panel.UNIT;
		currentObject = (MonoBehaviour)entity;
		
		List<String> titles = new List<String>();
		titles.Add("Attack rate");
		titles.Add("Attack range");
		titles.Add("Movement rate");
		titles.Add("Resistance");
		titles.Add("Sight range");
		titles.Add("Strenght");
		titles.Add("Weapon Ability");
		List<String> values = new List<String>();
		values.Add(entity.info.unitAttributes.attackRate.ToString());
		values.Add(entity.info.unitAttributes.attackRange.ToString());
		values.Add(entity.info.unitAttributes.movementRate.ToString());
		values.Add(entity.info.unitAttributes.resistance.ToString());
		values.Add(entity.info.unitAttributes.sightRange.ToString());
		values.Add(entity.info.unitAttributes.strength.ToString());
		values.Add(entity.info.unitAttributes.weaponAbility.ToString());
		displayInformation(titles, values);
	}
コード例 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (projects_directory == null)
        {
            projects_directory = new Panel();

            // Generate Projects Row (bottom projects directory) based on contents of Projects folder
            string[] files = { "ConcurrentContainers", "WiiMotion", "GameBoyEmulator", "SerializeQueue", "BubbleGrow", "GreyWeaver", "PreviewLite" };
            foreach (string file_name in files)
            {
                Panel panel = new Panel();
                panel.CssClass = "col-sm-3 col-xs-6";

                HyperLink link = new HyperLink();
                link.NavigateUrl = "~/Projects/" + file_name + ".aspx";

                Image image = new Image();
                image.CssClass = "img-responsive portfolio-item";
                image.ImageUrl = "~/data/" + file_name + ".png";

                link.Controls.Add(image);
                panel.Controls.Add(link);
                projects_directory.Controls.Add(panel);
            }
        }

        ProjectsRow.Controls.Add(projects_directory);
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PrintSettingBLL.Reload();

        int campID = Request["CampaignID"].ToInt();
        string rptType = Request["RptType"];

        if (campID == 0
            || string.IsNullOrEmpty(rptType)) return;

        ReportType type = (ReportType)rptType.ToInt();

        List<Donation> pl = DonationBLL.Get(campID, type);

        foreach (Donation item in pl)
        {
            Panel p = new Panel();
            p.Style.Add("position", "relative");
            p.Style.Add("page-break-after", "always");

            p.Style.Apply(PrintSettingBLL.Envelope.PaperSize);

            p.Style.Add("border", "1px solid white");
            divCon.Controls.Add(p);

            AddControl(item, p);

        }
    }
コード例 #10
0
ファイル: Node4Calculator.cs プロジェクト: baguio/SSC-AI
        public static void Calculate22 (List<Node> result, Beat beat, int distance_from_start, Panel a, Panel b, Panel c, Panel d) {
            if (!Panel.IsBracketable(a.index, b.index) || !Panel.IsBracketable(c.index, d.index)) { return; }
            bool is_force_tap = beat.hasTapTypeOrNoneOnly(TapType.Force);

            Iterate.Foot2((foot_a, foot_b) => {
                Iterate.Part2(foot_a, a.index, b.index, (a_0, a_1) => {
                    Iterate.Part2(foot_b, c.index, d.index, (b_0, b_1) => {
                        if (
                            is_force_tap &&
                            (
                                a_0 == Limb.INDEX_EXTRA ||
                                a_1 == Limb.INDEX_EXTRA ||
                                b_0 == Limb.INDEX_EXTRA ||
                                b_1 == Limb.INDEX_EXTRA
                            )
                        ) {
                            return;
                        }

                        Node state = new Node(beat.second, distance_from_start);
                        state.limbs[foot_a] = new Limb();
                        state.limbs[foot_a][a_0] = new Part(beat, a);
                        state.limbs[foot_a][a_1] = new Part(beat, b);
                        state.limbs[foot_b] = new Limb();
                        state.limbs[foot_b][b_0] = new Part(beat, c);
                        state.limbs[foot_b][b_1] = new Part(beat, d);
                        state.sanityCheck();
                        result.Add(state);
                    });
                });
            });
        }
コード例 #11
0
ファイル: Node4Calculator.cs プロジェクト: baguio/SSC-AI
        public static void Calculate31 (List<Node> result, Beat beat, int distance_from_start, Panel a, Panel b, Panel c, Panel d) {
            if (!Panel.IsBracketable(a.index, b.index, c.index)) { return; }

            Iterate.Foot2((foot_a, foot_b) => {
                Iterate.Part1(foot_b, (b_0) => {
                    {
                        Node state = new Node(beat.second, distance_from_start);
                        state.limbs[foot_a] = new Limb();
                        LimbHelper.Do3Bracket(state, foot_a, true, beat, a, b, c);
                        state.limbs[foot_b] = new Limb();
                        state.limbs[foot_b][b_0] = new Part(beat, d);
                        state.sanityCheck();
                        result.Add(state);
                    }
                    {
                        Node state = new Node(beat.second, distance_from_start);
                        state.limbs[foot_a] = new Limb();
                        LimbHelper.Do3Bracket(state, foot_a, false, beat, a, b, c);
                        state.limbs[foot_b] = new Limb();
                        state.limbs[foot_b][b_0] = new Part(beat, d);
                        state.sanityCheck();
                        result.Add(state);
                    }
                });
            });
        }
コード例 #12
0
        public DemoScreen()
        {
            this.mainMenuPanel = new Panel { Size = new Size(30, 30), RelativeLocation = new Coordinate(2, 1) };
            this.Controls.Add(this.mainMenuPanel);

            this.mainMenuTextLabel =
                new Label
                {
                    Size = new Size(30, 7),
                    Text = "This is the main menu. You can select items with the UP and DOWN arrows or the W and S keys (this can be customized). Press enter if you want to see the presentation."
                };
            this.mainMenuPanel.Controls.Add(mainMenuTextLabel);

            this.mainMenu = new Menu<Action> { RelativeLocation = new Coordinate(0, 7), Size = new Size(15, 10) };
            this.mainMenu.Items.Add(new MenuItem<Action>("Label", this.ShowLabelDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("ListView", this.ShowListViewDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("TextBox", this.ShowTextBoxDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Rectangle", this.ShowRectangleDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Line", this.ShowLineDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Ellipse", this.ShowEllipseDemo));
            this.mainMenu.Items.Add(new MenuItem<Action>("Exit", this.Exit));

            this.mainMenu.UpKeys.Add(ConsoleKey.W);
            this.mainMenu.DownKeys.Add(ConsoleKey.S);

            this.mainMenu.ItemChosen += mainMenu_ItemChosen;

            this.mainMenuPanel.Controls.Add(this.mainMenu);
        }
コード例 #13
0
ファイル: SimpleText.cs プロジェクト: queer1/Gaymer2.0
    public override void AddDisplay(Panel panel, int contentId, int inputDataId)
    {
        var p = new Dictionary<string, object> {{"@InputDataId", inputDataId}};
        string CSSclassName = ManageDB.GetFirstValueFromQuery<string>(@"
                SELECT      eic.CSSclass
                FROM        ElementInContent AS eic INNER JOIN
                            InputDataSimpleText AS idt ON eic.Id = idt.ElementInContentId
                WHERE       (idt.id = @InputDataId)
            ", p);

        Label lblLabel = new Label();
        lblLabel.CssClass = CSSclassName + "_label";
        lblLabel.Text = GetLabelValue(inputDataId);

        Label lblValue = new Label();
        lblValue.CssClass = CSSclassName + "_value";
        lblValue.Text = GetLabelValue(inputDataId);

        GenericContent.AddHtmlToPanel("<div id=\"inputElementData_" + inputDataId + "\">", panel);
        panel.Controls.Add(lblLabel);
        GenericContent.AddHtmlToPanel("<br />", panel);
        panel.Controls.Add(lblValue);
        GenericContent.AddHtmlToPanel("</div>", panel);

    }
コード例 #14
0
            public BorderlessWindow()
            {
                this.SuspendLayout();
                this.AutoScaleDimensions = new SizeF(6F, 13F);
                this.AutoScaleMode = AutoScaleMode.Font;
                this.FormBorderStyle = FormBorderStyle.None;
                this.Size = new Size(800, 600);
                this.MinimumSize = new Size(144, 36); // 4:1 size ratio
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.Name = "BorderlessWindow";
                this.Text = "";

                CreateSystemButtonImages(this.BackColor);

                SystemButtonClose = CreateSystemButton(SystemButtonCloseKey, GetSystemButtonsLocation());
                SystemButtonMaximize = CreateSystemButton(SystemButtonMaximizeKey, SystemButtonClose.Left - 36);
                SystemButtonMinimize = CreateSystemButton(SystemButtonMinimizeKey, SystemButtonMaximize.Left - 36);
                PanelClientArea = CreateClientAreaPanel();

                SystemButtonMinimize.Click += new System.EventHandler(this.OnSystemButtonMinimizeClick);
                SystemButtonMaximize.Click += new System.EventHandler(this.OnSystemButtonMaximizeClick);
                SystemButtonClose.Click += new System.EventHandler(this.OnSystemButtonCloseClick);

                this.Controls.Add(SystemButtonMinimize);
                this.Controls.Add(SystemButtonMaximize);
                this.Controls.Add(SystemButtonClose);
                this.Controls.Add(PanelClientArea);
                this.ResumeLayout(false);
            }
コード例 #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        List<Event> events = Event.GetAllEvents();

        foreach (Event selectedEvent in events)
        {
            Panel pnlEvent = new Panel();
            pnlEvent.ID = selectedEvent.ID.ToString();
            pnlEvent.Attributes.Add("class", "panel");
            CheckBox chkbxEventName = new CheckBox();
            chkbxEventName.ID = "chkbx" + selectedEvent.Name;
            chkbxEventName.Text = selectedEvent.Name;
            pnlEvent.Controls.Add(chkbxEventName);
            for (int i = 0; i < selectedEvent.MaxTeamSize; i++)
            {
                TextBox txtbxTTID = new TextBox();
                txtbxTTID.ID = "TTID" + (i + 1).ToString() + selectedEvent.ID;
                txtbxTTID.Attributes.Add("placeholder", "TTID " + (i + 1).ToString());
                txtbxTTID.Attributes.Add("style", "display:none;");
                pnlEvent.Controls.Add(txtbxTTID);
                RegularExpressionValidator rev = new RegularExpressionValidator();
                rev.ControlToValidate = txtbxTTID.ClientID;
                rev.Attributes.Add("style", "display:none;");
                rev.ValidationExpression = "\\d{4}";
                rev.ErrorMessage = "*";
                pnlEvent.Controls.Add(rev);
            }
            pnlEvents.Controls.Add(pnlEvent);
        }
    }
コード例 #16
0
        public static void UpdateDomainModel(this PanelDto panelDto, Panel panel)
        {
            ValidateUpdateOfDomainModel(panelDto, panel);

            panel.Name = panelDto.Name;
            panel.AdvertiserId = panelDto.AdvertiserId;
        }
コード例 #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     List<Event> events = Event.GetAllEvents();
     foreach (Event ev in events)
     {
         Panel pnlEvent = new Panel();
         pnlEvent.ID = ev.ID.ToString();
         Label lblEventName = new Label();
         lblEventName.Text = ev.Name;
         Label lblNumberOfParticipants = new Label();
         pnlEvent.Controls.Add(lblEventName);
         pnlEvent.Controls.Add(lblNumberOfParticipants);
         GridView grdvwParticipation = new GridView();
         grdvwParticipation.DataSource = Event.GetRegisteredParticipants(ev, 0);
         grdvwParticipation.DataBind();
         pnlEvent.Controls.Add(grdvwParticipation);
         pnlDetails.Controls.Add(pnlEvent);
         if (ev.IsSinglePlayer)
         {
             foreach (GridViewRow row in grdvwParticipation.Rows)
             {
                 row.Cells[0].Text = "TT" + row.Cells[0].Text;
             }
             lblNumberOfParticipants.Text = "Total Participants: " + grdvwParticipation.Rows.Count.ToString();
         }
         else
         {
             var numberOfTeams = (from i in grdvwParticipation.Rows.Cast<GridViewRow>() select new { Teamid = i.Cells[0].Text }).Distinct().Count();
             lblNumberOfParticipants.Text = "Total Teams: " + numberOfTeams.ToString();
         }
     }
 }
コード例 #18
0
    public GameController()
    {
        wordManager = new WordManager ();

        player = new Player ();
        enemyManager = new EnemyManager ();

        int buttonLenX = 3;
        int buttonLenY = 5;
        panels = new Panel[buttonLenX, buttonLenY];

        float buttonSize = 50;
        Rect buttonRect = new Rect (0, 200, buttonSize, buttonSize);
        for (int x = 0; x < buttonLenX; x++) {
            for (int y = 0; y < buttonLenY; y++) {
                buttonRect.x += buttonSize + 1;
                panels [x, y] = new Panel ();
                panels [x, y].position = buttonRect;
            }
            buttonRect.x = 0;
            buttonRect.y += buttonSize + 1;
        }

        AddWord (wordManager.GetWord (), ColorType.red);
        AddWord (wordManager.GetWord (), ColorType.blue);
        AddWord (wordManager.GetWord (), ColorType.green);
    }
コード例 #19
0
    public void PushPanel(Panel p)
    {
        if (CanPanelPush (p)) {
            p.isPushed = true;

            player.PushedPanel (p);

            Enemy enemy = enemyManager.GetEnemy (p.type);
            InputStatus st = enemy.Equals (player.pushingString);
            switch (st) {
            case InputStatus.complete:
                SucceedInput (p.type);
                break;
            case InputStatus.incomplete:
                break;
            case InputStatus.failed:
                FailInput ();
                break;
            default:
                break;
            }
        } else {
            FailInput ();
        }
    }
コード例 #20
0
 private void _panelControl(Panel pnl)
 {
     pnl_add.Visible = false;
     pnl_viewAll.Visible = false;
     pnlUpdate.Visible = false;
     pnl.Visible = true;
 }
コード例 #21
0
ファイル: test.cs プロジェクト: GMDays/PersonalPage
    public myForm(string title, string name)
    {
        myForm f1 = new myForm(title, name);
        f1.Text = title;

        Panel myPanel = new Panel();
        f1.Controls.Add(myPanel);
        myPanel.BackColor = System.Drawing.Color.Blue;
        myPanel.Height = 400;
        myPanel.Width = 300;
        myPanel.Dock = DockStyle.Bottom;

        Label myLabel = new Label();
        myPanel.Controls.Add(myLabel);
        myLabel.Text = name;

        Panel mySecondPanel = new Panel();
        mySecondPanel.BackColor = System.Drawing.Color.Red;
        mySecondPanel.Dock = DockStyle.Fill;

        Label mySecondLabel = new Label();
        mySecondPanel.Controls.Add(mySecondLabel);
        mySecondLabel.Text = "Comment : ";
        mySecondLabel.Top = 300;
        mySecondLabel.Left = 400;

        TextBox myTbox = new TextBox();
        myTbox.Left = 350;
        myTbox.Top = 250;
        myTbox.Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left;
        myTbox.Width = 200;

        Button myButton = new Button();
    }
コード例 #22
0
        private void InitializeWidget(LayoutOrientation orientation)
        {
            sceneBackgroundPanel = new Panel();
            sceneBackgroundPanel.Name = "sceneBackgroundPanel";
            PagePanel_1 = new PagePanel();
            PagePanel_1.Name = "PagePanel_1";

            // sceneBackgroundPanel
            sceneBackgroundPanel.BackgroundColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);

            // PagePanel_1
            PagePanel_1.AddPage(new InstructionsPanel());
            PagePanel_1.AddPage(new Instructions2());
            PagePanel_1.AddPage(new Insructions3());
            PagePanel_1.AddPage(new Instructions4());
            PagePanel_1.AddPage(new instruction5Panel());
            PagePanel_1.AddPage(new Instructions6Panel());
            PagePanel_1.AddPage(new Instructions8Panel());
            PagePanel_1.AddPage(new Instructions7Panel());

            // InstructionsScene
            this.RootWidget.AddChildLast(sceneBackgroundPanel);
            this.RootWidget.AddChildLast(PagePanel_1);

            SetWidgetLayout(orientation);

            UpdateLanguage();
        }
コード例 #23
0
    public static void SendHTMLMail(string mailfrom, string mailto, string mailSubject, Panel panel)
    {
        try
        {
            //mailto = "*****@*****.**";

            MailMessage mail = new MailMessage(mailfrom, mailto);

            mail.IsBodyHtml = true;
            mail.Subject = mailSubject;
            mail.BodyEncoding = Encoding.UTF8;

            //for test
            //String mailcc = "*****@*****.**";
            //mail.CC.Add(mailcc);

            StringWriter sw = new StringWriter();
            HtmlTextWriter hw = new HtmlTextWriter(sw);
            panel.RenderControl(hw);
            mail.Body = sw.ToString();

            //SmtpClient smtpClient = new SmtpClient("127.0.0.1",25);//設定E-mail Server和port
            //SmtpClient smtpClient = new SmtpClient("localhost", 25);//設定E-mail Server和port
            //SmtpClient smtpClient = new SmtpClient("192.168.1.20", 25);//設定E-mail Server和port
            SmtpClient smtpClient = new SmtpClient(); //從WEB.CONFIG讀SMTP CONFIG
            smtpClient.Send(mail);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
コード例 #24
0
ファイル: Logowanie.cs プロジェクト: alucha/ProjektGrupowy
 private void LoginOK_Click(object sender, EventArgs e)
 {
     Panel Panel = new Panel();
     Panel.Show();
     Program.Start1.Hide();
     this.Close();
 }
コード例 #25
0
 protected void PendingTransactionGridView_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.DataItem != null)
     {
         var mainPanel = new Panel { CssClass= "btn-group" };
         var approveButton = new Button
         {
             CssClass = "btn btn-default",
             CommandArgument = e.Row.Cells[0].Text,
             CommandName = "Approve",
             Text = "Approve"
         };
         var rejectButton = new Button
         {
             CssClass = "btn btn-default",
             CommandArgument = e.Row.Cells[0].Text,
             CommandName = "Reject",
             Text = "Reject",
         };
         var lastIndex = e.Row.Cells.Count == 0 ? 0 : e.Row.Cells.Count - 1;
         mainPanel.Controls.Add(approveButton);
         mainPanel.Controls.Add(rejectButton);
         e.Row.Cells[lastIndex].Controls.Add(mainPanel);
         e.Row.Cells[lastIndex].HorizontalAlign = HorizontalAlign.Right;
     }
 }
コード例 #26
0
ファイル: Label.cs プロジェクト: zdawson/Marooned
 public Label(Panel parent, string text, SpriteFont font)
     : base(parent)
 {
     Text   = text;
     Font   = font ?? FontDefault;
     Colour = Color.White;
 }
コード例 #27
0
ファイル: GameField.cs プロジェクト: JLignell/Minesweeper
        private readonly int[,] myMatrix; // The matrix to show info to the user

        #endregion Fields

        #region Constructors

        public GameField(int iRow, int iCol, int bomb_no, Panel panel)
        {
            Panel = panel;

            mTimer = new Stopwatch();
            RowSize = iRow; // rowSize is the size of the row which is bigger than size of the row of the field
            ColSize = iCol; // same for the column
            BombNum = bomb_no;
            Field = new int[RowSize + 2, ColSize + 2];
            myMatrix = new int[iRow, iCol];

            for (int i = 0; i < RowSize + 2; i++)
            {
                for (int j = 0; j < ColSize + 2; j++)
                {
                    Field[i, j] = (int) GameEnum.userUnchecked; //default value for the field!
                }
            }

            for (int i = 0; i < iRow; i++)
            {
                for (int j = 0; j < iCol; j++)
                {
                    myMatrix[i, j] = (int) GameEnum.userUnchecked;
                }
            }
        }
コード例 #28
0
ファイル: Flashlight.cs プロジェクト: StarGate01/LockEx
 private async Task<DeviceInformation> GetCameraID(Panel desiredCamera)
 {
     DeviceInformation deviceID = (await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture))
         .FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desiredCamera);
     if (deviceID != null) return deviceID;
     else throw new Exception(string.Format("Camera of type {0} doesn't exist.", desiredCamera));
 }
コード例 #29
0
 private HtmlTableCell AddSiteCellInnerHTML(string name, string banner, string url)
 {
     HtmlTableCell cell = new HtmlTableCell();
     Panel pnl = new Panel();
     pnl.CssClass = "sitesbanerhome";
     if(IsSitePage)
     {
         pnl.CssClass = "sitespagebaner";
     }
     HyperLink hl = new HyperLink();
     hl.NavigateUrl = url;
     hl.Attributes["rel"] = "nofollow";
     hl.Target = "_blank";
     if (banner != "")
     {
         Image i = new Image();
         i.ImageUrl = Path.Combine(Utils.GaleryImagePath, banner);
         hl.Controls.Add(i);
     }
     else
     {
         hl.Text = name;
     }
     pnl.Controls.Add(hl);
     cell.Controls.Add(pnl);
     return cell;
 }
コード例 #30
0
ファイル: MainForm.cs プロジェクト: mono/gert
	public MainForm ()
	{
		// 
		// _splitter
		// 
		_splitter = new Splitter ();
		_splitter.BorderStyle = BorderStyle.FixedSingle;
		_splitter.Dock = DockStyle.Bottom;
		Controls.Add (_splitter);
		// 
		// _panel
		// 
		_panel = new Panel ();
		_panel.Dock = DockStyle.Bottom;
		_panel.Height = 75;
		_panel.BackColor = SystemColors.Control;
		Controls.Add (_panel);
		// 
		// _label
		// 
		_label = new Label ();
		_label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
		_label.Height = 75;
		_label.Width = _panel.Width - 4;
		_panel.Controls.Add (_label);
		// 
		// MainForm
		// 
		BackColor = Color.White;
		ClientSize = new Size (300, 150);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #338966";
		Load += new EventHandler (MainForm_Load);
	}
コード例 #31
0
ファイル: FrmInputs.cs プロジェクト: chensen/WellsTools
        /// <summary>
        /// 功能描述:构造函数
        /// </summary>
        /// <param name="strTitle">窗体标题</param>
        /// <param name="inPutLabels">The in put labels.</param>
        /// <param name="inTypes">输入项对应输入类型,key:输入项名称,如不设置默认不控制输入</param>
        /// <param name="regexs">输入项对应正则规则,当imTypes=Regex时有效,key:输入项名称,如不设置默认不控制输入</param>
        /// <param name="keyBoards">文本框键盘,key:输入项名称,如不设置默认英文键盘</param>
        /// <param name="mastInputs">必填输入项名称</param>
        /// <param name="defaultValues">输入项默认值,key:输入项名称</param>
        /// <exception cref="System.Exception">输入数量不能为空</exception>
        /// <exception cref="Exception">输入数量不能为空</exception>
        public FrmInputs(
            string strTitle,
            string[] inPutLabels,
            Dictionary <string, TextInputType> inTypes = null,
            Dictionary <string, string> regexs         = null,
            Dictionary <string, Wells.WellsMetroControl.Controls.KeyBoardType> keyBoards = null,
            List <string> mastInputs = null,
            Dictionary <string, string> defaultValues = null)
        {
            InitializeComponent();
            this.Title = strTitle;
            if (inPutLabels.Length <= 0)
            {
                throw new Exception("输入数量不能为空");
            }
            try
            {
                Values = new string[inPutLabels.Length];
                Wells.WellsMetroControl.ControlHelper.FreezeControl(this, true);

                for (int i = inPutLabels.Length - 1; i >= 0; i--)
                {
                    Panel p = new Panel();
                    p.Dock    = DockStyle.Top;
                    p.Height  = 62;
                    p.Padding = new Padding(10);

                    Wells.WellsMetroControl.Controls.UCTextBoxEx txt = new Controls.UCTextBoxEx();
                    txt.Dock           = DockStyle.Fill;
                    txt.IsShowKeyboard = true;
                    txt.IsShowClearBtn = true;
                    txt.Name           = "txt_" + i;
                    txt.TabIndex       = i;
                    if (inTypes != null && inTypes.ContainsKey(inPutLabels[i]))
                    {
                        txt.InputType = inTypes[inPutLabels[i]];
                        if (txt.InputType == TextInputType.Regex && regexs != null && regexs.ContainsKey(inPutLabels[i]))
                        {
                            txt.RegexPattern = regexs[inPutLabels[i]];
                        }
                    }
                    if (keyBoards != null && keyBoards.ContainsKey(inPutLabels[i]))
                    {
                        txt.KeyBoardType = keyBoards[inPutLabels[i]];
                    }
                    if (mastInputs != null && mastInputs.Contains(inPutLabels[i]))
                    {
                        m_mastInputs[i] = inPutLabels[i];
                    }
                    if (defaultValues != null && defaultValues.ContainsKey(inPutLabels[i]))
                    {
                        txt.InputText = defaultValues[inPutLabels[i]];
                    }
                    p.Controls.Add(txt);

                    Label lbl = new Label();
                    lbl.Text      = inPutLabels[i];
                    lbl.Padding   = new System.Windows.Forms.Padding(0, 0, 5, 0);
                    lbl.TextAlign = ContentAlignment.MiddleRight;
                    lbl.AutoSize  = false;
                    lbl.Width     = 120;
                    lbl.Dock      = DockStyle.Left;
                    lbl.Font      = new System.Drawing.Font("微软雅黑", 12);
                    p.Controls.Add(lbl);

                    Label lblT = new Label();
                    if (mastInputs != null && mastInputs.Contains(inPutLabels[i]))
                    {
                        lblT.Text = "*";
                    }
                    else
                    {
                        lblT.Text = "";
                    }
                    lblT.AutoSize  = false;
                    lblT.TextAlign = ContentAlignment.MiddleLeft;
                    lblT.Width     = 25;
                    lblT.Dock      = DockStyle.Right;
                    lblT.Font      = new System.Drawing.Font("微软雅黑", 12);
                    lblT.ForeColor = Color.Red;
                    p.Controls.Add(lblT);
                    this.panel3.Controls.Add(p);
                    this.ActiveControl = txt;
                }

                this.Height = 124 + inPutLabels.Length * 62;
            }
            finally
            {
                Wells.WellsMetroControl.ControlHelper.FreezeControl(this, false);
            }
        }
コード例 #32
0
 public static void SetBackgroundColor(this Panel panel, string color, AdaptiveRenderContext context)
 {
     panel.Background = context.GetColorBrush(color);
 }
コード例 #33
0
ファイル: Form1.cs プロジェクト: syncfusion/winforms-demos
 /// <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();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor1    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor2    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor3    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor4    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor5    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor6    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor7    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor8    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor9    = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor10   = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor11   = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor12   = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor    gridColumnDescriptor13   = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor1 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor2 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor3 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor4 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor5 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor6 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor gridColumnSetDescriptor7 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor();
     this.dataSet11            = new EmployeeView.DataSet1();
     this.gridGroupingControl1 = new Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl();
     this.panel1     = new System.Windows.Forms.Panel();
     this.buttonAdv5 = new Syncfusion.Windows.Forms.ButtonAdv();
     this.buttonAdv4 = new Syncfusion.Windows.Forms.ButtonAdv();
     this.buttonAdv3 = new Syncfusion.Windows.Forms.ButtonAdv();
     this.buttonAdv2 = new Syncfusion.Windows.Forms.ButtonAdv();
     this.buttonAdv1 = new Syncfusion.Windows.Forms.ButtonAdv();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).BeginInit();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // dataSet11
     //
     this.dataSet11.DataSetName             = "DataSet1";
     this.dataSet11.Locale                  = new System.Globalization.CultureInfo("en-US");
     this.dataSet11.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // gridGroupingControl1
     //
     this.gridGroupingControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                               | System.Windows.Forms.AnchorStyles.Left)
                                                                              | System.Windows.Forms.AnchorStyles.Right)));
     this.gridGroupingControl1.Appearance.AlternateRecordFieldCell.BaseStyle   = "";
     this.gridGroupingControl1.Appearance.AlternateRecordFieldCell.Interior    = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(201)))), ((int)(((byte)(219))))));
     this.gridGroupingControl1.Appearance.RecordPreviewCell.BaseStyle          = "";
     this.gridGroupingControl1.Appearance.RecordPreviewCell.Interior           = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(240)))), ((int)(((byte)(246))))));
     this.gridGroupingControl1.Appearance.RecordPreviewRowHeaderCell.BaseStyle = "";
     this.gridGroupingControl1.Appearance.RecordPreviewRowHeaderCell.CellType  = "Static";
     this.gridGroupingControl1.Appearance.RecordPreviewRowHeaderCell.Enabled   = false;
     this.gridGroupingControl1.BackColor = System.Drawing.SystemColors.Window;
     this.gridGroupingControl1.ChildGroupOptions.ShowAddNewRecordAfterDetails  = true;
     this.gridGroupingControl1.ChildGroupOptions.ShowAddNewRecordBeforeDetails = false;
     this.gridGroupingControl1.Font                     = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.gridGroupingControl1.FreezeCaption            = false;
     this.gridGroupingControl1.GridOfficeScrollBars     = Syncfusion.Windows.Forms.OfficeScrollBars.Metro;
     this.gridGroupingControl1.GridVisualStyles         = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
     this.gridGroupingControl1.Location                 = new System.Drawing.Point(21, 8);
     this.gridGroupingControl1.Name                     = "gridGroupingControl1";
     this.gridGroupingControl1.Size                     = new System.Drawing.Size(802, 634);
     this.gridGroupingControl1.TabIndex                 = 1;
     this.gridGroupingControl1.TableDescriptor.AllowNew = false;
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyCell.Font.Facename             = "Segoe UI";
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyCell.TextColor                 = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyGroupCell.Borders.Bottom       = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin);
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyGroupCell.Borders.Right        = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin);
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyGroupCell.Interior             = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))));
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyGroupCell.TextColor            = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.Borders.Bottom = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin);
     this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.Borders.Right  = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin);
     this.gridGroupingControl1.TableDescriptor.Appearance.AnySummaryCell.Borders.Right      = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin);
     this.gridGroupingControl1.TableDescriptor.Appearance.AnySummaryCell.Borders.Top        = new Syncfusion.Windows.Forms.Grid.GridBorder(Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid, System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208))))), Syncfusion.Windows.Forms.Grid.GridBorderWeight.ExtraThin);
     this.gridGroupingControl1.TableDescriptor.Appearance.AnySummaryCell.Interior           = new Syncfusion.Drawing.BrushInfo(System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208))))));
     this.gridGroupingControl1.TableDescriptor.Appearance.ColumnHeaderCell.Font.Bold        = true;
     this.gridGroupingControl1.TableDescriptor.Appearance.GroupCaptionCell.CellType         = "ColumnHeader";
     gridColumnDescriptor1.HeaderImage          = null;
     gridColumnDescriptor1.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor1.HeaderText           = "ID";
     gridColumnDescriptor1.MappingName          = "EmployeeID";
     gridColumnDescriptor1.SerializedImageArray = "";
     gridColumnDescriptor1.Width                 = 60;
     gridColumnDescriptor2.HeaderImage           = null;
     gridColumnDescriptor2.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor2.MappingName           = "FirstName";
     gridColumnDescriptor2.SerializedImageArray  = "";
     gridColumnDescriptor2.Width                 = 115;
     gridColumnDescriptor3.HeaderImage           = null;
     gridColumnDescriptor3.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor3.MappingName           = "LastName";
     gridColumnDescriptor3.SerializedImageArray  = "";
     gridColumnDescriptor4.HeaderImage           = null;
     gridColumnDescriptor4.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor4.MappingName           = "Address";
     gridColumnDescriptor4.SerializedImageArray  = "";
     gridColumnDescriptor4.Width                 = 118;
     gridColumnDescriptor5.HeaderImage           = null;
     gridColumnDescriptor5.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor5.MappingName           = "City";
     gridColumnDescriptor5.SerializedImageArray  = "";
     gridColumnDescriptor5.Width                 = 83;
     gridColumnDescriptor6.HeaderImage           = null;
     gridColumnDescriptor6.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor6.MappingName           = "PostalCode";
     gridColumnDescriptor6.SerializedImageArray  = "";
     gridColumnDescriptor7.HeaderImage           = null;
     gridColumnDescriptor7.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor7.MappingName           = "Region";
     gridColumnDescriptor7.SerializedImageArray  = "";
     gridColumnDescriptor7.Width                 = 80;
     gridColumnDescriptor8.HeaderImage           = null;
     gridColumnDescriptor8.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor8.MappingName           = "Country";
     gridColumnDescriptor8.SerializedImageArray  = "";
     gridColumnDescriptor8.Width                 = 80;
     gridColumnDescriptor9.HeaderImage           = null;
     gridColumnDescriptor9.HeaderImageAlignment  = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor9.MappingName           = "BirthDate";
     gridColumnDescriptor9.SerializedImageArray  = "";
     gridColumnDescriptor10.HeaderImage          = null;
     gridColumnDescriptor10.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor10.MappingName          = "Photo";
     gridColumnDescriptor10.SerializedImageArray = "";
     gridColumnDescriptor11.HeaderImage          = null;
     gridColumnDescriptor11.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor11.MappingName          = "ReportsTo";
     gridColumnDescriptor11.SerializedImageArray = "";
     gridColumnDescriptor12.HeaderImage          = null;
     gridColumnDescriptor12.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor12.MappingName          = "Title";
     gridColumnDescriptor12.SerializedImageArray = "";
     gridColumnDescriptor12.Width                = 144;
     gridColumnDescriptor13.HeaderImage          = null;
     gridColumnDescriptor13.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor13.MappingName          = "TitleOfCourtesy";
     gridColumnDescriptor13.SerializedImageArray = "";
     gridColumnDescriptor13.Width                = 133;
     this.gridGroupingControl1.TableDescriptor.Columns.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor[] {
         gridColumnDescriptor1,
         gridColumnDescriptor2,
         gridColumnDescriptor3,
         gridColumnDescriptor4,
         gridColumnDescriptor5,
         gridColumnDescriptor6,
         gridColumnDescriptor7,
         gridColumnDescriptor8,
         gridColumnDescriptor9,
         gridColumnDescriptor10,
         gridColumnDescriptor11,
         gridColumnDescriptor12,
         gridColumnDescriptor13
     });
     gridColumnSetDescriptor1.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("EmployeeID", "R0C0:R1C0")
     });
     gridColumnSetDescriptor1.Name = "ColumnSetId";
     gridColumnSetDescriptor2.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("Photo", "R0C0:R1C0")
     });
     gridColumnSetDescriptor2.Name = "ColumnSetPhoto";
     gridColumnSetDescriptor3.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("FirstName", "R0C0"),
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("LastName", "R1C0")
     });
     gridColumnSetDescriptor3.Name = "ColumnSetName";
     gridColumnSetDescriptor4.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("Address", "R0C0:R0C1"),
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("City", "R1C0"),
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("PostalCode", "R1C1")
     });
     gridColumnSetDescriptor4.Name = "ColumnSetAddress";
     gridColumnSetDescriptor5.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("Region", "R0C0"),
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("Country", "R1C0")
     });
     gridColumnSetDescriptor5.Name = "ColumnSetRegionCountry";
     gridColumnSetDescriptor6.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("Title", "R0C0"),
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("TitleOfCourtesy", "R1C0")
     });
     gridColumnSetDescriptor6.Name = "ColumnSetTitle";
     gridColumnSetDescriptor7.ColumnSpans.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] {
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("BirthDate", "R0C0"),
         new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("ReportsTo", "R1C0")
     });
     gridColumnSetDescriptor7.Name = "ColumnSetBirth";
     this.gridGroupingControl1.TableDescriptor.ColumnSets.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSetDescriptor[] {
         gridColumnSetDescriptor1,
         gridColumnSetDescriptor2,
         gridColumnSetDescriptor3,
         gridColumnSetDescriptor4,
         gridColumnSetDescriptor5,
         gridColumnSetDescriptor6,
         gridColumnSetDescriptor7
     });
     this.gridGroupingControl1.TableDescriptor.TableOptions.ColumnHeaderRowHeight = 25;
     this.gridGroupingControl1.TableDescriptor.TableOptions.RecordRowHeight       = 20;
     this.gridGroupingControl1.TableOptions.RecordPreviewRowHeight = 60;
     this.gridGroupingControl1.TableOptions.RecordRowHeight        = 30;
     this.gridGroupingControl1.TableOptions.ShowRecordPreviewRow   = true;
     this.gridGroupingControl1.Text = "gridGroupingControl1";
     this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordAfterDetails  = false;
     this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
     this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = true;
     //
     // panel1
     //
     this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.panel1.Controls.Add(this.buttonAdv5);
     this.panel1.Controls.Add(this.buttonAdv4);
     this.panel1.Controls.Add(this.buttonAdv3);
     this.panel1.Controls.Add(this.buttonAdv2);
     this.panel1.Controls.Add(this.buttonAdv1);
     this.panel1.Font     = new System.Drawing.Font("Segoe UI", 8.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.panel1.Location = new System.Drawing.Point(829, 8);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(187, 635);
     this.panel1.TabIndex = 2;
     //
     // buttonAdv5
     //
     this.buttonAdv5.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.buttonAdv5.FlatStyle         = FlatStyle.Flat;
     this.buttonAdv5.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.buttonAdv5.BeforeTouchSize   = new System.Drawing.Size(151, 40);
     this.buttonAdv5.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.buttonAdv5.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonAdv5.ForeColor         = System.Drawing.Color.White;
     this.buttonAdv5.IsBackStageButton = false;
     this.buttonAdv5.Location          = new System.Drawing.Point(16, 215);
     this.buttonAdv5.Name              = "buttonAdv5";
     this.buttonAdv5.Size              = new System.Drawing.Size(151, 40);
     this.buttonAdv5.TabIndex          = 6;
     this.buttonAdv5.Text              = "Edit custom styles";
     this.buttonAdv5.Click            += new System.EventHandler(this.buttonAdv5_Click);
     //
     // buttonAdv4
     //
     this.buttonAdv4.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.buttonAdv4.FlatStyle         = FlatStyle.Flat;
     this.buttonAdv4.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.buttonAdv4.BeforeTouchSize   = new System.Drawing.Size(151, 40);
     this.buttonAdv4.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.buttonAdv4.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonAdv4.ForeColor         = System.Drawing.Color.White;
     this.buttonAdv4.IsBackStageButton = false;
     this.buttonAdv4.Location          = new System.Drawing.Point(16, 165);
     this.buttonAdv4.Name              = "buttonAdv4";
     this.buttonAdv4.Size              = new System.Drawing.Size(151, 40);
     this.buttonAdv4.TabIndex          = 5;
     this.buttonAdv4.Text              = "Restore all from xml";
     this.buttonAdv4.Click            += new System.EventHandler(this.buttonAdv4_Click);
     //
     // buttonAdv3
     //
     this.buttonAdv3.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.buttonAdv3.FlatStyle         = FlatStyle.Flat;
     this.buttonAdv3.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.buttonAdv3.BeforeTouchSize   = new System.Drawing.Size(151, 40);
     this.buttonAdv3.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.buttonAdv3.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonAdv3.ForeColor         = System.Drawing.Color.White;
     this.buttonAdv3.IsBackStageButton = false;
     this.buttonAdv3.Location          = new System.Drawing.Point(16, 115);
     this.buttonAdv3.Name              = "buttonAdv3";
     this.buttonAdv3.Size              = new System.Drawing.Size(151, 40);
     this.buttonAdv3.TabIndex          = 4;
     this.buttonAdv3.Text              = "Clear all";
     this.buttonAdv3.Click            += new System.EventHandler(this.buttonAdv3_Click);
     //
     // buttonAdv2
     //
     this.buttonAdv2.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.buttonAdv2.FlatStyle         = FlatStyle.Flat;
     this.buttonAdv2.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.buttonAdv2.BeforeTouchSize   = new System.Drawing.Size(151, 40);
     this.buttonAdv2.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.buttonAdv2.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonAdv2.ForeColor         = System.Drawing.Color.White;
     this.buttonAdv2.IsBackStageButton = false;
     this.buttonAdv2.Location          = new System.Drawing.Point(16, 65);
     this.buttonAdv2.Name              = "buttonAdv2";
     this.buttonAdv2.Size              = new System.Drawing.Size(151, 40);
     this.buttonAdv2.TabIndex          = 3;
     this.buttonAdv2.Text              = "Save all to xml";
     this.buttonAdv2.Click            += new System.EventHandler(this.buttonAdv2_Click);
     //
     // buttonAdv1
     //
     this.buttonAdv1.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.buttonAdv1.FlatStyle         = FlatStyle.Flat;
     this.buttonAdv1.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.buttonAdv1.BeforeTouchSize   = new System.Drawing.Size(151, 40);
     this.buttonAdv1.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.buttonAdv1.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.buttonAdv1.ForeColor         = System.Drawing.Color.White;
     this.buttonAdv1.IsBackStageButton = false;
     this.buttonAdv1.Location          = new System.Drawing.Point(16, 15);
     this.buttonAdv1.Name              = "buttonAdv1";
     this.buttonAdv1.Size              = new System.Drawing.Size(151, 40);
     this.buttonAdv1.TabIndex          = 2;
     this.buttonAdv1.Text              = "Initialize with custom styles";
     this.buttonAdv1.Click            += new System.EventHandler(this.buttonAdv1_Click);
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(1012, 653);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.gridGroupingControl1);
     this.MinimumSize = new System.Drawing.Size(800, 400);
     this.Name        = "Form1";
     this.Text        = "Employee View ";
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).EndInit();
     this.panel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
コード例 #34
0
        /// <summary>
        /// Gets the point view.
        /// </summary>
        /// <param name="point">The point.</param>
        /// <param name="label">The label.</param>
        /// <returns></returns>
        public override IChartPointView GetPointView(ChartPoint point, string label)
        {
            var pbv = (RowPointView)point.View;

            if (pbv == null)
            {
                pbv = new RowPointView
                {
                    IsNew     = true,
                    Rectangle = new Rectangle(),
                    Data      = new CoreRectangle()
                };

                Model.Chart.View.AddToDrawMargin(pbv.Rectangle);
            }
            else
            {
                pbv.IsNew = false;
                point.SeriesView.Model.Chart.View
                .EnsureElementBelongsToCurrentDrawMargin(pbv.Rectangle);
                point.SeriesView.Model.Chart.View
                .EnsureElementBelongsToCurrentDrawMargin(pbv.HoverShape);
                point.SeriesView.Model.Chart.View
                .EnsureElementBelongsToCurrentDrawMargin(pbv.DataLabel);
            }

            pbv.Rectangle.Fill            = Fill;
            pbv.Rectangle.Stroke          = Stroke;
            pbv.Rectangle.StrokeThickness = StrokeThickness;
            pbv.Rectangle.StrokeDashArray = StrokeDashArray;
            pbv.Rectangle.Visibility      = Visibility;
            Panel.SetZIndex(pbv.Rectangle, Panel.GetZIndex(this));

            if (Model.Chart.RequiresHoverShape && pbv.HoverShape == null)
            {
                pbv.HoverShape = new Rectangle
                {
                    Fill            = Brushes.Transparent,
                    StrokeThickness = 0
                };

                Panel.SetZIndex(pbv.HoverShape, int.MaxValue);

                var wpfChart = (Chart)Model.Chart.View;
                wpfChart.AttachHoverableEventTo(pbv.HoverShape);

                Model.Chart.View.AddToDrawMargin(pbv.HoverShape);
            }

            if (pbv.HoverShape != null)
            {
                pbv.HoverShape.Visibility = Visibility;
            }

            if (DataLabels)
            {
                pbv.DataLabel = UpdateLabelContent(new DataLabelViewModel
                {
                    FormattedText = label,
                    Point         = point
                }, pbv.DataLabel);
            }

            if (!DataLabels && pbv.DataLabel != null)
            {
                Model.Chart.View.RemoveFromDrawMargin(pbv.DataLabel);
                pbv.DataLabel = null;
            }

            if (point.Stroke != null)
            {
                pbv.Rectangle.Stroke = (Brush)point.Stroke;
            }
            if (point.Fill != null)
            {
                pbv.Rectangle.Fill = (Brush)point.Fill;
            }

            pbv.LabelPosition = LabelsPosition;

            return(pbv);
        }
コード例 #35
0
        private void UnInstallPlugIn_Click(object sender, EventArgs e)
        {
            Form msgForm = new Form();

            msgForm.Height = 600;
            msgForm.Width  = 600;
            msgForm.Icon   = Properties.Resources.CT_done;
            msgForm.Text   = "Uninstall PlugIns";

            TreeView rtb = new TreeView();

            rtb.CheckBoxes = true;
            rtb.ShowLines  = false;
            rtb.Dock       = DockStyle.Fill;
            //Fill the box with names
            string path = OSStringConverter.StringToDir(
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CellToolPlugIns");
            bool unisntalled = false;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            DirectoryInfo directoryInfo = new DirectoryInfo(path);

            foreach (var file in directoryInfo.GetFiles())
            {
                if (file.Name.EndsWith(".CTPlugIn.dll") &&
                    !file.Name.EndsWith("Results_Extractor.CTPlugIn.dll"))
                {
                    string   namePlugIn = file.Name.Replace(".CTPlugIn.dll", "").Replace("_", " ");
                    string   dirPlugIn  = file.FullName;
                    TreeNode n          = new TreeNode(namePlugIn);
                    n.Checked = false;
                    n.Tag     = dirPlugIn;
                    rtb.Nodes.Add(n);
                }
            }
            //end filling
            msgForm.Controls.Add(rtb);

            Panel okBox = new Panel();

            okBox.Height = 40;
            okBox.Dock   = DockStyle.Bottom;
            msgForm.Controls.Add(okBox);

            Button okBtn = new Button();

            okBtn.Text      = "Uninstall";
            okBtn.BackColor = System.Drawing.SystemColors.ButtonFace;
            okBtn.ForeColor = System.Drawing.Color.Black;
            okBtn.Location  = new System.Drawing.Point(20, 10);
            okBtn.Anchor    = AnchorStyles.Top | AnchorStyles.Left;
            okBox.Controls.Add(okBtn);

            Button cancelBtn = new Button();

            cancelBtn.Text      = "Cancel";
            cancelBtn.BackColor = System.Drawing.SystemColors.ButtonFace;
            cancelBtn.Location  = new System.Drawing.Point(msgForm.Width - cancelBtn.Width - 40, 10);
            cancelBtn.ForeColor = System.Drawing.Color.Black;
            cancelBtn.Anchor    = AnchorStyles.Top | AnchorStyles.Right;
            okBox.Controls.Add(cancelBtn);

            okBtn.Click += new EventHandler(delegate(object o, EventArgs a)
            {
                foreach (TreeNode n in rtb.Nodes)
                {
                    if (n.Checked && File.Exists((string)n.Tag))
                    {
                        try
                        {
                            File.Delete((string)n.Tag);
                            unisntalled = true;
                        }
                        catch
                        {
                            MessageBox.Show(
                                "To uninstall the PlugIn, restart the program and try again!");
                        }
                    }
                }

                msgForm.Close();
            });

            cancelBtn.Click += new EventHandler(delegate(object o, EventArgs a)
            {
                msgForm.Close();
            });

            // Linux change
            IA.FileBrowser.StatusLabel.Text = "Dialog open";
            msgForm.ShowDialog();
            IA.FileBrowser.StatusLabel.Text = "Ready";

            if (unisntalled)
            {
                PlugIns_TakeNames();
                MessageBox.Show("Selected plugins are uninstalled.");
            }
            msgForm.Dispose();
        }
コード例 #36
0
    /// <summary>
    /// Initializes the control properties.
    /// </summary>
    private void SetupControl()
    {
        if (StopProcessing)
        {
            // Do nothing
        }
        else
        {
            // WAI validation
            lblUserName = (LocalizedLabel)loginElem.FindControl("lblUserName");
            if (lblUserName != null)
            {
                lblUserName.Text = GetString("general.username");
                if (!ShowUserNameLabel)
                {
                    lblUserName.Attributes.Add("style", "display: none;");
                }
            }
            lblPassword = (LocalizedLabel)loginElem.FindControl("lblPassword");
            if (lblPassword != null)
            {
                lblPassword.Text = GetString("general.password");
                if (!ShowPasswordLabel)
                {
                    lblPassword.Attributes.Add("style", "display: none;");
                }
            }

            // Set properties for validator
            rfv                 = (RequiredFieldValidator)loginElem.FindControl("rfvUserNameRequired");
            rfv.ToolTip         = GetString("LogonForm.NameRequired");
            rfv.Text            = rfv.ErrorMessage = GetString("LogonForm.EnterName");
            rfv.ValidationGroup = ClientID + "_MiniLogon";

            // Set visibility of buttons
            login = (LocalizedButton)loginElem.FindControl("btnLogon");
            if (login != null)
            {
                login.Visible         = !ShowImageButton;
                login.ValidationGroup = ClientID + "_MiniLogon";
            }

            loginImg = (ImageButton)loginElem.FindControl("btnImageLogon");
            if (loginImg != null)
            {
                loginImg.Visible         = ShowImageButton;
                loginImg.ImageUrl        = ImageUrl;
                loginImg.ValidationGroup = ClientID + "_MiniLogon";
            }

            // Ensure display control as inline and is used right default button
            container = (Panel)loginElem.FindControl("pnlLogonMiniForm");
            if (container != null)
            {
                container.Attributes.Add("style", "display: inline;");
                if (ShowImageButton)
                {
                    if (loginImg != null)
                    {
                        container.DefaultButton = loginImg.ID;
                    }
                    else if (login != null)
                    {
                        container.DefaultButton = login.ID;
                    }
                }
            }

            CMSTextBox txtUserName = (CMSTextBox)loginElem.FindControl("UserName");
            if (txtUserName != null)
            {
                txtUserName.EnableAutoComplete = SecurityHelper.IsAutoCompleteEnabledForLogin(SiteContext.CurrentSiteName);
            }

            if (!string.IsNullOrEmpty(UserNameText))
            {
                // Initialize javascript for focus and blur UserName textbox
                user = (TextBox)loginElem.FindControl("UserName");
                user.Attributes.Add("onfocus", "MLUserFocus_" + ClientID + "('focus');");
                user.Attributes.Add("onblur", "MLUserFocus_" + ClientID + "('blur');");
                string focusScript = "function MLUserFocus_" + ClientID + "(type)" +
                                     "{" +
                                     "var userNameBox = document.getElementById('" + user.ClientID + "');" +
                                     "if(userNameBox.value == '" + UserNameText + "' && type == 'focus')" +
                                     "{userNameBox.value = '';}" +
                                     "else if (userNameBox.value == '' && type == 'blur')" +
                                     "{userNameBox.value = '" + UserNameText + "';}" +
                                     "}";

                ScriptHelper.RegisterClientScriptBlock(this, GetType(), "MLUserNameFocus_" + ClientID,
                                                       ScriptHelper.GetScript(focusScript));
            }
            loginElem.LoggedIn     += loginElem_LoggedIn;
            loginElem.LoggingIn    += loginElem_LoggingIn;
            loginElem.LoginError   += loginElem_LoginError;
            loginElem.Authenticate += loginElem_Authenticate;

            if (!RequestHelper.IsPostBack())
            {
                // Set SkinID properties
                if (!StandAlone && (PageCycle < PageCycleEnum.Initialized) && (ValidationHelper.GetString(Page.StyleSheetTheme, "") == ""))
                {
                    SetSkinID(SkinID);
                }
            }

            if (string.IsNullOrEmpty(loginElem.UserName))
            {
                loginElem.UserName = UserNameText;
            }

            // Register script to update logon error message
            LocalizedLabel failureLit = loginElem.FindControl("FailureText") as LocalizedLabel;
            if (failureLit != null)
            {
                StringBuilder sbScript = new StringBuilder();
                sbScript.Append(@"
function UpdateLabel_", ClientID, @"(content, context) {
    var lbl = document.getElementById(context);
    if(lbl)
    {
        lbl.innerHTML = content;
        lbl.className = ""InfoLabel"";      
    }
}");
                ScriptHelper.RegisterClientScriptBlock(this, GetType(), "InvalidLogonAttempts_" + ClientID, sbScript.ToString(), true);
            }
        }
    }
コード例 #37
0
        protected override void Setup()
        {
            // Load native texture
            nativeTexture = DaggerfallUI.GetTextureFromImg(nativeImgName);
            if (!nativeTexture)
            {
                throw new Exception("DaggerfallOptionsWindow: Could not load native texture.");
            }

            // Always dim background
            ParentPanel.BackgroundColor = ScreenDimColor;

            // Native options panel
            optionsPanel.HorizontalAlignment = HorizontalAlignment.Center;
            optionsPanel.Position            = new Vector2(0, 40);
            optionsPanel.Size              = TextureReplacement.GetSize(nativeTexture, nativeImgName);
            optionsPanel.BackgroundColor   = Color.black;
            optionsPanel.BackgroundTexture = nativeTexture;
            NativePanel.Components.Add(optionsPanel);

            // Exit game
            Button exitButton = DaggerfallUI.AddButton(new Rect(101, 4, 45, 16), optionsPanel);

            exitButton.OnMouseClick += ExitButton_OnMouseClick;

            // Continue
            Button continueButton = DaggerfallUI.AddButton(new Rect(76, 60, 70, 17), optionsPanel);

            continueButton.OnMouseClick += ContinueButton_OnMouseClick;

            // Save game
            Button saveButton = DaggerfallUI.AddButton(new Rect(4, 4, 45, 16), optionsPanel);

            //saveButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor;
            saveButton.OnMouseClick += SaveButton_OnMouseClick;

            // Load game
            Button loadButton = DaggerfallUI.AddButton(new Rect(52, 4, 46, 16), optionsPanel);

            //loadButton.BackgroundColor = DaggerfallUI.DaggerfallUnityNotImplementedColor;
            loadButton.OnMouseClick += LoadButton_OnMouseClick;

            // Sound Bar
            Button soundPanel = DaggerfallUI.AddButton(new Rect(6.15f, 23.20f, barMaxLength, 5.5f), optionsPanel);

            soundPanel.OnMouseClick += SoundBar_OnMouseClick;
            soundBar = DaggerfallUI.AddPanel(new Rect(0f, 1f, DaggerfallUnity.Settings.SoundVolume * barMaxLength, 3.5f), soundPanel);
            soundBar.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor;

            // Music Bar
            Button musicPanel = DaggerfallUI.AddButton(new Rect(6.15f, 30.85f, barMaxLength, 5.5f), optionsPanel);

            musicPanel.OnMouseClick += MusicBar_OnMouseClick;
            musicBar = DaggerfallUI.AddPanel(new Rect(0f, 1f, DaggerfallUnity.Settings.MusicVolume * barMaxLength, 3.5f), musicPanel);
            musicBar.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor;

            // Controls
            Button controlsButton = DaggerfallUI.AddButton(new Rect(5, 60, 70, 17), optionsPanel);

            controlsButton.OnMouseClick += ControlsButton_OnMouseClick;

            // Full screen
            //Button fullScreenButton = DaggerfallUI.AddButton(new Rect(5, 47, 70, 8), optionsPanel);
            //fullScreenButton.BackgroundColor = new Color(1, 0, 0, 0.5f);

            // Head bobbing
            Button headBobbingButton = DaggerfallUI.AddButton(new Rect(76, 47, 70, 8), optionsPanel);

            headBobbingButton.OnMouseClick += HeadBobbingButton_OnMouseClick;
            headBobbingTick = DaggerfallUI.AddPanel(new Rect(64f, 3.2f, 3.7f, 3.2f), headBobbingButton);
            headBobbingTick.BackgroundColor = DaggerfallUI.DaggerfallUnityDefaultCheckboxToggleColor;
            headBobbingTick.Enabled         = DaggerfallUnity.Settings.HeadBobbing;

            // Set version text
            versionTextLabel                     = new TextLabel();
            versionTextLabel.Text                = string.Format("{0} {1} {2}", VersionInfo.DaggerfallUnityProductName, VersionInfo.DaggerfallUnityStatus, VersionInfo.DaggerfallUnityVersion);
            versionTextLabel.TextColor           = versionTextColor;
            versionTextLabel.ShadowColor         = versionShadowColor;
            versionTextLabel.ShadowPosition      = Vector2.one;
            versionTextLabel.HorizontalAlignment = HorizontalAlignment.Right;
            ParentPanel.Components.Add(versionTextLabel);
        }
コード例 #38
0
 void Panel(Panel panel)
 {
     panel.BringToFront();
 }
コード例 #39
0
        protected override void CreateChildControls()
        {
            try
            {
                #region Creacion de controles
                pnlFormulario       = new Panel();
                pnlFormulario.ID    = "pnlFormulario";
                pnlAdjuntos         = new Panel();
                pnlAdjuntos.ID      = "pnlAdjuntos";
                pnlAdjuntos.Visible = false;

                lblTipoCarta          = new Label();
                lblTipoCarta.Text     = "Tipo <span class='ms-formvalidation'>*</span>";
                lblDescTipoCarta      = new Label();
                lblDescTipoCarta.Text = "Tipo de correspondencia recibida";
                rblTipoCarta          = new RadioButtonList();
                rblTipoCarta.ID       = "rblTipoCarta";
                rblTipoCarta.Items.Add("INTERNA");
                rblTipoCarta.Items.Add("EXTERNA");
                rfvTipoCarta                   = new RequiredFieldValidator();
                rfvTipoCarta.ID                = "rfvTipoCarta";
                rfvTipoCarta.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                rfvTipoCarta.Display           = ValidatorDisplay.Dynamic;
                rfvTipoCarta.ControlToValidate = "rblTipoCarta";
                rfvTipoCarta.SetFocusOnError   = true;

                lblOrigenCarta          = new Label();
                lblOrigenCarta.Text     = "Origen <span class='ms-formvalidation'>*</span>";
                lblDescOrigenCarta      = new Label();
                lblDescOrigenCarta.Text = "Origen de la correspondencia";
                rblOrigenCarta          = new RadioButtonList();
                rblOrigenCarta.ID       = "rblOrigenCarta";
                rblOrigenCarta.Items.Add(new ListItem("", "COMBO"));
                rblOrigenCarta.Items.Add(new ListItem("", "TEXTO"));
                rblOrigenCarta.SelectedIndex = 0;
                ddlOrigenCarta    = new DropDownList();
                ddlOrigenCarta.ID = "ddlOrigenCarta";
                ddlOrigenCarta.Attributes.Add("style", "width:385px;");
                ddlOrigenCarta.DataSource     = ConectorWebPart.RecuperarOrigenesCorrespondencia();
                ddlOrigenCarta.DataTextField  = "text";
                ddlOrigenCarta.DataValueField = "value";
                ddlOrigenCarta.DataBind();
                ddlOrigenCarta.Items.Insert(0, new ListItem("", string.Empty));
                ddlOrigenCarta.SelectedIndex = 0;
                txbOrigenCarta    = new TextBox();
                txbOrigenCarta.ID = "txbOrigenCarta";
                txbOrigenCarta.Attributes.Add("style", "width:385px;");
                ctvOrigenCarta                   = new CustomValidator();
                ctvOrigenCarta.ID                = "ctvOrigenCarta";
                ctvOrigenCarta.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                ctvOrigenCarta.Display           = ValidatorDisplay.Dynamic;
                ctvOrigenCarta.ControlToValidate = "rblOrigenCarta";
                ctvOrigenCarta.ServerValidate   += new ServerValidateEventHandler(ctvOrigenCarta_ServerValidate);
                //rfvDdlOrigenCarta = new RequiredFieldValidator();
                //rfvDdlOrigenCarta.ID = "rfvDdlOrigenCarta";
                //rfvDdlOrigenCarta.Text = "<br/>Tiene que especificar un valor para este campo requerido.";
                //rfvDdlOrigenCarta.InitialValue = string.Empty;
                //rfvDdlOrigenCarta.Display = ValidatorDisplay.Dynamic;
                //rfvDdlOrigenCarta.ControlToValidate = "ddlOrigenCarta";
                //rfvDdlOrigenCarta.Enabled = false;
                //rfvTxbOrigenCarta = new RequiredFieldValidator();
                //rfvTxbOrigenCarta.ID = "rfvTxbOrigenCarta";
                //rfvTxbOrigenCarta.Text = "<br/>Tiene que especificar un valor para este campo requerido.";
                //rfvTxbOrigenCarta.Display = ValidatorDisplay.Dynamic;
                //rfvTxbOrigenCarta.ControlToValidate = "txbOrigenCarta";
                //rfvTxbOrigenCarta.Enabled = false;

                lblReferencia          = new Label();
                lblReferencia.Text     = "Referencia <span class='ms-formvalidation'>*</span>";
                lblDescReferencia      = new Label();
                lblDescReferencia.Text = "<br/>Referencia de la carta";
                txbReferencia          = new InputFormTextBox();
                txbReferencia.ID       = "txbReferencia";
                txbReferencia.Attributes.Add("style", "width:385px;");
                txbReferencia.RichText     = false;
                txbReferencia.RichTextMode = SPRichTextMode.Compatible;
                txbReferencia.Rows         = 5;
                txbReferencia.TextMode     = TextBoxMode.MultiLine;
                rfvReferencia                   = new RequiredFieldValidator();
                rfvReferencia.ID                = "rfvReferencia";
                rfvReferencia.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                rfvReferencia.Display           = ValidatorDisplay.Dynamic;
                rfvReferencia.ControlToValidate = "txbReferencia";
                rfvReferencia.SetFocusOnError   = true;

                lblFechaCarta                 = new Label();
                lblFechaCarta.Text            = "Fecha origen <span class='ms-formvalidation'>*</span>";
                lblDescFechaCarta             = new Label();
                lblDescFechaCarta.Text        = "Fecha de la correspondencia";
                dtcFechaCarta                 = new DateTimeControl();
                dtcFechaCarta.ID              = "dtcFechaCarta";
                dtcFechaCarta.IsRequiredField = true;
                dtcFechaCarta.DateOnly        = true;

                lblFechaRecibida                 = new Label();
                lblFechaRecibida.Text            = "Fecha recibida <span class='ms-formvalidation'>*</span>";
                lblDescFechaRecibida             = new Label();
                lblDescFechaRecibida.Text        = "Fecha de recepción de la carta";
                dtcFechaRecibida                 = new DateTimeControl();
                dtcFechaRecibida.ID              = "dtcFechaRecibida";
                dtcFechaRecibida.IsRequiredField = true;
                dtcFechaRecibida.SelectedDate    = DateTime.Now;

                lblDestinatario          = new Label();
                lblDestinatario.Text     = "Destinatario <span class='ms-formvalidation'>*</span>";
                lblDescDestinatario      = new Label();
                lblDescDestinatario.Text = "<br/>Destinatario indicado en la carta";
                txbDestinatario          = new TextBox();
                txbDestinatario.ID       = "txbDestinatario";
                txbDestinatario.Attributes.Add("style", "width:385px;");
                rfvDestinatario                   = new RequiredFieldValidator();
                rfvDestinatario.ID                = "rfvDestinatario";
                rfvDestinatario.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                rfvDestinatario.Display           = ValidatorDisplay.Dynamic;
                rfvDestinatario.ControlToValidate = "txbDestinatario";
                rfvDestinatario.SetFocusOnError   = true;

                lblDirigidaA             = new Label();
                lblDirigidaA.Text        = "Dirigida a <span class='ms-formvalidation'>*</span>";
                lblDescDirigidaA         = new Label();
                lblDescDirigidaA.Text    = "Usuario(s) al(os) cual(es) será enviada la notificación de correspondencia. El primero usuario definido en este campo será el dueño de esta correspondencia.";
                pedDirigidaA             = new PeopleEditor();
                pedDirigidaA.ID          = "pedDirigidaA";
                pedDirigidaA.AllowEmpty  = false;
                pedDirigidaA.MultiSelect = true;
                pedDirigidaA.Rows        = 1;
                pedDirigidaA.PlaceButtonsUnderEntityEditor = false;
                rfvDirigidaA                   = new RequiredFieldValidator();
                rfvDirigidaA.ID                = "rfvDirigidaA";
                rfvDirigidaA.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                rfvDirigidaA.Display           = ValidatorDisplay.Dynamic;
                rfvDirigidaA.ControlToValidate = "pedDirigidaA";
                rfvDirigidaA.SetFocusOnError   = true;

                lblNumCarta          = new Label();
                lblNumCarta.Text     = "Num. ó Cite";
                lblDescNumCarta      = new Label();
                lblDescNumCarta.Text = "<br/>Código de indentificación de la carta";
                txbNumCarta          = new TextBox();
                txbNumCarta.ID       = "txbNumCarta";
                txbNumCarta.Attributes.Add("style", "width:385px;");

                lblAdjunto          = new Label();
                lblAdjunto.Text     = "Adjunto <span class='ms-formvalidation'>*</span>";
                lblDescAdjunto      = new Label();
                lblDescAdjunto.Text = "<br/>Indica si la correspondencia trae documentos adjuntos o no";
                txbAdjunto          = new TextBox();
                txbAdjunto.ID       = "txbAdjunto";
                txbAdjunto.Attributes.Add("style", "width:385px;");
                rfvAdjunto                   = new RequiredFieldValidator();
                rfvAdjunto.ID                = "rfvAdjunto";
                rfvAdjunto.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                rfvAdjunto.Display           = ValidatorDisplay.Dynamic;
                rfvAdjunto.ControlToValidate = "txbAdjunto";
                rfvAdjunto.SetFocusOnError   = true;

                lblClase          = new Label();
                lblClase.Text     = "Clase de documento <span class='ms-formvalidation'>*</span>";
                lblDescClase      = new Label();
                lblDescClase.Text = "";
                txbClase          = new TextBox();
                txbClase.ID       = "txbClase";
                txbClase.Attributes.Add("style", "width:385px;");
                rfvClase                   = new RequiredFieldValidator();
                rfvClase.ID                = "rfvClase";
                rfvClase.Text              = "<br/>Tiene que especificar un valor para este campo requerido.";
                rfvClase.Display           = ValidatorDisplay.Dynamic;
                rfvClase.ControlToValidate = "txbClase";
                rfvClase.SetFocusOnError   = true;

                lblPrioridad          = new Label();
                lblPrioridad.Text     = "Prioridad <span class='ms-formvalidation'>*</span>";
                lblDescPrioridad      = new Label();
                lblDescPrioridad.Text = "<br/>Prioridad de la correspondencia";
                ddlPrioridad          = new DropDownList();
                ddlPrioridad.ID       = "ddlPrioridad";
                ddlPrioridad.Attributes.Add("style", "width:150px;");
                ddlPrioridad.Items.Add("NORMAL");
                ddlPrioridad.Items.Add("URGENTE");
                ddlPrioridad.SelectedIndex = 0;

                lblPrivada          = new Label();
                lblPrivada.Text     = "Privada";
                lblDescPrivada      = new Label();
                lblDescPrivada.Text = "<br/>Si se marca, esta carta será leida solo por el(los) usuario(s) indicado(s) en el campo \"Dirigida a\"";
                chkPrivada          = new CheckBox();
                chkPrivada.ID       = "chkPrivada";
                chkPrivada.Checked  = true;

                lblHojaDeRuta          = new Label();
                lblHojaDeRuta.Text     = "Hoja de ruta";
                lblDescHojaDeRuta      = new Label();
                lblDescHojaDeRuta.Text = "<br/>Si se marca, imprime la hoja de ruta";
                chkHojaDeRuta          = new CheckBox();
                chkHojaDeRuta.ID       = "chkHojaDeRuta";
                chkHojaDeRuta.Checked  = true;

                lblArchivo          = new Label();
                lblArchivo.Text     = "Archivo";
                lblDescArchivo      = new Label();
                lblDescArchivo.Text = "<br/>Descripción de la ubicación física final de la correspondencia";
                txbArchivo          = new InputFormTextBox();
                txbArchivo.ID       = "txbArchivo";
                txbArchivo.Attributes.Add("style", "width:385px;");
                txbArchivo.RichText     = false;
                txbArchivo.RichTextMode = SPRichTextMode.Compatible;
                txbArchivo.Rows         = 5;
                txbArchivo.TextMode     = TextBoxMode.MultiLine;

                lblAdjuntos                     = new Label();
                lblAdjuntos.Text                = "Adjuntos";
                lblDescAdjuntos                 = new Label();
                lblDescAdjuntos.Text            = "Seleccione el o los archivos que desea adjuntar a este registro de correspondencia";
                grvAdjuntos                     = new GridView();
                grvAdjuntos.ID                  = "grvAdjuntos";
                grvAdjuntos.GridLines           = GridLines.None;
                grvAdjuntos.ForeColor           = Color.FromArgb(51, 51, 51);
                grvAdjuntos.CellPadding         = 4;
                grvAdjuntos.AutoGenerateColumns = false;
                grvAdjuntos.DataKeyNames        = new string[] { "RutaArchivo" };
                grvAdjuntos.RowStyle.BackColor  = Color.FromArgb(227, 234, 235);
                //grvAdjuntos.HeaderStyle.BackColor = Color.FromArgb(28, 94, 85);
                grvAdjuntos.HeaderStyle.Font.Bold = true;
                //grvAdjuntos.HeaderStyle.ForeColor = Color.FromArgb(255, 255, 255);
                grvAdjuntos.AlternatingRowStyle.BackColor = Color.White;
                grvAdjuntos.Width = Unit.Percentage(100);
                //grvAdjuntos.RowDataBound += new GridViewRowEventHandler(grvAdjuntos_RowDataBound);

                #region Adicion de columnas al Grid
                TemplateField    chkAdjuntar = new TemplateField();
                CheckBoxTemplate chkBox      = new CheckBoxTemplate();
                chkAdjuntar.ItemTemplate = chkBox;

                BoundField bflNombreArchivo = new BoundField();
                bflNombreArchivo.HeaderText = "Nombre archivo";
                bflNombreArchivo.DataField  = "NombreArchivo";

                BoundField bflTipoArchivo = new BoundField();
                bflTipoArchivo.HeaderText = "Tipo";
                bflTipoArchivo.DataField  = "TipoArchivo";

                ImageField imfVistaPrevia = new ImageField();
                imfVistaPrevia.HeaderText        = "Vista Previa";
                imfVistaPrevia.DataImageUrlField = "VistaPrevia";

                BoundField bflRutaArchivo = new BoundField();
                bflRutaArchivo.HeaderText = "URL";
                bflRutaArchivo.DataField  = "RutaArchivo";
                bflRutaArchivo.Visible    = false;

                grvAdjuntos.Columns.Add(chkAdjuntar);
                grvAdjuntos.Columns.Add(bflNombreArchivo);
                grvAdjuntos.Columns.Add(bflTipoArchivo);
                grvAdjuntos.Columns.Add(imfVistaPrevia);
                grvAdjuntos.Columns.Add(bflRutaArchivo);

                grvAdjuntos.DataSource = ConectorWebPart.RecuperarDocumentosEP().Tables["DataTable"];
                grvAdjuntos.DataBind();
                #endregion

                btnAdjuntarArchivos         = new LinkButton();
                btnAdjuntarArchivos.ID      = "btnAdjuntarArchivos";
                btnAdjuntarArchivos.Text    = "Adjuntar Archivos";
                btnAdjuntarArchivos.ToolTip = "Ver el panel de adjuntar archivos.";
                btnAdjuntarArchivos.Attributes.Add("style", "font-size:8.5pt;");
                btnAdjuntarArchivos.Click           += new EventHandler(btnAdjuntarArchivos_Click);
                btnAdjuntarArchivos.CausesValidation = false; //OJO
                btnFinalizarRegistro         = new Button();
                btnFinalizarRegistro.ID      = "btnFinalizarRegistro";
                btnFinalizarRegistro.Text    = "Finalizar";
                btnFinalizarRegistro.ToolTip = "Finalizar el registro de nueva correspondencia.";
                btnFinalizarRegistro.Visible = true;
                btnFinalizarRegistro.Attributes.Add("style", "width:140px; font-size:8.5pt;");
                btnFinalizarRegistro.Click += new EventHandler(btnFinalizarRegistro_Click);
                //btnIrAtras = new Button();
                //btnIrAtras.ID = "btnIrAtras";
                //btnIrAtras.Text = "Ir Atras";
                //btnIrAtras.ToolTip = "Volver al formulario de registro";
                //btnIrAtras.Visible = false;
                //btnIrAtras.Attributes.Add("style", "width:140px; font-size:8.5pt;");
                //btnIrAtras.Click += new EventHandler(btnIrAtras_Click);
                btnCancelar             = new GoBackButton();
                btnCancelar.ID          = "btnCancelar";
                btnCancelar.ControlMode = SPControlMode.New;
                #endregion

                #region Adiccion de controles
                pnlFormulario.Controls.Add(new LiteralControl("<table border='0' cellspacing='0' width='100%'>"));
                pnlFormulario.Controls.Add(new LiteralControl("<tr><td colspan='2' style='border-bottom:1px black solid'><b>Datos de la Correspondencia</b></td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblTipoCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(rblTipoCarta);
                pnlFormulario.Controls.Add(lblDescTipoCarta);
                pnlFormulario.Controls.Add(rfvTipoCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblOrigenCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(new LiteralControl("<table><tr><td>"));
                pnlFormulario.Controls.Add(rblOrigenCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</td><td>"));
                pnlFormulario.Controls.Add(ddlOrigenCarta);
                pnlFormulario.Controls.Add(new LiteralControl("<br/>"));
                pnlFormulario.Controls.Add(txbOrigenCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr></table>"));
                pnlFormulario.Controls.Add(lblDescOrigenCarta);
                pnlFormulario.Controls.Add(ctvOrigenCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblReferencia);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(txbReferencia);
                pnlFormulario.Controls.Add(lblDescReferencia);
                pnlFormulario.Controls.Add(rfvReferencia);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblFechaCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(dtcFechaCarta);
                pnlFormulario.Controls.Add(lblDescFechaCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblFechaRecibida);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(dtcFechaRecibida);
                pnlFormulario.Controls.Add(lblDescFechaRecibida);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblDestinatario);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(txbDestinatario);
                pnlFormulario.Controls.Add(lblDescDestinatario);
                pnlFormulario.Controls.Add(rfvDestinatario);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblDirigidaA);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(pedDirigidaA);
                pnlFormulario.Controls.Add(lblDescDirigidaA);
                pnlFormulario.Controls.Add(rfvDirigidaA);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblNumCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(txbNumCarta);
                pnlFormulario.Controls.Add(lblDescNumCarta);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblAdjunto);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(txbAdjunto);
                pnlFormulario.Controls.Add(lblDescAdjunto);
                pnlFormulario.Controls.Add(rfvAdjunto);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblClase);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(txbClase);
                pnlFormulario.Controls.Add(lblDescClase);
                pnlFormulario.Controls.Add(rfvClase);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblPrioridad);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(ddlPrioridad);
                pnlFormulario.Controls.Add(lblDescPrioridad);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblPrivada);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(chkPrivada);
                pnlFormulario.Controls.Add(lblDescPrivada);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblHojaDeRuta);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(chkHojaDeRuta);
                pnlFormulario.Controls.Add(lblDescHojaDeRuta);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));

                pnlFormulario.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlFormulario.Controls.Add(lblArchivo);
                pnlFormulario.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlFormulario.Controls.Add(txbArchivo);
                pnlFormulario.Controls.Add(lblDescArchivo);
                pnlFormulario.Controls.Add(new LiteralControl("</td></tr>"));
                pnlFormulario.Controls.Add(new LiteralControl("</table>"));

                pnlAdjuntos.Controls.Add(new LiteralControl("<table border='0' cellspacing='0' width='100%'>"));
                pnlAdjuntos.Controls.Add(new LiteralControl("<tr><td colspan='2' style='border-bottom:1px black solid'><b>Archivos Adjuntos</b></td></tr>"));
                pnlAdjuntos.Controls.Add(new LiteralControl("<tr><td width='190px' valign='top' class='ms-formlabel'><H3 class='ms-standardheader'><nobr>"));
                pnlAdjuntos.Controls.Add(lblAdjuntos);
                pnlAdjuntos.Controls.Add(new LiteralControl("</nobr></H3></td><td width='500px' valign='top' class='ms-formbody'>"));
                pnlAdjuntos.Controls.Add(lblDescAdjuntos);
                pnlAdjuntos.Controls.Add(grvAdjuntos);
                pnlAdjuntos.Controls.Add(new LiteralControl("</td></tr>"));
                pnlAdjuntos.Controls.Add(new LiteralControl("</table>"));

                this.Controls.Add(pnlFormulario);
                this.Controls.Add(pnlAdjuntos);
                this.Controls.Add(new LiteralControl("<table border='0' cellspacing='0' width='100%'>"));
                this.Controls.Add(new LiteralControl("<tr><td style='text-align:right' class='ms-toolbar'>"));
                this.Controls.Add(new LiteralControl("<table><tr><td width='99%' class='ms-toolbar'><IMG SRC='/_layouts/images/blank.gif' width='1' height='18'/></td>"));
                this.Controls.Add(new LiteralControl("<td nowrap='nowrap' class='ms-toolbar'>"));
                this.Controls.Add(btnAdjuntarArchivos);
                this.Controls.Add(new LiteralControl("</td><td class='ms-separator'> </td><td class='ms-toolbar' align='right'>"));
                this.Controls.Add(btnFinalizarRegistro);
                this.Controls.Add(new LiteralControl("</td><td class='ms-separator'> </td><td class='ms-toolbar' align='right'>"));
                this.Controls.Add(btnCancelar);
                //this.Controls.Add(btnIrAtras);
                this.Controls.Add(new LiteralControl("</td></tr></table>"));
                this.Controls.Add(new LiteralControl("</td></tr>"));
                this.Controls.Add(new LiteralControl("</table>"));
                #endregion
            }
            catch (Exception ex)
            {
                Literal error = new Literal();
                error.Text = ex.Message;

                this.Controls.Clear();
                this.Controls.Add(error);
            }
        }
コード例 #40
0
ファイル: LoginControl.cs プロジェクト: mkbiltek2019/Cas
        private void Initialize()
        {
            Width  = 3 * PADDING + labelSize.Width + textBoxSize.Width;
            Height = 6 * PADDING + 4 * labelSize.Height + buttonSize.Height;


            labelServerName        = new Label();
            labelAuthentication    = new Label();
            labelLogin             = new Label();
            labelPassword          = new Label();
            comboBoxServerName     = new ComboBox();
            comboBoxAuthentication = new ComboBox();
            textBoxLogin           = new TextBox();
            textBoxPassword        = new TextBox();
            buttonConnect          = new Button();
            buttonExit             = new Button();
            linkHelp = new HelpRequestingLink();
            checkBoxRememberLogin            = new CheckBox();
            panelLoginPasswordContainer      = new Panel();
            panelConnectionSettingsContainer = new Panel();
            labelTitle                      = new Label();
            pictureBoxLoginBorder           = new PictureBox();
            pictureBoxPasswordBorder        = new PictureBox();
            pictureBoxServerNameBorder      = new PictureBox();
            pictureBoxAuthenticationBorder  = new PictureBox();
            linkLabelShowConnectionSettings = new LinkLabel();
            //
            // labelTitle
            //
            labelTitle.Location  = new Point(PADDING, PADDING - 10);
            labelTitle.AutoSize  = true;
            labelTitle.Text      = "Login form";
            labelTitle.Font      = new Font("Verdana", 18F, FontStyle.Bold);
            labelTitle.BackColor = Color.Transparent;
            labelTitle.ForeColor = Color.White;
            //
            // panelLoginPasswordContainer
            //
            panelLoginPasswordContainer.TabIndex  = 1;
            panelLoginPasswordContainer.Location  = new Point(PADDING, PADDING + labelTitle.Height + PADDING);
            panelLoginPasswordContainer.Size      = new Size(Width - 2 * PADDING, 160);
            panelLoginPasswordContainer.BackColor = Color.Transparent;

            pictureBoxConnectionStatus           = new PictureBox();
            pictureBoxConnectionStatus.Dock      = DockStyle.Bottom;
            pictureBoxConnectionStatus.Height    = 10;
            pictureBoxConnectionStatus.BackColor = Color.Transparent;
            panelLoginPasswordContainer.Controls.Add(pictureBoxConnectionStatus);

            //
            // panelConnectionSettingsContainer
            //
            panelConnectionSettingsContainer.TabIndex = 2;
            panelConnectionSettingsContainer.Location =
                new Point(PADDING, panelLoginPasswordContainer.Top + panelLoginPasswordContainer.Height + 10);
            panelConnectionSettingsContainer.Size      = new Size(Width - 2 * PADDING, 200);
            panelConnectionSettingsContainer.BackColor = Color.Transparent;
            panelConnectionSettingsContainer.Visible   = false;
            //
            // labelLogin
            //
            labelLogin.AutoSize  = true;
            labelLogin.Location  = new Point(0, 20);
            labelLogin.Font      = labelFont;
            labelLogin.ForeColor = Color.White;
            labelLogin.TextAlign = ContentAlignment.MiddleLeft;
            labelLogin.Text      = "User name:";
            //
            // labelPassword
            //
            labelPassword.Size      = labelSize;
            labelPassword.AutoSize  = true;
            labelPassword.Location  = new Point(0, 70);
            labelPassword.Font      = labelFont;
            labelPassword.ForeColor = Color.White;
            labelPassword.TextAlign = ContentAlignment.MiddleLeft;
            labelPassword.Text      = "Password:"******"Simple");
            comboBoxAuthentication.Items.Add("Windows");
            comboBoxAuthentication.FlatStyle             = FlatStyle.Flat;
            comboBoxAuthentication.BackColor             = Color.FromArgb(52, 121, 191);
            comboBoxAuthentication.SelectedIndexChanged += comboBoxAuthentication_SelectedIndexChanged;
            comboBoxAuthentication.PreviewKeyDown       += EnterPressed;
            //
            // labelServerName
            //
            labelServerName.AutoSize  = true;
            labelServerName.Location  = new Point(0, 10);
            labelServerName.Font      = labelFont;
            labelServerName.ForeColor = Color.White;
            labelServerName.TextAlign = ContentAlignment.MiddleLeft;
            labelServerName.Text      = "Server name:";
            //
            // labelAuthentication
            //
            labelAuthentication.AutoSize  = true;
            labelAuthentication.Location  = new Point(0, 55);
            labelAuthentication.Font      = labelFont;
            labelAuthentication.ForeColor = Color.White;
            labelAuthentication.TextAlign = ContentAlignment.MiddleLeft;
            labelAuthentication.Text      = "Authentication:";
            //
            // textBoxLogin
            //
            textBoxLogin.Size            = textBoxSize;
            textBoxLogin.Location        = new Point(130, 12);
            textBoxLogin.Font            = textBoxFont;
            textBoxLogin.ForeColor       = Color.White;
            textBoxLogin.TabIndex        = 1;
            textBoxLogin.BackColor       = Color.FromArgb(52, 121, 191);
            textBoxLogin.BorderStyle     = BorderStyle.None;
            textBoxLogin.Text            = "username";
            textBoxLogin.PreviewKeyDown += EnterPressed;
            //
            // textBoxPassword
            //
            textBoxPassword.Size            = textBoxSize;
            textBoxPassword.Location        = new Point(130, 62);
            textBoxPassword.Font            = textBoxFont;
            textBoxPassword.ForeColor       = Color.White;
            textBoxPassword.TabIndex        = 2;
            textBoxPassword.BackColor       = Color.FromArgb(52, 121, 191);
            textBoxPassword.PasswordChar    = '•';
            textBoxPassword.BorderStyle     = BorderStyle.None;
            textBoxPassword.PreviewKeyDown += EnterPressed;
            //
            // pictureBoxPasswordBorder
            //
            pictureBoxPasswordBorder.Location  = new Point(textBoxPassword.Left - 2, textBoxPassword.Top - 2);
            pictureBoxPasswordBorder.Size      = new Size(textBoxPassword.Width + 4, textBoxPassword.Height - 3);
            pictureBoxPasswordBorder.BackColor = Color.White;
            //
            // pictureBoxLoginBorder
            //
            pictureBoxLoginBorder.Location  = new Point(textBoxLogin.Left - 2, textBoxLogin.Top - 2);
            pictureBoxLoginBorder.Size      = new Size(textBoxLogin.Width + 4, textBoxLogin.Height - 3);
            pictureBoxLoginBorder.BackColor = Color.White;
            //
            // pictureBoxAuthenticationBorder
            //
            pictureBoxAuthenticationBorder.Location  = new Point(185, 49);
            pictureBoxAuthenticationBorder.Size      = new Size(comboBoxAuthentication.Width + 2, 28);
            pictureBoxAuthenticationBorder.BackColor = Color.White;
            //
            // pictureBoxServerNameBorder
            //
            pictureBoxServerNameBorder.Location  = new Point(185, 9);
            pictureBoxServerNameBorder.Size      = new Size(comboBoxServerName.Width + 2, 28);
            pictureBoxServerNameBorder.BackColor = Color.White;
            //
            // buttonConnect
            //
            buttonConnect.Size = buttonSize;
            //buttonConnect.Location = new Point(Width - 3*PADDING - 3*buttonSize.Width,5*PADDING + 4*textBoxSize.Height);
            buttonConnect.FlatStyle = FlatStyle.Flat;
            buttonConnect.FlatAppearance.BorderSize         = 0;
            buttonConnect.FlatAppearance.MouseOverBackColor = Color.FromArgb(255, 186, 0);
            buttonConnect.FlatAppearance.MouseDownBackColor = Color.FromArgb(255, 180, 0);
            buttonConnect.BackColor = Color.FromArgb(255, 138, 0);
            buttonConnect.Location  = new Point(186, 110);
            buttonConnect.Font      = buttonFont;
            buttonConnect.ForeColor = Color.White;
            buttonConnect.TabIndex  = 3;
            buttonConnect.Text      = "Connect";
            buttonConnect.Click    += ButtonConnectClick;
            buttonConnect.Enabled   = false;
            //
            // buttonExit
            //
            buttonExit.Size = buttonSize;
            //buttonExit.Location = new Point(Width - 2*PADDING - 2*buttonSize.Width,5*PADDING + 4*textBoxSize.Height);
            buttonExit.FlatStyle = FlatStyle.Flat;
            buttonExit.FlatAppearance.BorderSize         = 0;
            buttonExit.FlatAppearance.MouseOverBackColor = Color.FromArgb(255, 186, 0);
            buttonExit.FlatAppearance.MouseDownBackColor = Color.FromArgb(255, 180, 0);
            buttonExit.BackColor = Color.FromArgb(255, 138, 0);
            buttonExit.Location  = new Point(186 + PADDING / 2 + buttonConnect.Width, 110);
            buttonExit.Font      = buttonFont;
            buttonExit.ForeColor = Color.White;
            buttonExit.TabIndex  = 4;
            buttonExit.Text      = "Exit";
            buttonExit.Click    += ButtonExitClick;
            //
            // linkHelp
            //
            linkHelp.Size             = buttonSize;
            linkHelp.Location         = new Point(376, 17);
            linkHelp.Font             = labelFont;
            linkHelp.TopicId          = "system-login.html";
            linkHelp.ActiveLinkColor  = Color.White;
            linkHelp.VisitedLinkColor = Color.White;
            linkHelp.LinkColor        = Color.White;
            linkHelp.ForeColor        = Color.Transparent;
            linkHelp.TabIndex         = 0;
            linkHelp.Text             = "Help";
            linkHelp.Visible          = false;
            linkHelp.Click           += LinkHelpClick;
            //
            // linkLabelShowConnectionSettings
            //
            linkLabelShowConnectionSettings.Text             = "Connection settings";
            linkLabelShowConnectionSettings.ActiveLinkColor  = Color.White;
            linkLabelShowConnectionSettings.VisitedLinkColor = Color.White;
            linkLabelShowConnectionSettings.LinkColor        = Color.White;
            linkLabelShowConnectionSettings.ForeColor        = Color.Transparent;
            linkLabelShowConnectionSettings.Location         = new Point(0, 115);
            linkLabelShowConnectionSettings.Font             = new Font(labelFont.FontFamily, labelFont.Size - 1);
            linkLabelShowConnectionSettings.AutoSize         = true;
            linkLabelShowConnectionSettings.TabStop          = true;


            linkLabelShowConnectionSettings.Visible = false;



            linkLabelShowConnectionSettings.PreviewKeyDown += linkLabelShowConnectionSettings_PreviewKeyDown;
            linkLabelShowConnectionSettings.Click          += LinkLabelShowConnectionSettingsClick;

            panelLoginPasswordContainer.Controls.Add(labelLogin);
            panelLoginPasswordContainer.Controls.Add(labelPassword);
            panelLoginPasswordContainer.Controls.Add(textBoxLogin);
            panelLoginPasswordContainer.Controls.Add(textBoxPassword);
            panelLoginPasswordContainer.Controls.Add(pictureBoxPasswordBorder);
            panelLoginPasswordContainer.Controls.Add(pictureBoxLoginBorder);
            panelLoginPasswordContainer.Controls.Add(buttonConnect);
            panelLoginPasswordContainer.Controls.Add(buttonExit);
            panelLoginPasswordContainer.Controls.Add(linkLabelShowConnectionSettings);

            panelConnectionSettingsContainer.Controls.Add(labelServerName);
            panelConnectionSettingsContainer.Controls.Add(labelAuthentication);
            panelConnectionSettingsContainer.Controls.Add(comboBoxServerName);
            panelConnectionSettingsContainer.Controls.Add(comboBoxAuthentication);
            panelConnectionSettingsContainer.Controls.Add(pictureBoxAuthenticationBorder);
            panelConnectionSettingsContainer.Controls.Add(pictureBoxServerNameBorder);

            Controls.Add(panelLoginPasswordContainer);
            Controls.Add(panelConnectionSettingsContainer);
            Controls.Add(labelTitle);
            Controls.Add(linkHelp);
        }
コード例 #41
0
        public static void secim(Panel cizimYeri, int sekil, int x1, int y1, int x2, int y2)
        {
            Graphics formGrafik = cizimYeri.CreateGraphics();

            formGrafik.Clear(Color.White);
            Dosyalama.geciciDosyadanCiz(cizimYeri, true);
            Pen kalem = new Pen(Color.Black, 8);

            if (sekil == 0)
            {
                if (x2 - x1 >= 0 && y2 - y1 >= 0)
                {
                    formGrafik.DrawRectangle(kalem, x1 - 20, y1 - 20, x2 - x1 + 40, y2 - y1 + 40);
                }
                else if (x2 - x1 >= 0 && y2 - y1 < 0)
                {
                    formGrafik.DrawRectangle(kalem, x1 - 20, y2 - 20, x2 - x1 + 40, y1 - y2 + 40);
                }
                else if (x2 - x1 < 0 && y2 - y1 >= 0)
                {
                    formGrafik.DrawRectangle(kalem, x2 - 20, y1 - 20, x1 - x2 + 40, y2 - y1 + 40);
                }
                else if (x2 - x1 < 0 && y2 - y1 < 0)
                {
                    formGrafik.DrawRectangle(kalem, x2 - 20, y2 - 20, x1 - x2 + 40, y1 - y2 + 40);
                }
            }
            else if (sekil == 1)
            {
                if (x2 - x1 >= 0 && y2 - y1 >= 0)
                {
                    formGrafik.DrawEllipse(kalem, x1 - ((2 * x2 - 2 * x1) / 2) - 20, y1 - ((2 * x2 - 2 * x1) / 2) - 20, 2 * x2 - 2 * x1 + 40, 2 * x2 - 2 * x1 + 40);
                }
                else if (x2 - x1 >= 0 && y2 - y1 < 0)
                {
                    formGrafik.DrawEllipse(kalem, x1 - ((2 * x2 - 2 * x1) / 2) - 20, y1 - ((2 * x2 - 2 * x1) / 2) - 20, 2 * x2 - 2 * x1 + 40, 2 * x2 - 2 * x1 + 40);
                }
                else if (x2 - x1 < 0 && y2 - y1 >= 0)
                {
                    formGrafik.DrawEllipse(kalem, x1 - ((2 * x2 - 2 * x1) / 2) + 20, y1 - ((2 * x2 - 2 * x1) / 2) + 20, 2 * x2 - 2 * x1 - 40, 2 * x2 - 2 * x1 - 40);
                }
                else if (x2 - x1 < 0 && y2 - y1 < 0)
                {
                    formGrafik.DrawEllipse(kalem, x1 - ((2 * x2 - 2 * x1) / 2) + 20, y1 - ((2 * x2 - 2 * x1) / 2) + 20, 2 * x2 - 2 * x1 - 40, 2 * x2 - 2 * x1 - 40);
                }
            }
            else if (sekil == 2)
            {
                if (x1 < x2)
                {
                    Point[] noktalar = { new Point(x1, y1 - (x2 - x1) - 30), new Point(x1 - (x2 - x1) - 30, y1 + (x2 - x1) + 15), new Point(x1 + (x2 - x1) + 30, y1 + (x2 - x1) + 15) };
                    formGrafik.DrawPolygon(kalem, noktalar);
                }
                else
                {
                    Point[] noktalar = { new Point(x1, y1 - (x2 - x1) + 30), new Point(x1 - (x2 - x1) + 30, y1 + (x2 - x1) - 15), new Point(x1 + (x2 - x1) - 30, y1 + (x2 - x1) - 15) };
                    formGrafik.DrawPolygon(kalem, noktalar);
                }
            }
            else if (sekil == 3)
            {
                if (x1 < x2)
                {
                    Point[] noktalar = { new Point(x1 - (x2 - x1) - 15, y1), new Point(x1 - (x2 - x1) / 2 - 15, y1 - (x2 - x1) - 15), new Point(x1 + (x2 - x1) / 2 + 15, y1 - (x2 - x1) - 15), new Point(x1 + 15 + (x2 - x1), y1), new Point(x1 + (x2 - x1) / 2 + 15, y1 + (x2 - x1) + 15), new Point(x1 - (x2 - x1) / 2 - 15, y1 + (x2 - x1) + 15) };
                    formGrafik.DrawPolygon(kalem, noktalar);
                }
                else
                {
                    Point[] noktalar = { new Point(x1 - (x2 - x1) + 15, y1), new Point(x1 - (x2 - x1) / 2 + 15, y1 - (x2 - x1) + 15), new Point(x1 + (x2 - x1) / 2 - 15, y1 - (x2 - x1) + 15), new Point(x1 - 15 + (x2 - x1), y1), new Point(x1 + (x2 - x1) / 2 - 15, y1 + (x2 - x1) - 15), new Point(x1 - (x2 - x1) / 2 + 15, y1 + (x2 - x1) - 15) };
                    formGrafik.DrawPolygon(kalem, noktalar);
                }
            }
        }
コード例 #42
0
ファイル: Form2.cs プロジェクト: vladkruume/RaspisanieProga
        public Form2()
        {
            //InitializeComponent();
            this.Text = "Форма с разными элементами управления";
            this.Size = new Size {
                Height = 800, Width = 800
            };

            treeView           = new TreeView();
            treeView.BackColor = Color.Chocolate;
            treeView.Dock      = DockStyle.Left;
            treeView.Width     = 150;

            treeNode = new TreeNode("Элемент управления");
            treeNode.Expand();
            treeNode.Nodes.Add(new TreeNode("Label Надпись"));
            treeNode.Nodes.Add(new TreeNode("Button Кнопка"));
            treeNode.Nodes.Add(new TreeNode("CheckBox Флажок"));
            treeNode.Nodes.Add(new TreeNode("Radio Переключатель"));
            treeNode.Nodes.Add(new TreeNode("TabControl Вкладки"));
            treeNode.Nodes.Add(new TreeNode("ListBox-список"));
            treeNode.Nodes.Add(new TreeNode("RichTextBox-текст"));
            treeNode.Nodes.Add(new TreeNode("Clear Очистить"));
            treeView.Nodes.Add(treeNode);
            treeView.AfterSelect += TreeView_AfterSelect;
            Controls.Add(treeView);

            panel             = new Panel();
            panel.Dock        = DockStyle.Right;
            panel.BorderStyle = BorderStyle.Fixed3D;
            panel.Width       = this.Width - treeView.Width;
            panel.Height      = this.Height;
            panel.BackColor   = Color.BurlyWood;
            Controls.Add(panel);

            lbl = new Label
            {
                Text      = "Это метка.\nВторая строка метки",
                ForeColor = Color.Black,
            };



            btn = new Button
            {
                Text      = "Жмякай",
                ForeColor = Color.Black,
                BackColor = Color.Chocolate,
                FlatStyle = FlatStyle.Flat,
                Width     = 100
            };

            btn.FlatAppearance.BorderColor = Color.Red;
            btn.FlatAppearance.BorderSize  = 1;
            btn.Click += (sender, e) =>
            {
                Application.Exit();
            };



            checkBox1 = new CheckBox
            {
                Text = "Синий",
            };
            checkBox1.Click += Cveta;
            checkBox2        = new CheckBox
            {
                Text = "Красный",
            };
            checkBox2.Click += Cveta;
            checkBox3        = new CheckBox
            {
                Text   = "Желтый",
                Height = 100,
                Image  = global::WindowsForms_Vytas.Properties.Resources.check
            };
            checkBox3.Click += Cveta;
        }
コード例 #43
0
 public __AM_FM_MainVTButtons(Panel Panel)
 {
     this.Panel = Panel;
 }
コード例 #44
0
 public static void ciz(bool kontrol, Panel cizimYeri, int sekil, Color renk, int x1, int y1, int x2, int y2)
 {
     if (kontrol)
     {
         Graphics   formGrafik = cizimYeri.CreateGraphics();
         SolidBrush firca      = new SolidBrush(renk);
         formGrafik.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
         if (sekil == 0)
         {
             if (x2 - x1 >= 0 && y2 - y1 >= 0)
             {
                 if (x2 >= 1037 || y2 >= 779)
                 {
                     if (Kontrol.SiniraGelindi == false)
                     {
                         Kontrol.sinirAsildi(x2, y2);
                     }
                 }
                 else
                 {
                     Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                     {
                         formGrafik.FillRectangle(firca, x1, y1, x2 - x1, y2 - y1);
                     }
                 }
             }
             else if (x2 - x1 >= 0 && y2 - y1 < 0)
             {
                 if (x1 >= 1037 || y2 <= 0)
                 {
                     if (Kontrol.SiniraGelindi == false)
                     {
                         Kontrol.sinirAsildi(x2, y2);
                     }
                 }
                 else
                 {
                     Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                     {
                         formGrafik.FillRectangle(firca, x1, y2, x2 - x1, y1 - y2);
                     }
                 }
             }
             else if (x2 - x1 < 0 && y2 - y1 >= 0)
             {
                 if (x2 <= 0 || y2 >= 779)
                 {
                     if (Kontrol.SiniraGelindi == false)
                     {
                         Kontrol.sinirAsildi(x2, y2);
                     }
                 }
                 else
                 {
                     Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                     {
                         formGrafik.FillRectangle(firca, x2, y1, x1 - x2, y2 - y1);
                     }
                 }
             }
             else if (x2 - x1 < 0 && y2 - y1 < 0)
             {
                 if (x2 <= 0 || y2 <= 0)
                 {
                     if (Kontrol.SiniraGelindi == false)
                     {
                         Kontrol.sinirAsildi(x2, y2);
                     }
                 }
                 else
                 {
                     Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                     {
                         formGrafik.FillRectangle(firca, x2, y2, x1 - x2, y1 - y2);
                     }
                 }
             }
         }
         else if (sekil == 1)
         {
             if (x2 > x1 && (x2 >= 1037 || x1 - ((2 * x2 - 2 * x1) / 2) <= 0 || y1 - ((2 * x2 - 2 * x1) / 2) + 2 * x2 - 2 * x1 >= 779 || y1 - ((2 * x2 - 2 * x1) / 2) <= 0))
             {
                 if (Kontrol.SiniraGelindi == false)
                 {
                     Kontrol.sinirAsildi(x2, y2);
                 }
             }
             else if (x2 < x1 && (x2 <= 0 || x1 + (x1 - x2) >= 1037 || y1 - (x1 - x2) <= 0 || y1 + (x1 - x2) >= 779))
             {
                 if (Kontrol.SiniraGelindi == false)
                 {
                     Kontrol.sinirAsildi(x2, y2);
                 }
             }
             else
             {
                 Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                 {
                     formGrafik.FillEllipse(firca, x1 - ((2 * x2 - 2 * x1) / 2), y1 - ((2 * x2 - 2 * x1) / 2), 2 * x2 - 2 * x1, 2 * x2 - 2 * x1);
                 }
             }
         }
         else if (sekil == 2)
         {
             Point[] noktalar = { new Point(x1, y1 - (x2 - x1)), new Point(x1 - (x2 - x1), y1 + (x2 - x1)), new Point(x1 + (x2 - x1), y1 + (x2 - x1)) };
             if (x2 > x1 && (y1 - (x2 - x1) <= 0 || y1 + (x2 - x1) >= 779 || x1 - (x2 - x1) <= 0 || x1 + (x2 - x1) >= 1037))
             {
                 if (Kontrol.SiniraGelindi == false)
                 {
                     Kontrol.sinirAsildi(x2, y2);
                 }
             }
             else if (x2 < x1 && (y1 - (x2 - x1) >= 779 || y1 + (x2 - x1) <= 0 || x1 - (x2 - x1) >= 1037 || x1 + (x2 - x1) <= 0))
             {
                 if (Kontrol.SiniraGelindi == false)
                 {
                     Kontrol.sinirAsildi(x2, y2);
                 }
             }
             else
             {
                 Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                 {
                     formGrafik.FillPolygon(firca, noktalar);
                 }
             }
         }
         else if (sekil == 3)
         {
             Point[] noktalar = { new Point(x1 - (x2 - x1), y1), new Point(x1 - (x2 - x1) / 2, y1 - (x2 - x1)), new Point(x1 + (x2 - x1) / 2, y1 - (x2 - x1)), new Point(x1 + (x2 - x1), y1), new Point(x1 + (x2 - x1) / 2, y1 + (x2 - x1)), new Point(x1 - (x2 - x1) / 2, y1 + (x2 - x1)) };
             if (x2 > x1 && (x1 - (x2 - x1) <= 0 || x1 + (x2 - x1) >= 1037 || y1 - (x2 - x1) <= 0 || y1 + (x2 - x1) >= 779))
             {
                 if (Kontrol.SiniraGelindi == false)
                 {
                     Kontrol.sinirAsildi(x2, y2);
                 }
             }
             else if (x2 < x1 && (x1 - (x2 - x1) >= 1037 || x1 + (x2 - x1) <= 0 || y1 + (x2 - x1) <= 0 || y1 - (x2 - x1) >= 779))
             {
                 if (Kontrol.SiniraGelindi == false)
                 {
                     Kontrol.sinirAsildi(x2, y2);
                 }
             }
             else
             {
                 Kontrol.sinirİcinde(); formGrafik.Clear(Color.White); if (Kontrol.SiniraGelindi == false)
                 {
                     formGrafik.FillPolygon(firca, noktalar);
                 }
             }
         }
     }
 }
コード例 #45
0
 private void InitializeComponent()
 {
     this.panelTop            = new System.Windows.Forms.Panel();
     this.toolStrip1          = new System.Windows.Forms.ToolStrip();
     this.toolStripLabel1     = new System.Windows.Forms.ToolStripLabel();
     this.tbPageFirst         = new System.Windows.Forms.ToolStripButton();
     this.tbPagePrevious      = new System.Windows.Forms.ToolStripButton();
     this.tbPageNumber        = new System.Windows.Forms.ToolStripTextBox();
     this.tbTotalPages        = new System.Windows.Forms.ToolStripLabel();
     this.tbPageNext          = new System.Windows.Forms.ToolStripButton();
     this.tbPageLast          = new System.Windows.Forms.ToolStripButton();
     this.toolStripLabel3     = new System.Windows.Forms.ToolStripLabel();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.toolStripLabel2     = new System.Windows.Forms.ToolStripLabel();
     this.tpZoomOut           = new System.Windows.Forms.ToolStripButton();
     this.tpZoomIn            = new System.Windows.Forms.ToolStripButton();
     this.toolStripLabel4     = new System.Windows.Forms.ToolStripLabel();
     this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
     this.panelContent        = new System.Windows.Forms.Panel();
     this.pbPage = new System.Windows.Forms.PictureBox();
     this.panelTop.SuspendLayout();
     this.toolStrip1.SuspendLayout();
     this.panelContent.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pbPage)).BeginInit();
     this.SuspendLayout();
     //
     // panelTop
     //
     this.panelTop.Controls.Add(this.toolStrip1);
     this.panelTop.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panelTop.Location = new System.Drawing.Point(0, 0);
     this.panelTop.Name     = "panelTop";
     this.panelTop.Size     = new System.Drawing.Size(919, 32);
     this.panelTop.TabIndex = 3;
     //
     // toolStrip1
     //
     this.toolStrip1.BackColor = System.Drawing.Color.White;
     this.toolStrip1.Font      = new System.Drawing.Font("Segoe UI", 9F);
     this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.toolStripLabel1,
         this.tbPageFirst,
         this.tbPagePrevious,
         this.tbPageNumber,
         this.tbTotalPages,
         this.tbPageNext,
         this.tbPageLast,
         this.toolStripLabel3,
         this.toolStripSeparator1,
         this.toolStripLabel2,
         this.tpZoomOut,
         this.tpZoomIn,
         this.toolStripLabel4,
         this.toolStripSeparator2
     });
     this.toolStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
     this.toolStrip1.Location    = new System.Drawing.Point(0, 0);
     this.toolStrip1.Name        = "toolStrip1";
     this.toolStrip1.RenderMode  = System.Windows.Forms.ToolStripRenderMode.System;
     this.toolStrip1.Size        = new System.Drawing.Size(919, 31);
     this.toolStrip1.TabIndex    = 3;
     this.toolStrip1.Text        = "toolStrip1";
     //
     // toolStripLabel1
     //
     this.toolStripLabel1.Name = "toolStripLabel1";
     this.toolStripLabel1.Size = new System.Drawing.Size(51, 28);
     this.toolStripLabel1.Text = "    Page: ";
     //
     // tbPageFirst
     //
     this.tbPageFirst.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tbPageFirst.Image        = EspackFormControlsNS.Properties.Resources.tb_first;
     //var a = global::EspackFormControlsNS.EspackFileStreamControl.Resources.tb_first
     this.tbPageFirst.ImageScaling          = System.Windows.Forms.ToolStripItemImageScaling.None;
     this.tbPageFirst.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tbPageFirst.Name        = "tbPageFirst";
     this.tbPageFirst.Size        = new System.Drawing.Size(28, 28);
     this.tbPageFirst.Text        = "toolStripButton1";
     this.tbPageFirst.ToolTipText = "First Page";
     this.tbPageFirst.Click      += new System.EventHandler(this.tbPageFirst_Click);
     //
     // tbPagePrevious
     //
     this.tbPagePrevious.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tbPagePrevious.Image                 = Properties.Resources.tb_previous;
     this.tbPagePrevious.ImageScaling          = System.Windows.Forms.ToolStripItemImageScaling.None;
     this.tbPagePrevious.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tbPagePrevious.Name        = "tbPagePrevious";
     this.tbPagePrevious.Size        = new System.Drawing.Size(28, 28);
     this.tbPagePrevious.Text        = "toolStripButton2";
     this.tbPagePrevious.ToolTipText = "Previous Page";
     this.tbPagePrevious.Click      += new System.EventHandler(this.tbPagePrevious_Click);
     //
     // tbPageNumber
     //
     this.tbPageNumber.Name = "tbPageNumber";
     this.tbPageNumber.Size = new System.Drawing.Size(40, 31);
     //
     // tbTotalPages
     //
     this.tbTotalPages.Name = "tbTotalPages";
     this.tbTotalPages.Size = new System.Drawing.Size(0, 28);
     //
     // tbPageNext
     //
     this.tbPageNext.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tbPageNext.Image                 = global::EspackFormControlsNS.Properties.Resources.tb_next;
     this.tbPageNext.ImageScaling          = System.Windows.Forms.ToolStripItemImageScaling.None;
     this.tbPageNext.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tbPageNext.Name        = "tbPageNext";
     this.tbPageNext.Size        = new System.Drawing.Size(28, 28);
     this.tbPageNext.Text        = "toolStripButton3";
     this.tbPageNext.ToolTipText = "Next Page";
     this.tbPageNext.Click      += new System.EventHandler(this.tbPageNext_Click);
     //
     // tbPageLast
     //
     this.tbPageLast.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tbPageLast.Image                 = global::EspackFormControlsNS.Properties.Resources.tb_last;
     this.tbPageLast.ImageScaling          = System.Windows.Forms.ToolStripItemImageScaling.None;
     this.tbPageLast.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tbPageLast.Name        = "tbPageLast";
     this.tbPageLast.Size        = new System.Drawing.Size(28, 28);
     this.tbPageLast.Text        = "toolStripButton4";
     this.tbPageLast.ToolTipText = "LastPage";
     this.tbPageLast.Click      += new System.EventHandler(this.tbPageLast_Click);
     //
     // toolStripLabel3
     //
     this.toolStripLabel3.Name = "toolStripLabel3";
     this.toolStripLabel3.Size = new System.Drawing.Size(19, 28);
     this.toolStripLabel3.Text = "    ";
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31);
     //
     // toolStripLabel2
     //
     this.toolStripLabel2.Name = "toolStripLabel2";
     this.toolStripLabel2.Size = new System.Drawing.Size(19, 28);
     this.toolStripLabel2.Text = "    ";
     //
     // tpZoomOut
     //
     this.tpZoomOut.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tpZoomOut.Image                 = global::EspackFormControlsNS.Properties.Resources.tb_zoom_out;
     this.tpZoomOut.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tpZoomOut.Name        = "tpZoomOut";
     this.tpZoomOut.Size        = new System.Drawing.Size(23, 28);
     this.tpZoomOut.Text        = "-";
     this.tpZoomOut.ToolTipText = "Zoom Out";
     this.tpZoomOut.Click      += new System.EventHandler(this.tpZoomOut_Click);
     //
     // tpZoomIn
     //
     this.tpZoomIn.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tpZoomIn.Image                 = global::EspackFormControlsNS.Properties.Resources.tb_zoom_in;
     this.tpZoomIn.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.tpZoomIn.Name        = "tpZoomIn";
     this.tpZoomIn.Size        = new System.Drawing.Size(23, 28);
     this.tpZoomIn.Text        = "+";
     this.tpZoomIn.ToolTipText = "Zoom In";
     this.tpZoomIn.Click      += new System.EventHandler(this.tpZoomIn_Click);
     //
     // toolStripLabel4
     //
     this.toolStripLabel4.Name = "toolStripLabel4";
     this.toolStripLabel4.Size = new System.Drawing.Size(19, 28);
     this.toolStripLabel4.Text = "    ";
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     this.toolStripSeparator2.Size = new System.Drawing.Size(6, 31);
     //
     // panelContent
     //
     this.panelContent.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.panelContent.BackColor    = System.Drawing.SystemColors.AppWorkspace;
     this.panelContent.Controls.Add(this.pbPage);
     this.panelContent.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panelContent.Location = new System.Drawing.Point(0, 32);
     this.panelContent.Name     = "panelContent";
     this.panelContent.Size     = new System.Drawing.Size(919, 703);
     this.panelContent.TabIndex = 5;
     //
     // pbPage
     //
     this.pbPage.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.pbPage.Location = new System.Drawing.Point(0, 0);
     this.pbPage.Name     = "pbPage";
     this.pbPage.Size     = new System.Drawing.Size(919, 703);
     this.pbPage.TabIndex = 2;
     this.pbPage.TabStop  = false;
     //
     // EspackFileDataContainerPreview
     //
     this.Controls.Add(this.panelContent);
     this.Controls.Add(this.panelTop);
     this.Name = "EspackFileDataContainerPreview";
     this.Size = new System.Drawing.Size(919, 735);
     this.panelTop.ResumeLayout(false);
     this.panelTop.PerformLayout();
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     this.panelContent.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.pbPage)).EndInit();
     this.ResumeLayout(false);
 }
コード例 #46
0
ファイル: menuPrincipal.cs プロジェクト: Abner17/RentaVideos
 internal static bool Animate(Panel registroVideo, Effect roll)
 {
     throw new NotImplementedException();
 }
コード例 #47
0
ファイル: ScrollCustomColors.cs プロジェクト: Budya/Petzold
        public ScrollCustomColors()
        {
            Title = "Scroll Cusom Colors";

            Width  = 500;
            Height = 300;

            // GridMain panel
            Grid gridMain = new Grid();

            Content = gridMain;

            // Seting Columns
            ColumnDefinition colDef = new ColumnDefinition();

            colDef.Width = new GridLength(200, GridUnitType.Pixel);
            gridMain.ColumnDefinitions.Add(colDef);

            colDef       = new ColumnDefinition();
            colDef.Width = GridLength.Auto;
            gridMain.ColumnDefinitions.Add(colDef);

            colDef       = new ColumnDefinition();
            colDef.Width = new GridLength(100, GridUnitType.Star);
            gridMain.ColumnDefinitions.Add(colDef);

            // Vertical Splitter
            GridSplitter split = new GridSplitter();

            split.ShowsPreview        = true;
            split.HorizontalAlignment = HorizontalAlignment.Center;
            split.VerticalAlignment   = VerticalAlignment.Stretch;
            split.Width = 6;
            gridMain.Children.Add(split);
            Grid.SetRow(split, 0);
            Grid.SetColumn(split, 1);

            // Shows color in left side of splitter
            pnlColor            = new StackPanel();
            pnlColor.Background = new SolidColorBrush(SystemColors.WindowColor);
            gridMain.Children.Add(pnlColor);
            Grid.SetRow(pnlColor, 0);
            Grid.SetColumn(pnlColor, 2);

            // Second panel by left side of splitter
            Grid grid = new Grid();

            gridMain.Children.Add(grid);
            Grid.SetRow(grid, 0);
            Grid.SetColumn(grid, 0);

            //Three strings
            RowDefinition rowDef = new RowDefinition();

            rowDef.Height = GridLength.Auto;
            grid.RowDefinitions.Add(rowDef);

            rowDef        = new RowDefinition();
            rowDef.Height = new GridLength(100, GridUnitType.Star);
            grid.RowDefinitions.Add(rowDef);

            rowDef        = new RowDefinition();
            rowDef.Height = GridLength.Auto;
            grid.RowDefinitions.Add(rowDef);

            //Three columns
            for (int i = 0; i < 3; i++)
            {
                colDef       = new ColumnDefinition();
                colDef.Width = new GridLength(33, GridUnitType.Star);
                grid.ColumnDefinitions.Add(colDef);
            }

            for (int i = 0; i < 3; i++)
            {
                Label lbl = new Label();
                lbl.Content             = new string[] { "Red", "Green", "Blue" }[i];
                lbl.HorizontalAlignment = HorizontalAlignment.Center;
                grid.Children.Add(lbl);
                Grid.SetRow(lbl, 0);
                Grid.SetColumn(lbl, i);

                scrolls[i]               = new ScrollBar();
                scrolls[i].Focusable     = true;
                scrolls[i].Orientation   = Orientation.Vertical;
                scrolls[i].Minimum       = 0;
                scrolls[i].Maximum       = 255;
                scrolls[i].SmallChange   = 1;
                scrolls[i].LargeChange   = 16;
                scrolls[i].ValueChanged += ScrollOnValueChanged;
                grid.Children.Add(scrolls[i]);
                Grid.SetRow(scrolls[i], 1);
                Grid.SetColumn(scrolls[i], i);

                txtValues[i] = new TextBlock();
                txtValues[i].TextAlignment       = TextAlignment.Center;
                txtValues[i].HorizontalAlignment = HorizontalAlignment.Center;
                txtValues[i].Margin = new Thickness(5);
                grid.Children.Add(txtValues[i]);
                Grid.SetRow(txtValues[i], 2);
                Grid.SetColumn(txtValues[i], i);
            }

            // Initiation of Scroll
            Color clr = (pnlColor.Background as SolidColorBrush).Color;

            scrolls[0].Value = clr.R;
            scrolls[1].Value = clr.G;
            scrolls[2].Value = clr.B;

            // Set Focus
            scrolls[0].Focus();
        }
コード例 #48
0
        /// <summary>
        /// This method runs when the update starts
        /// </summary>
        public override void OnSeriesUpdateStart()
        {
            ActiveSplitters = 0;

            if (SplittersCollector == int.MaxValue - 1)
            {
                //just in case!
                Splitters.ForEach(s => s.SplitterCollectorIndex = 0);
                SplittersCollector = 0;
            }

            SplittersCollector++;

            if (Figure != null && Values != null)
            {
                var xIni = ChartFunctions.ToDrawMargin(Values.GetTracker(this).XLimit.Min, AxisOrientation.X, Model.Chart, ScalesXAt);

                if (Model.Chart.View.DisableAnimations)
                {
                    Figure.StartPoint = new Point(xIni, Model.Chart.DrawMargin.Height);
                }
                else
                {
                    Figure.BeginAnimation(PathFigure.StartPointProperty,
                                          new PointAnimation(new Point(xIni, Model.Chart.DrawMargin.Height),
                                                             Model.Chart.View.AnimationsSpeed));
                }
            }

            if (IsPathInitialized)
            {
                Model.Chart.View.EnsureElementBelongsToCurrentDrawMargin(Path);
                Path.Stroke          = Stroke;
                Path.StrokeThickness = StrokeThickness;
                Path.Fill            = Fill;
                Path.Visibility      = Visibility;
                Path.StrokeDashArray = StrokeDashArray;
                return;
            }

            IsPathInitialized = true;

            Path = new Path
            {
                Stroke          = Stroke,
                StrokeThickness = StrokeThickness,
                Fill            = Fill,
                Visibility      = Visibility,
                StrokeDashArray = StrokeDashArray
            };

            var geometry = new PathGeometry();

            Figure = new PathFigure();
            geometry.Figures.Add(Figure);
            Path.Data = geometry;
            Model.Chart.View.AddToDrawMargin(Path);

            var x = ChartFunctions.ToDrawMargin(ActualValues.GetTracker(this).XLimit.Min, AxisOrientation.X, Model.Chart, ScalesXAt);

            Figure.StartPoint = new Point(x, Model.Chart.DrawMargin.Height);

            var i = Model.Chart.View.Series.IndexOf(this);

            Panel.SetZIndex(Path, Model.Chart.View.Series.Count - i);
        }
コード例 #49
0
 private void SwitchMenus(Panel SwitchFrom, Panel SwitchTo) // as yet nonfunctional
 {
     CharCreatePanel.RemoveWidget(SwitchFrom);
     CharCreatePanel.AddWidget(SwitchTo);
 }
コード例 #50
0
        public PagePanel_Player(int Width, int Height) : base(Width, Height)
        {
            EditPlayerInfoButton           = new Button();
            EditPlayerInfoButton.Enabled   = false;
            EditPlayerInfoButton.FlatStyle = FlatStyle.Flat;
            EditPlayerInfoButton.Text      = MainForm.CurrentLanguage["EditPlayer"];
            EditPlayerInfoButton.BackColor = Color.FromArgb(100, 150, 150, 150);
            EditPlayerInfoButton.Bounds    = new Rectangle(215, 3, 80, 30);
            EditPlayerInfoButton.Click    += (s, e) =>
            {
                int i = Convert.ToInt32(PlayerListView.SelectedItems[0].Text);
                PlayerEditorForm f = new PlayerEditorForm(HackContext.GameContext.Players[i], i == HackContext.GameContext.MyPlayerIndex);
                f.Show();
            };
            Controls.Add(EditPlayerInfoButton);

            TpToPlayerButton           = new Button();
            TpToPlayerButton.Enabled   = false;
            TpToPlayerButton.FlatStyle = FlatStyle.Flat;
            TpToPlayerButton.Text      = MainForm.CurrentLanguage["TpTo"];
            TpToPlayerButton.BackColor = Color.FromArgb(100, 150, 150, 150);
            TpToPlayerButton.Bounds    = new Rectangle(215, 33, 80, 30);
            TpToPlayerButton.Click    += (s, e) =>
            {
                var p  = HackContext.GameContext.Players[Convert.ToInt32(PlayerListView.SelectedItems[0].Text)];
                var mp = HackContext.GameContext.MyPlayer;
                mp.X = p.X;
                mp.Y = p.Y;
            };
            Controls.Add(TpToPlayerButton);

            AddBuffButton           = new Button();
            AddBuffButton.Enabled   = false;
            AddBuffButton.FlatStyle = FlatStyle.Flat;
            AddBuffButton.Text      = MainForm.CurrentLanguage["AddBuff"];
            AddBuffButton.BackColor = Color.FromArgb(100, 150, 150, 150);
            AddBuffButton.Bounds    = new Rectangle(215, 63, 80, 30);
            Controls.Add(AddBuffButton);
            AddBuffButton.Click += (s, e) =>
            {
                var ps = PlayerListView.SelectedIndices;
                if (ps.Count == 0)
                {
                    return;
                }

                MForm AddBuffMForm = new MForm
                {
                    BackColor     = Color.FromArgb(90, 90, 90),
                    Text          = MainForm.CurrentLanguage["AddBuff"],
                    StartPosition = FormStartPosition.CenterParent,
                    ClientSize    = new Size(245, 72)
                };

                Label BuffTypeTip = new Label()
                {
                    Text      = MainForm.CurrentLanguage["BuffType"],
                    Location  = new Point(0, 0),
                    Size      = new Size(80, 20),
                    TextAlign = ContentAlignment.MiddleCenter
                };
                AddBuffMForm.MainPanel.Controls.Add(BuffTypeTip);

                TextBox BuffID = new TextBox
                {
                    BorderStyle = BorderStyle.FixedSingle,
                    BackColor   = Color.FromArgb(120, 120, 120),
                    Text        = "0",
                    Location    = new Point(85, 0),
                    Size        = new Size(95, 20)
                };
                BuffID.KeyPress += (s1, e1) => e1.Handled = e1.Handled || (!Char.IsNumber(e1.KeyChar) && e1.KeyChar != 8 && e1.KeyChar != '-');
                AddBuffMForm.MainPanel.Controls.Add(BuffID);


                Label BuffTimeTip = new Label()
                {
                    Text      = MainForm.CurrentLanguage["BuffTime"],
                    Location  = new Point(0, 20),
                    Size      = new Size(80, 20),
                    TextAlign = ContentAlignment.MiddleCenter
                };
                AddBuffMForm.MainPanel.Controls.Add(BuffTimeTip);

                TextBox BuffTime = new TextBox
                {
                    BorderStyle = BorderStyle.FixedSingle,
                    BackColor   = Color.FromArgb(120, 120, 120),
                    Text        = "0",
                    Location    = new Point(85, 20),
                    Size        = new Size(95, 20)
                };
                BuffTime.KeyPress += (s1, e1) => e1.Handled = e1.Handled || (!Char.IsNumber(e1.KeyChar) && e1.KeyChar != 8 && e1.KeyChar != '-');
                AddBuffMForm.MainPanel.Controls.Add(BuffTime);

                Button ConfirmButton = new Button();
                ConfirmButton.Text      = MainForm.CurrentLanguage["Confirm"];
                ConfirmButton.FlatStyle = FlatStyle.Flat;
                ConfirmButton.Size      = new Size(65, 40);
                ConfirmButton.Location  = new Point(180, 0);
                ConfirmButton.Click    += (s1, e1) =>
                {
                    HackContext.GameContext.Players[ps[0]].AddBuff(Convert.ToInt32(BuffID.Text), Convert.ToInt32(BuffTime.Text), false);
                    AddBuffMForm.Dispose();
                };
                AddBuffMForm.MainPanel.Controls.Add(ConfirmButton);
                AddBuffMForm.ShowDialog(this);
            };

            SetPetButton           = new Button();
            SetPetButton.Enabled   = false;
            SetPetButton.FlatStyle = FlatStyle.Flat;
            SetPetButton.Text      = MainForm.CurrentLanguage["SetPet"];
            SetPetButton.BackColor = Color.FromArgb(100, 150, 150, 150);
            SetPetButton.Bounds    = new Rectangle(215, 93, 80, 30);
            Controls.Add(SetPetButton);
            SetPetButton.Click += (s, e) =>
            {
                var ps = PlayerListView.SelectedIndices;
                if (ps.Count == 0)
                {
                    return;
                }

                MForm SetPetMForm = new MForm
                {
                    BackColor     = Color.FromArgb(90, 90, 90),
                    Text          = MainForm.CurrentLanguage["SetPet"],
                    StartPosition = FormStartPosition.CenterParent,
                    ClientSize    = new Size(245, 52)
                };

                Label PetTypeTip = new Label()
                {
                    Text      = MainForm.CurrentLanguage["Pet"],
                    Location  = new Point(0, 0),
                    Size      = new Size(80, 20),
                    TextAlign = ContentAlignment.MiddleCenter
                };
                SetPetMForm.MainPanel.Controls.Add(PetTypeTip);

                ComboBox PetComboBox = new ComboBox()
                {
                    DropDownStyle  = ComboBoxStyle.DropDownList,
                    DropDownHeight = 150,
                    Location       = new Point(85, 0),
                    Size           = new Size(95, 20)
                };
                foreach (var o in GameResLoader.Pets)
                {
                    PetComboBox.Items.Add(o);
                }
                PetComboBox.SelectedIndex = 0;
                SetPetMForm.MainPanel.Controls.Add(PetComboBox);

                Button ConfirmButton = new Button();
                ConfirmButton.Text      = MainForm.CurrentLanguage["Confirm"];
                ConfirmButton.FlatStyle = FlatStyle.Flat;
                ConfirmButton.Size      = new Size(65, 20);
                ConfirmButton.Location  = new Point(180, 0);
                ConfirmButton.Click    += (s1, e1) =>
                {
                    HackContext.GameContext.Players[ps[0]].AddBuff(GetPetFromIndex(PetComboBox.SelectedIndex), 18000, false);
                    SetPetMForm.Dispose();
                };
                SetPetMForm.MainPanel.Controls.Add(ConfirmButton);
                SetPetMForm.ShowDialog(this);
            };

            SetMountButton           = new Button();
            SetMountButton.Enabled   = false;
            SetMountButton.FlatStyle = FlatStyle.Flat;
            SetMountButton.Text      = MainForm.CurrentLanguage["SetMount"];
            SetMountButton.BackColor = Color.FromArgb(100, 150, 150, 150);
            SetMountButton.Bounds    = new Rectangle(215, 123, 80, 30);
            Controls.Add(SetMountButton);
            SetMountButton.Click += (s, e) =>
            {
                var ps = PlayerListView.SelectedIndices;
                if (ps.Count == 0)
                {
                    return;
                }

                MForm SetMountMForm = new MForm
                {
                    BackColor     = Color.FromArgb(90, 90, 90),
                    Text          = MainForm.CurrentLanguage["SetMount"],
                    StartPosition = FormStartPosition.CenterParent,
                    ClientSize    = new Size(245, 52)
                };

                Label MountTypeTip = new Label()
                {
                    Text      = MainForm.CurrentLanguage["Mount"],
                    Location  = new Point(0, 0),
                    Size      = new Size(80, 20),
                    TextAlign = ContentAlignment.MiddleCenter
                };
                SetMountMForm.MainPanel.Controls.Add(MountTypeTip);

                ComboBox MountComboBox = new ComboBox()
                {
                    DropDownStyle  = ComboBoxStyle.DropDownList,
                    DropDownHeight = 150,
                    Location       = new Point(85, 0),
                    Size           = new Size(95, 20)
                };
                foreach (var o in GameResLoader.Mounts)
                {
                    MountComboBox.Items.Add(o);
                }
                MountComboBox.SelectedIndex = 0;
                SetMountMForm.MainPanel.Controls.Add(MountComboBox);

                Button ConfirmButton = new Button();
                ConfirmButton.Text      = MainForm.CurrentLanguage["Confirm"];
                ConfirmButton.FlatStyle = FlatStyle.Flat;
                ConfirmButton.Size      = new Size(65, 20);
                ConfirmButton.Location  = new Point(180, 0);
                ConfirmButton.Click    += (s1, e1) =>
                {
                    HackContext.GameContext.Players[ps[0]].AddBuff(GetMountFromIndex(MountComboBox.SelectedIndex), 18000, false);
                    SetMountMForm.Dispose();
                };
                SetMountMForm.MainPanel.Controls.Add(ConfirmButton);
                SetMountMForm.ShowDialog(this);
            };

            PlayerAttributePanel             = new Panel();
            PlayerAttributePanel.Bounds      = new Rectangle(3, 203, 210, 165);
            PlayerAttributePanel.BorderStyle = BorderStyle.FixedSingle;
            Controls.Add(PlayerAttributePanel);

            PlayerNameInfoView    = AddPlayerAttribute(MainForm.CurrentLanguage["PlayerName"], 120);
            PlayerLifeInfoView    = AddPlayerAttribute(MainForm.CurrentLanguage["Life"], 120);
            PlayerManaInfoView    = AddPlayerAttribute(MainForm.CurrentLanguage["Mana"], 120);
            PlayerMaxLifeInfoView = AddPlayerAttribute(MainForm.CurrentLanguage["MaxLife"], 120);
            PlayerMaxManaInfoView = AddPlayerAttribute(MainForm.CurrentLanguage["MaxMana"], 120);
            PlayerXInfoView       = AddPlayerAttribute(MainForm.CurrentLanguage["X_Coor"], 120);
            PlayerYInfoView       = AddPlayerAttribute(MainForm.CurrentLanguage["Y_Coor"], 120);
            PlayerInventoryBaseAddressInfoView = AddPlayerAttribute(MainForm.CurrentLanguage["PlayerInvAddress"], 120);


            PlayerListView = new MListView();
            PlayerListView.SelectedIndexChanged += (s, e) =>
            {
                var m = s as MListView;
                if (m.SelectedIndices.Count > 0)
                {
                    EditPlayerInfoButton.Enabled = true;
                    TpToPlayerButton.Enabled     = true;
                    AddBuffButton.Enabled        = m.SelectedIndices[0] == HackContext.GameContext.MyPlayerIndex;
                    SetPetButton.Enabled         = m.SelectedIndices[0] == HackContext.GameContext.MyPlayerIndex;
                    SetMountButton.Enabled       = m.SelectedIndices[0] == HackContext.GameContext.MyPlayerIndex;
                }
                else
                {
                    EditPlayerInfoButton.Enabled = false;
                    TpToPlayerButton.Enabled     = false;
                    AddBuffButton.Enabled        = false;
                    SetPetButton.Enabled         = false;
                    SetMountButton.Enabled       = false;
                    ClearPlayerAttribute();
                }
            };
            PlayerListView.Bounds = new Rectangle(3, 3, 210, 200);
            PlayerListView.Columns.Add(MainForm.CurrentLanguage["Index"], 40);
            PlayerListView.Columns.Add(MainForm.CurrentLanguage["Name"], 70);
            PlayerListView.Columns.Add(MainForm.CurrentLanguage["Life"], 50);
            PlayerListView.Columns.Add(MainForm.CurrentLanguage["Mana"], 50);
            Controls.Add(PlayerListView);


            UpdatePlayerTimer          = new Timer();
            UpdatePlayerTimer.Interval = 50;            //每隔50ms进行一次玩家列表的检查和更新
            UpdatePlayerTimer.Tick    += (s, e) =>
            {
                if (PlayerListView.SelectedIndices.Count > 0)
                {
                    UpdatePlayerAttribute(HackContext.GameContext.Players[Convert.ToInt32(PlayerListView.SelectedItems[0].Text)]);
                }
                if (Visible)
                {
                    UpdatePlayerList();
                }
            };
            UpdatePlayerTimer.Start();            //开启更新线程
        }
コード例 #51
0
        private void ColorPicker_Loaded(object sender, RoutedEventArgs e)
        {
            FindAndGiveAutomationIdToVisualChild("ColorSpectrum");

            spectrumRectangle = FindVisualChildByName(this.ColorPicker, "SpectrumRectangle") as Rectangle;

            if (spectrumRectangle != null)
            {
                spectrumRectangle.RegisterPropertyChangedCallback(Shape.FillProperty, new DependencyPropertyChangedCallback(SpectrumRectangleFillChanged));
            }

            colorSpectrumInputTarget = FindVisualChildByName(this.ColorPicker, "InputTarget") as FrameworkElement;

            if (colorSpectrumInputTarget != null)
            {
                UpdateHeightFromInputTarget();
                colorSpectrumInputTarget.SizeChanged += ColorSpectrumImage_SizeChanged;
            }

            ComboBox comboBox = FindVisualChildByName(this.ColorPicker, "ColorRepresentationComboBox") as ComboBox;

            if (comboBox != null)
            {
                AutomationProperties.SetAutomationId(comboBox.Items[0] as DependencyObject, "RGBComboBoxItem");
                AutomationProperties.SetAutomationId(comboBox.Items[1] as DependencyObject, "HSVComboBoxItem");
            }

            previousColorRectangle = FindVisualChildByName(this.ColorPicker, "PreviousColorRectangle") as Rectangle;

            if (previousColorRectangle != null)
            {
                previousColorRectangle.RegisterPropertyChangedCallback(Rectangle.FillProperty, new DependencyPropertyChangedCallback(PreviousColorRectangleFillChanged));
            }

            selectionEllipsePanel = FindVisualChildByName(this.ColorPicker, "SelectionEllipsePanel") as Panel;

            if (selectionEllipsePanel != null)
            {
                selectionEllipsePanel.RegisterPropertyChangedCallback(Canvas.LeftProperty, new DependencyPropertyChangedCallback(SelectionEllipsePositionChanged));
                selectionEllipsePanel.RegisterPropertyChangedCallback(Canvas.TopProperty, new DependencyPropertyChangedCallback(SelectionEllipsePositionChanged));

                UpdateSelectionEllipsePosition();
            }

            selectionEllipse = FindVisualChildByName(this.ColorPicker, "SelectionEllipse") as Ellipse;

            if (selectionEllipse != null)
            {
                selectionEllipse.RegisterPropertyChangedCallback(Ellipse.StrokeProperty, new DependencyPropertyChangedCallback(SelectionEllipseStrokeChanged));

                UpdateSelectionEllipseColor();

                colorNameToolTip = ToolTipService.GetToolTip(selectionEllipse) as ToolTip;

                if (colorNameToolTip != null)
                {
                    colorNameToolTip.RegisterPropertyChangedCallback(ToolTip.ContentProperty, new DependencyPropertyChangedCallback(ColorNameToolTipContentChanged));
                    UpdateSelectedColorName();
                }
            }

            moreButton = FindVisualChildByName(this.ColorPicker, "MoreButton") as ButtonBase;

            if (moreButton != null)
            {
                AutomationProperties.SetAutomationId(moreButton, "MoreButton");
            }

            FindAndGiveAutomationIdToVisualChild("ThirdDimensionSlider");
            FindAndGiveAutomationIdToVisualChild("AlphaSlider");
            FindAndGiveAutomationIdToVisualChild("MoreButtonLabel");
            FindAndGiveAutomationIdToVisualChild("ColorRepresentationComboBox");
            FindAndGiveAutomationIdToVisualChild("RedTextBox");
            FindAndGiveAutomationIdToVisualChild("RedLabel");
            FindAndGiveAutomationIdToVisualChild("GreenTextBox");
            FindAndGiveAutomationIdToVisualChild("GreenLabel");
            FindAndGiveAutomationIdToVisualChild("BlueTextBox");
            FindAndGiveAutomationIdToVisualChild("BlueLabel");
            FindAndGiveAutomationIdToVisualChild("HueTextBox");
            FindAndGiveAutomationIdToVisualChild("HueLabel");
            FindAndGiveAutomationIdToVisualChild("SaturationTextBox");
            FindAndGiveAutomationIdToVisualChild("SaturationLabel");
            FindAndGiveAutomationIdToVisualChild("ValueTextBox");
            FindAndGiveAutomationIdToVisualChild("ValueLabel");
            FindAndGiveAutomationIdToVisualChild("AlphaTextBox");
            FindAndGiveAutomationIdToVisualChild("AlphaLabel");
            FindAndGiveAutomationIdToVisualChild("HexTextBox");
        }
コード例 #52
0
        public override void Init(Game1 game)
        {
            Color           = Color.White;
            skin            = new Skin(game.GreyImageMap, game.GreyMap);
            text            = new Text(game.GreySpriteFont, Color.Chartreuse);
            AttributeColour = Color.OrangeRed;
            resizeNeeded    = false;

            Attributes = GameManager.NewPlayer;

            gui = new Gui(game, skin, text);
            gui.AddText("Nixie", new Text(game.Nixie, AttributeColour));

            CharCreatePanel = new Panel(1, 1, game.GraphicsDevice.Viewport.Width / 3, game.GraphicsDevice.Viewport.Height - 10);
            CharCreatePanel.AddWidget(new Label(1, 6, "NAME"));
            NameBox       = new SingleLineTextBox(50, 0, 150, 15);
            NameBox.Value = GameManager.NewPlayerName;

            CharCreatePanel.AddWidget(NameBox);

            AttributePanel     = new Panel(1, 50, CharCreatePanel.Area.Width - 10, 70);
            IndAttributePanels = new Panel[6];

            //strength
            Panel PanelSTR = new Panel(1, 1, AttributePanel.Area.Width / 6, AttributePanel.Area.Height - 10);

            LabelSTRVAL      = new Label(1, 1, Convert.ToString(Attributes.Strength));
            LabelSTRVAL.Text = "Nixie";
            Label LabelSTR = new Label(1, 35, "STR");

            PanelSTR.AddWidget(LabelSTR);
            PanelSTR.AddWidget(LabelSTRVAL);
            IndAttributePanels[0] = PanelSTR;

            //Dex
            Panel PanelDEX = new Panel((AttributePanel.Area.Width / 6) * 1, 1, AttributePanel.Area.Width / 6, AttributePanel.Area.Height - 10);
            Label LabelDEX = new Label(1, 35, "DEX");

            LabelDEXVAL      = new Label(1, 1, Convert.ToString(Attributes.Dexterity));
            LabelDEXVAL.Text = "Nixie";
            PanelDEX.AddWidget(LabelDEX);
            PanelDEX.AddWidget(LabelDEXVAL);
            IndAttributePanels[1] = PanelDEX;

            //Charisma
            Panel PanelCHA = new Panel((AttributePanel.Area.Width / 6) * 2, 1, AttributePanel.Area.Width / 6, AttributePanel.Area.Height - 10);
            Label LabelCHA = new Label(1, 35, "CHA");

            LabelCHAVAL      = new Label(1, 1, Convert.ToString(Attributes.Charisma));
            LabelCHAVAL.Text = "Nixie";
            PanelCHA.AddWidget(LabelCHA);
            PanelCHA.AddWidget(LabelCHAVAL);
            IndAttributePanels[2] = PanelCHA;

            //Intelligence
            Panel PanelINT = new Panel((AttributePanel.Area.Width / 6) * 3, 1, AttributePanel.Area.Width / 6, AttributePanel.Area.Height - 10);
            Label LabelINT = new Label(1, 35, "INT");

            LabelINTVAL      = new Label(1, 1, Convert.ToString(Attributes.Intelligence));
            LabelINTVAL.Text = "Nixie";
            PanelINT.AddWidget(LabelINT);
            PanelINT.AddWidget(LabelINTVAL);
            IndAttributePanels[3] = PanelINT;

            //Constitution
            Panel PanelCON = new Panel((AttributePanel.Area.Width / 6) * 4, 1, AttributePanel.Area.Width / 6, AttributePanel.Area.Height - 10);
            Label LabelCON = new Label(1, 35, "CON");

            LabelCONVAL      = new Label(1, 1, Convert.ToString(Attributes.Constitution));
            LabelCONVAL.Text = "Nixie";
            PanelCON.AddWidget(LabelCON);
            PanelCON.AddWidget(LabelCONVAL);
            IndAttributePanels[4] = PanelCON;

            //Age
            Panel PanelAGE = new Panel(((AttributePanel.Area.Width / 6) * 5) - 5, 1, AttributePanel.Area.Width / 6, AttributePanel.Area.Height - 10);
            Label LabelAGE = new Label(1, 35, "AGE");

            LabelAGEVAL      = new Label(1, 1, Convert.ToString(Attributes.Age));
            LabelAGEVAL.Text = "Nixie";

            PanelAGE.AddWidget(LabelAGE);
            PanelAGE.AddWidget(LabelAGEVAL);
            IndAttributePanels[5] = PanelAGE;

            AttributePanel.AddWidgets(IndAttributePanels);

            CharCreatePanel.AddWidget(AttributePanel);

            //
            Panel[] CharModArray = new Panel[3];

            Panel SpeciesSelect = new Panel(10, 125, CharCreatePanel.Area.Width - 30, 325);

            SpeciesSelect.AddWidget(new Label(1, 100, "Select:"));


            Panel ClassSelect = new Panel(10, 125, CharCreatePanel.Area.Width - 30, 325);

            ClassSelect.AddWidget(new Button(-5, SpeciesSelect.Area.Height / 2, 10, "<", delegate { SpeciesSelect.Visible = true; ClassSelect.Visible = false; }));
            ClassSelect.Visible = false;

            Panel PerkSelect = new Panel(10, 125, CharCreatePanel.Area.Width - 30, 325);

            PerkSelect.AddWidget(new Button(-10, (SpeciesSelect.Area.Height / 2) - 10, 10, "<", delegate { ClassSelect.Visible = true; PerkSelect.Visible = false; }));
            PerkSelect.Visible = false;

            CharModArray[0] = SpeciesSelect;
            CharModArray[1] = ClassSelect;
            CharModArray[2] = PerkSelect;

            CharCreatePanel.AddWidgets(CharModArray);

            SpeciesSelect.AddWidget(new Button(-5, SpeciesSelect.Area.Height / 2, 10, "<", delegate { }));

            gui.AddWidget(CharCreatePanel);
            Console.WriteLine("Character Creation screen initialised");
        }
コード例 #53
0
        void AddSliderItem(Panel panel, SliderConfigProperty sliderProperty)
        {
            var sliderItem = panel.AddSlider(GetConfigPropertyName(sliderProperty));

            sliderItem.Bind(sliderProperty.o, sliderProperty.property);
        }
コード例 #54
0
 public EjemploMovePicking(string mediaDir, string shadersDir, TgcUserVars userVars, Panel modifiersPanel)
     : base(mediaDir, shadersDir, userVars, modifiersPanel)
 {
     Category    = "Collision";
     Name        = "Colisiones con movimiento mouse";
     Description =
         "Desplazamiento de un objeto por medio de Picking. Hacer clic sobre el suelo para desplazar la nave.";
 }
        public void UpdateTasksUI()
        {
            tasks_panel.Controls.Clear();

            for (var i = 0; i < Tasks.Count; i++)
            {
                var panel = new Panel();

                panel.Width  = tasks_panel.Width;
                panel.Height = 36;

                if (i % 2 == 0)
                {
                    panel.BackColor = SystemColors.ControlLightLight;
                }
                else
                {
                    panel.BackColor = SystemColors.ControlLight;
                }

                var id_label = new Label();

                id_label.AutoSize = true;
                id_label.Left     = 9;
                id_label.Top      = 11;

                id_label.Text = $"#{Tasks[i].id} ({Tasks[i].hour}:{Tasks[i].minute})";

                var status_desc_label = new Label();

                status_desc_label.AutoSize = true;
                status_desc_label.Left     = 97;
                status_desc_label.Top      = 11;

                status_desc_label.Text = "Status:";

                var status_label = new Label();

                status_label.AutoSize = true;
                status_label.Left     = 143;
                status_label.Top      = 11;

                status_label.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold);

                switch (Tasks[i].state)
                {
                case PwState.Idle:
                {
                    status_label.Text      = "oczekuje...";
                    status_label.ForeColor = SystemColors.ControlText;
                    break;
                }

                case PwState.Processing:
                {
                    status_label.Text      = "działam...";
                    status_label.ForeColor = Color.DarkOrange;
                    break;
                }

                case PwState.Success:
                {
                    status_label.Text      = "sukces";
                    status_label.ForeColor = Color.Green;
                    break;
                }

                case PwState.Fail:
                {
                    status_label.Text      = "niepowodzenie";
                    status_label.ForeColor = Color.Red;
                    break;
                }
                }

                var del_button = new Button();

                del_button.Text   = "Usuń";
                del_button.Left   = 581;
                del_button.Top    = 6;
                del_button.Width  = 48;
                del_button.Height = 23;
                del_button.Tag    = i;

                del_button.Click += (sender, args) =>
                {
                    Tasks.RemoveAt((int)del_button.Tag);
                    UpdateTasksUI();
                };

                panel.Controls.Add(id_label);
                panel.Controls.Add(status_desc_label);
                panel.Controls.Add(status_label);
                panel.Controls.Add(del_button);
                tasks_panel.Controls.Add(panel);
            }
        }
コード例 #56
0
        void AddToggleItem(Panel panel, ToggleConfigProperty toggleConfigProperty)
        {
            var toggleItem = panel.AddToggle(GetConfigPropertyName(toggleConfigProperty));

            toggleItem.Bind(toggleConfigProperty.o, toggleConfigProperty.property);
        }
コード例 #57
0
 private void InitializeComponent()
 {
     this.pnlTop       = new System.Windows.Forms.Panel();
     this.lblEdition   = new System.Windows.Forms.Label();
     this.pbLogo       = new System.Windows.Forms.PictureBox();
     this.pnlBottom    = new System.Windows.Forms.Panel();
     this.lblCredits   = new System.Windows.Forms.Label();
     this.txtCredits   = new System.Windows.Forms.TextBox();
     this.txtChangeLog = new System.Windows.Forms.TextBox();
     this.lblTitle     = new System.Windows.Forms.Label();
     this.lblVersion   = new System.Windows.Forms.Label();
     this.lblChangeLog = new System.Windows.Forms.Label();
     this.lblLicense   = new System.Windows.Forms.Label();
     this.lblCopyright = new System.Windows.Forms.Label();
     this.pnlTop.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pbLogo)).BeginInit();
     this.pnlBottom.SuspendLayout();
     this.SuspendLayout();
     //
     // pnlTop
     //
     this.pnlTop.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.pnlTop.BackColor = System.Drawing.Color.Black;
     this.pnlTop.Controls.Add(this.lblEdition);
     this.pnlTop.Controls.Add(this.pbLogo);
     this.pnlTop.ForeColor = System.Drawing.Color.White;
     this.pnlTop.Location  = new System.Drawing.Point(-1, -1);
     this.pnlTop.Name      = "pnlTop";
     this.pnlTop.Size      = new System.Drawing.Size(988, 145);
     this.pnlTop.TabIndex  = 0;
     //
     // lblEdition
     //
     this.lblEdition.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.lblEdition.BackColor = System.Drawing.Color.Black;
     this.lblEdition.Font      = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblEdition.ForeColor = System.Drawing.Color.White;
     this.lblEdition.Location  = new System.Drawing.Point(712, 112);
     this.lblEdition.Name      = "lblEdition";
     this.lblEdition.Size      = new System.Drawing.Size(264, 24);
     this.lblEdition.TabIndex  = 0;
     this.lblEdition.Text      = "Edition";
     this.lblEdition.TextAlign = System.Drawing.ContentAlignment.BottomRight;
     this.lblEdition.Visible   = false;
     //
     // pbLogo
     //
     this.pbLogo.Image    = global::mRemoteNG.Resources.Logo;
     this.pbLogo.Location = new System.Drawing.Point(8, 8);
     this.pbLogo.Name     = "pbLogo";
     this.pbLogo.Size     = new System.Drawing.Size(492, 128);
     this.pbLogo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
     this.pbLogo.TabIndex = 1;
     this.pbLogo.TabStop  = false;
     //
     // pnlBottom
     //
     this.pnlBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.pnlBottom.BackColor = System.Drawing.SystemColors.Control;
     this.pnlBottom.Controls.Add(this.lblCredits);
     this.pnlBottom.Controls.Add(this.txtCredits);
     this.pnlBottom.Controls.Add(this.txtChangeLog);
     this.pnlBottom.Controls.Add(this.lblTitle);
     this.pnlBottom.Controls.Add(this.lblVersion);
     this.pnlBottom.Controls.Add(this.lblChangeLog);
     this.pnlBottom.Controls.Add(this.lblLicense);
     this.pnlBottom.Controls.Add(this.lblCopyright);
     this.pnlBottom.ForeColor = System.Drawing.SystemColors.ControlText;
     this.pnlBottom.Location  = new System.Drawing.Point(-1, 144);
     this.pnlBottom.Name      = "pnlBottom";
     this.pnlBottom.Size      = new System.Drawing.Size(988, 559);
     this.pnlBottom.TabIndex  = 1;
     //
     // lblCredits
     //
     this.lblCredits.AutoSize  = true;
     this.lblCredits.Font      = new System.Drawing.Font("Segoe UI", 11F);
     this.lblCredits.ForeColor = System.Drawing.SystemColors.ControlText;
     this.lblCredits.Location  = new System.Drawing.Point(16, 131);
     this.lblCredits.Name      = "lblCredits";
     this.lblCredits.Size      = new System.Drawing.Size(55, 25);
     this.lblCredits.TabIndex  = 11;
     this.lblCredits.Text      = "Credits:";
     this.lblCredits.UseCompatibleTextRendering = true;
     //
     // txtCredits
     //
     this.txtCredits.BackColor   = System.Drawing.SystemColors.Control;
     this.txtCredits.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.txtCredits.Cursor      = System.Windows.Forms.Cursors.Default;
     this.txtCredits.Font        = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.txtCredits.ForeColor   = System.Drawing.SystemColors.ControlText;
     this.txtCredits.Location    = new System.Drawing.Point(8, 156);
     this.txtCredits.MinimumSize = new System.Drawing.Size(370, 260);
     this.txtCredits.Multiline   = true;
     this.txtCredits.Name        = "txtCredits";
     this.txtCredits.ReadOnly    = true;
     this.txtCredits.ScrollBars  = System.Windows.Forms.ScrollBars.Vertical;
     this.txtCredits.Size        = new System.Drawing.Size(485, 400);
     this.txtCredits.TabIndex    = 7;
     this.txtCredits.TabStop     = false;
     //
     // txtChangeLog
     //
     this.txtChangeLog.BackColor   = System.Drawing.SystemColors.Control;
     this.txtChangeLog.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.txtChangeLog.Cursor      = System.Windows.Forms.Cursors.Default;
     this.txtChangeLog.Font        = new System.Drawing.Font("Segoe UI", 9F);
     this.txtChangeLog.ForeColor   = System.Drawing.SystemColors.ControlText;
     this.txtChangeLog.Location    = new System.Drawing.Point(501, 156);
     this.txtChangeLog.MinimumSize = new System.Drawing.Size(370, 260);
     this.txtChangeLog.Multiline   = true;
     this.txtChangeLog.Name        = "txtChangeLog";
     this.txtChangeLog.ReadOnly    = true;
     this.txtChangeLog.ScrollBars  = System.Windows.Forms.ScrollBars.Vertical;
     this.txtChangeLog.Size        = new System.Drawing.Size(485, 400);
     this.txtChangeLog.TabIndex    = 10;
     this.txtChangeLog.TabStop     = false;
     //
     // lblTitle
     //
     this.lblTitle.AutoSize  = true;
     this.lblTitle.Font      = new System.Drawing.Font("Segoe UI", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.lblTitle.ForeColor = System.Drawing.SystemColors.ControlText;
     this.lblTitle.Location  = new System.Drawing.Point(16, 16);
     this.lblTitle.Name      = "lblTitle";
     this.lblTitle.Size      = new System.Drawing.Size(126, 31);
     this.lblTitle.TabIndex  = 0;
     this.lblTitle.Text      = "mRemoteNG";
     this.lblTitle.UseCompatibleTextRendering = true;
     //
     // lblVersion
     //
     this.lblVersion.AutoSize  = true;
     this.lblVersion.Font      = new System.Drawing.Font("Segoe UI", 11F);
     this.lblVersion.ForeColor = System.Drawing.SystemColors.ControlText;
     this.lblVersion.Location  = new System.Drawing.Point(16, 56);
     this.lblVersion.Name      = "lblVersion";
     this.lblVersion.Size      = new System.Drawing.Size(55, 25);
     this.lblVersion.TabIndex  = 1;
     this.lblVersion.Text      = "Version";
     this.lblVersion.UseCompatibleTextRendering = true;
     //
     // lblChangeLog
     //
     this.lblChangeLog.AutoSize  = true;
     this.lblChangeLog.Font      = new System.Drawing.Font("Segoe UI", 11F);
     this.lblChangeLog.ForeColor = System.Drawing.SystemColors.ControlText;
     this.lblChangeLog.Location  = new System.Drawing.Point(501, 131);
     this.lblChangeLog.Name      = "lblChangeLog";
     this.lblChangeLog.Size      = new System.Drawing.Size(89, 25);
     this.lblChangeLog.TabIndex  = 6;
     this.lblChangeLog.Text      = "Change Log:";
     this.lblChangeLog.UseCompatibleTextRendering = true;
     //
     // lblLicense
     //
     this.lblLicense.AutoSize  = true;
     this.lblLicense.Font      = new System.Drawing.Font("Segoe UI", 11F);
     this.lblLicense.ForeColor = System.Drawing.SystemColors.ControlText;
     this.lblLicense.Location  = new System.Drawing.Point(16, 96);
     this.lblLicense.Name      = "lblLicense";
     this.lblLicense.Size      = new System.Drawing.Size(54, 25);
     this.lblLicense.TabIndex  = 5;
     this.lblLicense.Text      = "License";
     this.lblLicense.UseCompatibleTextRendering = true;
     //
     // lblCopyright
     //
     this.lblCopyright.AutoSize  = true;
     this.lblCopyright.Font      = new System.Drawing.Font("Segoe UI", 11F);
     this.lblCopyright.ForeColor = System.Drawing.SystemColors.ControlText;
     this.lblCopyright.Location  = new System.Drawing.Point(16, 76);
     this.lblCopyright.Name      = "lblCopyright";
     this.lblCopyright.Size      = new System.Drawing.Size(71, 25);
     this.lblCopyright.TabIndex  = 2;
     this.lblCopyright.Text      = "Copyright";
     this.lblCopyright.UseCompatibleTextRendering = true;
     //
     // AboutWindow
     //
     this.BackColor  = System.Drawing.SystemColors.Control;
     this.ClientSize = new System.Drawing.Size(984, 705);
     this.Controls.Add(this.pnlTop);
     this.Controls.Add(this.pnlBottom);
     this.Font        = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ForeColor   = System.Drawing.SystemColors.ControlText;
     this.Icon        = global::mRemoteNG.Resources.mRemote_Icon;
     this.MaximumSize = new System.Drawing.Size(20000, 10000);
     this.Name        = "AboutWindow";
     this.TabText     = "About";
     this.Text        = "About";
     this.Load       += new System.EventHandler(this.About_Load);
     this.pnlTop.ResumeLayout(false);
     this.pnlTop.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pbLogo)).EndInit();
     this.pnlBottom.ResumeLayout(false);
     this.pnlBottom.PerformLayout();
     this.ResumeLayout(false);
 }
コード例 #58
0
        void AddFieldItem(Panel panel, ConfigProperty configProperty)
        {
            var fieldItem = panel.AddField(GetConfigPropertyName(configProperty));

            fieldItem.Bind(configProperty.o, configProperty.property);
        }
コード例 #59
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// CreateEditor creates the control collection.
        /// </summary>
        /// <history>
        ///     [cnurse]	02/14/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        protected virtual void CreateEditor()
        {
            Table table;

            string[] arrGroups = null;

            Controls.Clear();
            if (!String.IsNullOrEmpty(Groups))
            {
                arrGroups = Groups.Split(',');
            }
            else if (GroupByMode != GroupByMode.None)
            {
                arrGroups = GetGroups(UnderlyingDataSource);
            }

            if (!AutoGenerate)
            {
                //Create a new table
                if (DisplayMode == EditorDisplayMode.Div)
                {
                    AddFields();
                }
                else
                {
                    //Add the Table to the Controls Collection
                    table = new Table {
                        ID = "tbl"
                    };
                    AddFields(table);
                    Controls.Add(table);
                }
            }
            else
            {
                Fields.Clear();
                if (arrGroups != null && arrGroups.Length > 0)
                {
                    foreach (string strGroup in arrGroups)
                    {
                        if (GroupByMode == GroupByMode.Section)
                        {
                            if (DisplayMode == EditorDisplayMode.Div)
                            {
                                var groupData = UnderlyingDataSource.Cast <object>().Where(obj => GetCategory(obj) == strGroup.Trim() && GetRowVisibility(obj));
                                if (groupData.Count() > 0)
                                {
                                    //Add header
                                    var header = new HtmlGenericControl("h2");
                                    header.Attributes.Add("class", "dnnFormSectionHead");
                                    header.Attributes.Add("id", strGroup);
                                    Controls.Add(header);

                                    var localizedGroupName = Localization.GetString(strGroup, LocalResourceFile);
                                    if (string.IsNullOrEmpty(localizedGroupName))
                                    {
                                        localizedGroupName = strGroup;
                                    }
                                    var link = new HyperLink()
                                    {
                                        Text = localizedGroupName, NavigateUrl = "#"
                                    };
                                    header.Controls.Add(link);

                                    //fieldset to hold properties in group
                                    var fieldset  = new HtmlGenericControl("fieldset");
                                    var container = new Panel();
                                    fieldset.Controls.Add(container);

                                    foreach (object obj in groupData)
                                    {
                                        AddEditorRow(container, obj);
                                    }
                                    Controls.Add(fieldset);
                                }
                            }
                            else
                            {
                                //Create a new table
                                table = new Table {
                                    ID = "tbl" + strGroup
                                };
                                foreach (object obj in UnderlyingDataSource)
                                {
                                    if (GetCategory(obj) == strGroup.Trim())
                                    {
                                        //Add the Editor Row to the Table
                                        if (GetRowVisibility(obj))
                                        {
                                            if (table.Rows.Count == 0)
                                            {
                                                //Add a Header
                                                AddHeader(table, strGroup);
                                            }

                                            AddEditorRow(table, obj);
                                        }
                                    }
                                }

                                //Add the Table to the Controls Collection (if it has any rows)
                                if (table.Rows.Count > 0)
                                {
                                    Controls.Add(table);
                                }
                            }
                        }
                    }
                }
                else
                {
                    //Create a new table
                    if (DisplayMode == EditorDisplayMode.Div)
                    {
                        foreach (object obj in UnderlyingDataSource)
                        {
                            //Add the Editor Row to the Table
                            if (GetRowVisibility(obj))
                            {
                                AddEditorRow(obj);
                            }
                        }
                    }
                    else
                    {
                        table = new Table {
                            ID = "tbl"
                        };
                        foreach (object obj in UnderlyingDataSource)
                        {
                            if (GetRowVisibility(obj))
                            {
                                AddEditorRow(table, obj);
                            }
                        }

                        //Add the Table to the Controls Collection
                        Controls.Add(table);
                    }
                }
            }
        }
コード例 #60
0
        protected void OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item &&
                e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            KeyValuePair <uint, Device> dataItem = (KeyValuePair <uint, Device>)e.Item.DataItem;
            Device device = dataItem.Value;

            uint id = dataItem.Key;

            ((HiddenField)e.Item.FindControl("DeviceID")).Value = id.ToString();

            ((Label)e.Item.FindControl("Name")).Text = device.Name;

            ImageButton stateButton = (ImageButton)e.Item.FindControl("State");

            if (device.IsOn)
            {
                stateButton.ImageUrl = "Content/Images/on.png";
            }
            else
            {
                stateButton.ImageUrl = "Content/Images/off.png";
            }

            // IBacklight
            if (device is IBacklight)
            {
                Image isHighlightedImage = (Image)e.Item.FindControl("IsHighlightedImage");
                isHighlightedImage.Visible = true;
                ((HtmlGenericControl)e.Item.FindControl("SmallInterfacesTop")).Visible = true;

                if (((IBacklight)device).IsHighlighted)
                {
                    isHighlightedImage.ImageUrl = "/Content/Images/backlightOn.png";
                }
                else
                {
                    isHighlightedImage.ImageUrl = "/Content/Images/backlightOff.png";
                }
            }

            // IClock
            if (device is IClock)
            {
                Panel currentTimePanel = (Panel)e.Item.FindControl("CurrentTime");
                currentTimePanel.Visible = true;
                HiddenField hillenField = (HiddenField)e.Item.FindControl("HiddenTimestamp");
                if (!device.IsOn)
                {
                    hillenField.Value = "disabled";
                }
                else
                {
                    DateTime curTime = ((IClock)device).CurrentTime;
                    // Convert current time to miliseconds
                    hillenField.Value = (curTime.Hour * 60 * 60 * 1000 +
                                         curTime.Minute * 60 * 1000 +
                                         curTime.Second * 1000).ToString();

                    TextBox hours = (TextBox)e.Item.FindControl("Hours");
                    hours.Visible = true;
                    hours.Text    = "";

                    Label timeSeparator = (Label)e.Item.FindControl("ClockTimeSeparator");
                    timeSeparator.Visible = true;

                    TextBox minutes = (TextBox)e.Item.FindControl("Minutes");
                    minutes.Visible = true;
                    minutes.Text    = "";

                    ((Button)(e.Item.FindControl("SetTimeButton"))).Visible = true;
                }
            }

            // IOpenable
            if (device is IOpenable)
            {
                ImageButton iOpenableButton = (ImageButton)e.Item.FindControl("OpenCloseButton");
                iOpenableButton.Visible = true;
                ((HtmlGenericControl)e.Item.FindControl("SmallInterfacesTop")).Visible = true;

                if (((IOpenable)device).IsOpen)
                {
                    iOpenableButton.ImageUrl = "Content/Images/opened.png";
                }
                else
                {
                    iOpenableButton.ImageUrl = "Content/Images/closed.png";
                }
            }

            // ITemperature
            if (device is ITemperature)
            {
                ((Panel)e.Item.FindControl("ITemperaturePanel")).Visible = true;
                TextBox TemperatureTextBox = (TextBox)e.Item.FindControl("TemperatureTextBox");
                TemperatureTextBox.Text = ((ITemperature)device).Temperature.ToString();
                ((HiddenField)e.Item.FindControl("MinTemperature")).Value = ((ITemperature)device).MinTemperature.ToString();
                ((HiddenField)e.Item.FindControl("MaxTemperature")).Value = ((ITemperature)device).MaxTemperature.ToString();
            }

            // ITimer
            if (device is ITimer)
            {
                Panel ITimerPanel = (Panel)e.Item.FindControl("ITimerPanel");
                ITimerPanel.Visible = true;

                ImageButton startStopButton = (ImageButton)e.Item.FindControl("StartStopButton");
                if (((ITimer)device).IsRunning)
                {
                    startStopButton.ImageUrl = "Content/Images/stop.png";
                }
                else
                {
                    startStopButton.ImageUrl = "Content/Images/start.png";
                }

                if (device.IsOn)
                {
                    ((Panel)e.Item.FindControl("ITimerDynamicPanel")).Visible = true;

                    TextBox hours = (TextBox)e.Item.FindControl("TimerHours");
                    hours.Text = "";

                    TextBox minutes = (TextBox)e.Item.FindControl("TimerMinutes");
                    minutes.Text = "";

                    TextBox seconds = (TextBox)e.Item.FindControl("TimerSeconds");
                    seconds.Text = "";
                }
            }

            // IVolume
            if (device is IVolume)
            {
                ((HtmlGenericControl)e.Item.FindControl("SmallInterfacesBottom")).Visible = true;
                Label volumeLabel = (Label)e.Item.FindControl("VolumeLabel");
                volumeLabel.Visible = true;
                volumeLabel.Text    = "Volume: " + ((IVolume)device).Volume + " litres";
            }

            // Fridge
            if (device is Fridge)
            {
                ((Panel)e.Item.FindControl("FridgePanel")).Visible = true;

                // Coldstore
                ImageButton coldstoreOpenCloseButton = (ImageButton)e.Item.FindControl("ColdstoreOpenCloseButton");
                if (((Fridge)device).ColdstoreIsOpen)
                {
                    coldstoreOpenCloseButton.ImageUrl = "Content/Images/opened.png";
                }
                else
                {
                    coldstoreOpenCloseButton.ImageUrl = "Content/Images/closed.png";
                }

                TextBox coldstoreTemperatureTextBox = (TextBox)e.Item.FindControl("ColdstoreTemperatureTextBox");
                coldstoreTemperatureTextBox.Text = ((Fridge)device).ColdstoreTemperature.ToString();
                ((HiddenField)e.Item.FindControl("ColdstoreMinTemperature")).Value = ((Fridge)device).ColdstoreMinTemperature.ToString();
                ((HiddenField)e.Item.FindControl("ColdstoreMaxTemperature")).Value = ((Fridge)device).ColdstoreMaxTemperature.ToString();

                Image coldstoreIsHighlighted = (Image)e.Item.FindControl("ColdstoreIsHighlighted");
                if (((Fridge)device).ColdstoreIsHighlighted)
                {
                    coldstoreIsHighlighted.ImageUrl = "/Content/Images/backlightOn.png";
                }
                else
                {
                    coldstoreIsHighlighted.ImageUrl = "/Content/Images/backlightOff.png";
                }

                ((Label)e.Item.FindControl("ColdstoreVolumeLabel")).Text =
                    "Coldstore volume: " + ((Fridge)device).ColdstoreVolume + " litres";

                // Freezer
                ImageButton freezerOpenCloseButton = (ImageButton)e.Item.FindControl("FreezerOpenCloseButton");
                if (((Fridge)device).FreezerIsOpen)
                {
                    freezerOpenCloseButton.ImageUrl = "Content/Images/opened.png";
                }
                else
                {
                    freezerOpenCloseButton.ImageUrl = "Content/Images/closed.png";
                }

                TextBox refrigeratoryTemperatureTextBox = (TextBox)e.Item.FindControl("FreezerTemperatureTextBox");
                refrigeratoryTemperatureTextBox.Text = ((Fridge)device).FreezerTemperature.ToString();
                ((HiddenField)e.Item.FindControl("FreezerMinTemperature")).Value = ((Fridge)device).FreezerMinTemperature.ToString();
                ((HiddenField)e.Item.FindControl("FreezerMaxTemperature")).Value = ((Fridge)device).FreezerMaxTemperature.ToString();

                ((Label)e.Item.FindControl("FreezerVolumeLabel")).Text =
                    "Freezer volume: " + ((Fridge)device).FreezeryVolume + " litres";
            }

            // Specific
            if (device is Clock)
            {
                ((Image)e.Item.FindControl("DeviceImage")).ImageUrl = "Content/Images/clock.png";
            }
            if (device is Microwave)
            {
                ((Image)e.Item.FindControl("DeviceImage")).ImageUrl = "Content/Images/microwave.png";
                ((TextBox)e.Item.FindControl("TimerHours")).Visible = false;
                ((HtmlGenericControl)e.Item.FindControl("TimerHoursSeparator")).Visible = false;
            }
            if (device is Oven)
            {
                ((Image)e.Item.FindControl("DeviceImage")).ImageUrl = "Content/Images/oven.png";
            }
            if (device is Fridge)
            {
                ((Image)e.Item.FindControl("DeviceImage")).ImageUrl = "Content/Images/fridge.png";
            }
        }