Наследование: MonoBehaviour
Пример #1
0
   public override ToolStripItem[] ToToolStripMenuItems(Controls.Tree.TreeView treeView
                                                       , Controls.Tree.TreeNode clickedTn)
   {
      List<ToolStripMenuItem> items = new List<ToolStripMenuItem>(24);

      MaterialWrapper mat = TreeMode.GetMaxNode(clickedTn) as MaterialWrapper;
      if (mat == null)
         return items.ToArray();

      IIMtlEditInterface mtlEditor = MaxInterfaces.Global.MtlEditInterface;

      for (int i = 0; i < 24; i++)
      {
         IMtlBase slotMtl = mtlEditor.GetTopMtlSlot(i);

         ToolStripMenuItem item = new ToolStripMenuItem();
         item.Text = (i + 1).ToString() + ": " + slotMtl.Name;
         item.Tag = i;
         item.Click += new EventHandler((sender, eventArgs) => this.item_Click(clickedTn, item));

         if (mat.Material.Handle == slotMtl.Handle)
         {
            item.Font = new Font(item.Font, FontStyle.Bold);
            item.Checked = true;
         }

         items.Add(item);
      }


      return items.ToArray();
   }
Пример #2
0
    void Start()
    {
        _damageScript = GetComponent<TakeDamage>();
        _controlScript = GetComponent<Controls>();

        _emitter = transform.Find("Detailed Smoke").particleEmitter;
    }
Пример #3
0
 void formView_OnDataBindRow(string columnName, Controls.UcFormView.FormViewRow viewRow)
 {
     if (columnName == SysReward.Columns.RewardMemo)
         viewRow.RenderHtml = Eleooo.Web.Controls.HtmlControl.GetTextAreaHtml(viewRow.ParamName, viewRow.Value);
     else if (columnName == SysReward.Columns.RewardFlag)
         viewRow.RenderHtml = Eleooo.Web.Controls.HtmlControl.GetRadioHtml(RewardBLL.RewardFlag, viewRow.ParamName, viewRow.Value).ToString( );
 }
Пример #4
0
 private void buttons_ButtonClick(object sender, Controls.DialogResultEventArgs e)
 {
     if (e.Result == System.Windows.Forms.DialogResult.Cancel)
     {
         checkContiguousMonitors = false;
     }
 }
Пример #5
0
		protected void PaymentReceived(object sender, Controls.Payment.PaymentDoneEventArgs e)
		{
			if (!e.Duplicate)
			{
				Mailer m = new Mailer();
				m.Body = @" 
<p>Thank you!</p>
<p>Payment receipt for £" + ((int)(int.Parse(TicketsQuantityTextBox.Text) * 20)).ToString() + @".</p>
<p>Reference: " + int.Parse(TicketsQuantityTextBox.Text) + @" ticket" + (int.Parse(TicketsQuantityTextBox.Text)==1?"":"s") + @" for Camp DSI 2006.</p>
<p>Payment reference: "+e.Invoices[0].K.ToString()+@".</p>
<p>Please regularly check the Camp DSI event listing for further information and updates.</p>
<p>See you soon!</p>";
				m.Bulk = false;
				m.RedirectUrl = "/uk/barnstaple/a-secret-location/2006/jun/17/event-29398";
				m.Subject = "Receipt for Camp DSI tickets";
				m.UsrRecipient = Usr.Current;
				m.Send();

				Usr.Current.CampTickets += int.Parse(TicketsQuantityTextBox.Text);
				Usr.Current.Update();
			}

			Update u = new Update();
			u.Changes.Add(new Assign.Override(Bobs.Global.Columns.ValueInt, "(select sum(CampTickets) from Usr)"));
			u.Table=TablesEnum.Global;
			u.Where=new Q(Bobs.Global.Columns.K,Bobs.Global.Records.CampDsiTickets);
			u.Run();

			Usr.Current.AttendEvent(29398, true, null, null);
			DoneQuantityLabel.Text = int.Parse(TicketsQuantityTextBox.Text).ToString() + " ticket" + (int.Parse(TicketsQuantityTextBox.Text) == 1 ? "" : "s");
			ChangePanel(DonePanel);
		}
 internal RibbonDropDown(
     RibbonItem parentItem,
     IEnumerable<RibbonItem> items,
     Controls.Ribbon.Ribbon ownerRibbon)
     : this(parentItem, items, ownerRibbon, RibbonElementSizeMode.DropDown)
 {
 }
Пример #7
0
    public void activate(GameObject Player)
    {
        if (isOccupied) {
            return;
        }

        if (erectOnEnter) {
            transform.eulerAngles.Set(transform.eulerAngles.x, transform.eulerAngles.y, 0);
        }
        player = Player.transform.parent.gameObject;

        isOccupied = true;

        if (VControls != null) VControls.isCarActive = true;
        controls = player.transform.FindChild("Camera").gameObject.GetComponent<Controls>();
        isActive = true;
        player.SetActive(false);
        ((Camera)gameObject.transform.Find("Camera").gameObject.GetComponent("Camera")).enabled = true;
        ((AudioListener)gameObject.transform.Find("Camera").gameObject.GetComponent("AudioListener")).enabled = true;

        if (!Sleep.Day) {
            foreach (GameObject go in Headlights) {
                go.SetActive(true);
            }
        }

        if (erectOnEnter && isActive) {
            float z = transform.eulerAngles.z;
            float x = transform.eulerAngles.x;
            transform.Rotate(-x, 0, -z);
        }
    }
Пример #8
0
        public void FillRibbon( XmlDocument xmlDoc, Controls.Ribbon.RibbonControl ribbon )
        {
            Dictionary<string, Controls.Ribbon.Section> mapTagToSection = new Dictionary<string, Controls.Ribbon.Section>();
            Dictionary<string, Controls.Ribbon.Item> mapTagToItem = new Dictionary<string, Controls.Ribbon.Item>();

            FillRibbon( xmlDoc, ribbon, out mapTagToSection, out mapTagToItem );
        }
 private void Row_Clicked(Controls.Row row)
 {
     var data = new EventData(this);
     data.Id = "OPEN_DEVICE_DETAILS";
     data.Data01 = row.Device;
     SendData?.Invoke(data);
 }
        public override bool CanDrop(Controls.DragDropState state)
        {
            var appointment = state.Appointment as SupportMeetingAppointment;

            if (appointment == null)
            {
                // should be recurring Appointment
                appointment = (state.Appointment as Occurrence).Appointment as SupportMeetingAppointment;
            }

            if (appointment.IsDraggedFromListBox && state.TargetedAppointment != null)
            {
                var targetedAppointment = state.TargetedAppointment as SupportMeetingAppointment;
                var attendee = appointment.Attendees.First();
                if (targetedAppointment.Attendees.Contains(attendee))
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else if (appointment.IsDraggedFromListBox)
            {
                return false;
            }
            else
            {
                return base.CanDrop(state);
            }
        }
Пример #11
0
	void Awake() {
		Player.instance = this;
//		attacher = GetComponent<Attacher>();
		attacker = GetComponent<Attack> ();
//		equipper = GetComponent<Equip>();
//		focus = GetComponent<Focus>();
		grabber = GetComponent<Grab>();
		interactor = GetComponent<Interact>();
		inventory = GetComponent<Inventory>();
		mover = GetComponent<MovementController>();
		cam = GetComponentInChildren<Camera>();
		looker = GetComponentInChildren<MouseLook>();
		/*heat = GetComponent<Heat>();
		hunger = GetComponent<Hunger>();
		mapViewer = GetComponent<MapViewer>();*/
		controls = GetComponent<Controls>();

//		coldStart = 80;
//		coldExtra = 0.1f;
//		coldColor = new Color(0.25f, 0.5f, 1);
//		freezeTemp = -20;
		whiteOutTime = 0;
		breathingSource = gameObject.AddComponent<AudioSource>();
		breathingSource.clip = heavyBreathingSound;
		breathingSource.enabled = true;
		breathingSource.loop = true;
		whiteOutTexture = new Texture2D (1, 1, TextureFormat.RGB24, false);
		whiteOutTexture.SetPixel (0, 0, Color.white);
	}
 public override void DragDropCompleted(Controls.DragDropState state)
 {
     if (state.DestinationAppointmentsSource != null)
     {
         base.DragDropCompleted(state);
     }
 }
Пример #13
0
        public static void Resize(FlagPosition flagPosition,  TPoint offset , Controls controls)
        {
            foreach (ControlBase control in controls)
            {
                Rect controlRect = control.Rect;

                if ((flagPosition & FlagPosition.Left) == FlagPosition.Left)
                {
                    controlRect.Left = controlRect.Left + offset.X;
                }
                else if ((flagPosition & FlagPosition.Right) == FlagPosition.Right)
                {
                    controlRect.Right = controlRect.Right + offset.X;
                }

                if ((flagPosition & FlagPosition.Top) == FlagPosition.Top)
                {
                    controlRect.Top = controlRect.Top + offset.Y;
                }
                else if ((flagPosition & FlagPosition.Bottom) == FlagPosition.Bottom)
                {
                    controlRect.Bottom = controlRect.Bottom + offset.Y;
                }
                control.Rect = controlRect;
            }
        }
Пример #14
0
        protected void DotNetCustomCalDotNetack_CustomCalDotNetack(object sender, Controls.CustomCalDotNetack.DotNetCustomCalDotNetack.CustomCalDotNetackEventArgs e)
        {
            //string result = e.Parameters;
            string action = e.Parameters;
            string[] actarr = action.Split('_');
            switch (actarr[0])
            {
                case "del":
                    _presenter = new RoleManagePresenter(this);
                    bool result = Delete(actarr[1]);
                    CalDotNetack.CalDotNetackResult.Result = result.ToString();
                    CalDotNetack.CalDotNetackResult.IsRefresh = result;
                    break;
                case "edit":
                    CalDotNetack.CalDotNetackResult.Result = "true";
                    break;
                case "search":
                    DataSearch();
                    break;

                //default:
                //    CalDotNetack.CalDotNetackResult = actarr[0] + "???" + actarr[1];
                //    break;
            }
        }
Пример #15
0
        private void cbUpgrade_Callback(object sender, Controls.CallBackEventArgs e)
        {
            string upFilePath = Server.MapPath("~/desktopmodules/activeforums/upgrade4x.txt");
            string err = "Success";
            try
            {
                if (System.IO.File.Exists(upFilePath))
                {
                    string s = Utilities.GetFileContent(upFilePath);
                    err = DotNetNuke.Entities.Portals.PortalSettings.ExecuteScript(s);
                    System.IO.File.Delete(upFilePath);
                }
            }
            catch (Exception ex)
            {
                if (ex is UnauthorizedAccessException && string.IsNullOrEmpty(err))
                {
                    err = "<span style=\"font-size:14px;font-weight:bold;\">The forum data was upgraded successfully, but you must manually delete the following file:<br /><br />" + upFilePath + "<br /><br />The upgrade is not complete until you delete the file indicated above.</span>";
                }
                else
                {
                    err = "<span style=\"font-size:14px;font-weight:bold;\">Upgrade Failed - Please go to the <a href=\"http://www.activemodules.com/community/helpdesk.aspx\">Active Modules Help Desk</a> to report the error indicated below:<br /><br />" + ex.Message + "</span>";
                }

            }
            LiteralControl lit = new LiteralControl();
            if (string.IsNullOrEmpty(err))
            {
                err = "<script type=\"text/javascript\">LoadView('home');</script>";
            }
            lit.Text = err;
            lit.RenderControl(e.Output);
        }
Пример #16
0
 private void gridView1_OnRefresh(object arg1, Controls.Grid.GridViewRefreshEventArgs arg2)
 {
     var list = db.Tasks.GetList();
     ControlHelper.Invoke(this, () =>
     {
         foreach (var item in list)
         {
             TaskModel tm = _taskModels.FirstOrDefault(x => x.Name == item.Name);// new TaskModel();
             if (tm == null)
             {
                 tm = new TaskModel();
                 tm.Hour = item.Hour;
                 tm.Interval = item.Interval;
                 tm.Method = item.Method;
                 tm.Minute = item.Minute;
                 tm.Name = item.Name;
                 tm.RunType = item.RunType;
                 tm.Type = item.Type;
                 tm.Id = item.Id;
                 tm.Status = (int)Status.WaitRun;
                 tm.Dll = item.Dll;
                 _taskModels.Add(tm);
             }
         }
         StartTask(_taskModels);
     });
 }
 public TGContextMenuEventArgs(TabGroupLeaf tgl, Controls.TabControl tc, 
     Controls.TabPage tp, PopupMenu contextMenu)
     : base(tgl, tc, tp)
 {
     // Definie initial state
     _contextMenu = contextMenu;
 }
Пример #18
0
        public static void OnMouseMoved(Controls.Control hoveredControl, int x, int y)
        {
            // Always keep these up to date, they're used to draw the dragged control.
            m_MouseX = x;
            m_MouseY = y;

            // If we're not carrying anything, then check to see if we should
            // pick up from a control that we're holding down. If not, then forget it.
            if (CurrentPackage == null && !ShouldStartDraggingControl(x, y))
                return;

            // Swap to this new hovered control and notify them of the change.
            UpdateHoveredControl(hoveredControl, x, y);

            if (HoveredControl == null)
                return;

            // Update the hovered control every mouse move, so it can show where
            // the dropped control will land etc..
            HoveredControl.DragAndDrop_Hover(CurrentPackage, x, y);

            // Override the cursor - since it might have been set my underlying controls
            // Ideally this would show the 'being dragged' control. TODO
            Platform.Neutral.SetCursor(Cursors.Default);

            hoveredControl.Redraw();
        }
Пример #19
0
        public static bool OnMouseButton(Controls.Control hoveredControl, int x, int y, bool down)
        {
            if (!down)
            {
                m_LastPressedControl = null;

                // Not carrying anything, allow normal actions
                if (CurrentPackage == null)
                    return false;

                // We were carrying something, drop it.
                onDrop(x, y);
                return true;
            }

            if (hoveredControl == null)
                return false;
            if (!hoveredControl.DragAndDrop_Draggable())
                return false;

            // Store the last clicked on control. Don't do anything yet,
            // we'll check it in OnMouseMoved, and if it moves further than
            // x pixels with the mouse down, we'll start to drag.
            m_LastPressedPos = new Vector2i(x, y);
            m_LastPressedControl = hoveredControl;

            return false;
        }
Пример #20
0
        private void ag_answers_AnswerSelect(object sender, Controls.AnswerEventArgs arg)
        {
            if (_canvas != null)
            {
                if (_canvas.Answers.Count != 0)
                {
                    switch (arg.ControlType)
                    {
                        case ControlType.Button:
                            _canvas.Answers.Clear();
                            _canvas.Answers.SelectTrueCell();
                            arg.CurrentAnsverControl.Answer.Select();
                            this.PictAnswerOnCenter(arg.CurrentAnsverControl);
                            break;
                        case ControlType.Cell:
                            arg.CurrentAnsverControl.Answer.Clear();
                            arg.CurrentAnsverControl.Answer.SelectTrueCell();
                            break;

                        case ControlType.NullCell:
                            arg.CurrentAnsverControl.Answer.Clear();
                            arg.CurrentAnsverControl.Answer.SelectTrueCell();
                            break;
                    }
                    this.pb_formimage.Image = _canvas.CorrectedImage;
                    this.lb_status.Text = "Итоги коррекции: вопросов без ответа: " + ag_answers.Answers.CountWithEmpty.ToString() + ", ошибочных ответов: " + ag_answers.Answers.CountWithMiss.ToString() + ", несколько ответов в вопросе: " + ag_answers.Answers.CountWithDoubleCross.ToString();
                }
            }
        }
Пример #21
0
 public Player(Arman game, PositionInGrid positionInGrid, Texture2D texture, Block[,] gameArray, int oneBlockSize, int timeForMove, List<Entity> movableObjects, GameArea gameArea, Controls controls)
     : base(game, positionInGrid, texture, gameArray, oneBlockSize, timeForMove, movableObjects)
 {
     this.gameArea = gameArea;
     this.controls = controls;
     spawnPoint = positionInGrid;
 }
Пример #22
0
 public void OpenAll(Controls.Tabs t)
 {
     foreach (Tab tab in tabs)
     {
         tab.Open(t);
     }
 }
Пример #23
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        oXbmc = new XBMC_Communicator();
        oXbmc.SetIp("10.0.0.5");
        oXbmc.SetConnectionTimeout(4000);
        oXbmc.SetCredentials("", "");
        oXbmc.Status.StartHeartBeat();

        Build ();

        this.AllowStaticAccess();

        //Create objects used
        oPlaylist 		= new Playlist(this);
        oControls		= new Controls(this);
        oMenuItems		= new MenuItems(this);
        oContextMenu 	= new ContextMenu(this);
        oShareBrowser 	= new ShareBrowser(this);
        oTrayicon 		= new SysTrayIcon(this);
        oStatusUpdate	= new StatusUpdate(this);
        oMediaInfo		= new MediaInfo(this);
        oNowPlaying		= new NowPlaying(this);
        oGuiConfig		= new GuiConfig(this);

        nbDataContainer.CurrentPage = 0;
    }
Пример #24
0
 protected void DotNetCustomCalDotNetack_CustomCalDotNetack(object sender, Controls.CustomCalDotNetack.DotNetCustomCalDotNetack.CustomCalDotNetackEventArgs e)
 {
     string action = e.Parameters;
     _presenter = new UserEditPresenter(this);
     bool result = SaveOrUpdate();
     DotNetCustomCalDotNetack.CalDotNetackResult.Result = result.ToString();
 }
 public RibbonTabGlyph(BehaviorService behaviorService, RibbonDesigner designer, Controls.Ribbon.Ribbon ribbon)
     : base(new RibbonTabGlyphBehavior(designer, ribbon))
 {
     _behaviorService = behaviorService;
     _ribbon = ribbon;
     size = new Size(60, 16);
 }
Пример #26
0
        public override void DrawButton(Controls.Control control, bool depressed, bool hovered, bool disabled)
        {
            int w = control.Width;
            int h = control.Height;

            DrawButton(w, h, depressed, hovered);
        }
Пример #27
0
 public TGPageLoadingEventArgs(Controls.TabPage tp, XmlTextReader xmlIn)
 {
     // Definie initial state
     _tp = tp;
     _xmlIn = xmlIn;
     _cancel = false;
 }
        /// <summary>
        /// Adds extended controls to a packet.
        /// </summary>
        /// <param name="packet">The packet to which the controls are added.</param>
        /// <param name="controls">The controls.</param>
        internal void AddDirectoryControls(AdtsLdapPacket packet, params MsLdap.DirectoryControl[] controls)
        {
            LDAPMessage message = packet.ldapMessagev3;

            int existingControlCount = (message.controls != null) ? message.controls.Elements.Length : 0;
            Control[] controlArray = new Control[existingControlCount + controls.Length];

            // Add original existing controls
            for (int i = 0; i < existingControlCount; i++)
            {
                controlArray[i] = message.controls.Elements[i];
            }

            // Add newly added controls
            for (int i = 0; i < controls.Length; i++)
            {
                controlArray[existingControlCount + i] = new Control(
                    new LDAPOID(controls[i].Type),
                    new Asn1Boolean(controls[i].IsCritical),
                    new Asn1OctetString(controls[i].GetValue()));
            }

            Controls allControls = new Controls(controlArray);

            message.controls = allControls;
        }
Пример #29
0
 public ResizeControlState(Controls controls, StateManager stateManager, CommandManager commandManager, FlagPosition flagPosition)
 {
     m_flagPosition = flagPosition;
     m_controls = controls;
     m_stateManager = stateManager;
     m_commandManager = commandManager;
 }
Пример #30
0
 void fileExplorer1_FileDoubleClicked(object sender, Controls.FileExplorerEventArgs e)
 {
     Debug.WriteLine("File double clicked.");
     Debug.WriteLine("Files:");
     string[] files = fileExplorer1.SelectedFiles();
     foreach (string ptrFile in files) Debug.WriteLine(ptrFile);
 }
Пример #31
0
 public DynamicToolStripForm()
 {
     Controls.Add(m_toolstrip);
     AddToolStripButtons();
 }
Пример #32
0
        private void CheckUpdate()
        {
            GroupBox groupBoxupdate = new GroupBox
            {
                Location  = new Point(groupBox1.Location.X, button10.Location.Y + button10.Size.Height + 5),
                Size      = new Size(groupBox1.Width, 90),
                BackColor = Color.Aqua
            };
            Label versionLabel = new Label
            {
                AutoSize  = false,
                TextAlign = ContentAlignment.BottomCenter,
                Dock      = DockStyle.None,
                Location  = new Point(2, 30),
                Size      = new Size(groupBoxupdate.Width - 4, 25),
            };

            versionLabel.Font = new Font(versionLabel.Font.Name, 10F, FontStyle.Bold);
            Label infoLabel = new Label
            {
                AutoSize  = false,
                TextAlign = ContentAlignment.BottomCenter,
                Dock      = DockStyle.None,
                Location  = new Point(2, 10),
                Size      = new Size(groupBoxupdate.Width - 4, 20),
            };

            infoLabel.Font = new Font(infoLabel.Font.Name, 8.75F);
            Label downLabel = new Label
            {
                TextAlign = ContentAlignment.MiddleRight,
                AutoSize  = false,
                Size      = new Size(100, 23),
            };
            Button laterButton = new Button
            {
                Size      = new Size(40, 23),
                BackColor = Color.FromArgb(224, 224, 224)
            };
            Button updateButton = new Button
            {
                Location  = new Point(groupBoxupdate.Width - Width - 10, 60),
                Size      = new Size(40, 23),
                BackColor = Color.FromArgb(224, 224, 224)
            };

            updateButton.Location = new Point(groupBoxupdate.Width - updateButton.Width - 10, 60);
            laterButton.Location  = new Point(updateButton.Location.X - laterButton.Width - 5, 60);
            downLabel.Location    = new Point(laterButton.Location.X - downLabel.Width - 20, 60);
            groupBoxupdate.Controls.Add(updateButton);
            groupBoxupdate.Controls.Add(laterButton);
            groupBoxupdate.Controls.Add(downLabel);
            groupBoxupdate.Controls.Add(infoLabel);
            groupBoxupdate.Controls.Add(versionLabel);
            updateButton.Click += new EventHandler(UpdateButton_Click);
            laterButton.Click  += new EventHandler(LaterButton_Click);
            switch (culture1.TwoLetterISOLanguageName)
            {
            case "ru":
                infoLabel.Text    = "Доступна новая версия";
                laterButton.Text  = "нет";
                updateButton.Text = "Да";
                downLabel.Text    = "ОБНОВИТЬ";
                break;

            case "de":
                infoLabel.Text    = "Eine neue Version ist verfügbar";
                laterButton.Text  = "Nein";
                updateButton.Text = "Ja";
                downLabel.Text    = "Jetzt Updaten";
                break;

            default:
                infoLabel.Text    = "A new version is available";
                laterButton.Text  = "No";
                updateButton.Text = "Yes";
                downLabel.Text    = "Update now";
                break;
            }
            void LaterButton_Click(object sender, EventArgs e)
            {
                groupBoxupdate.Dispose();
                Controls.Remove(groupBoxupdate);
                groupBox1.Enabled = true;
            }

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            try
            {
                var request  = (WebRequest)HttpWebRequest.Create("https://github.com/UndertakerBen/PorBraveUpd/raw/master/Version.txt");
                var response = request.GetResponse();
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                {
                    var             version = reader.ReadToEnd();
                    FileVersionInfo testm   = FileVersionInfo.GetVersionInfo(applicationPath + "\\Portable Brave Updater.exe");
                    versionLabel.Text = testm.FileVersion + "  >>> " + version;
                    if (Convert.ToInt32(version.Replace(".", "")) > Convert.ToInt32(testm.FileVersion.Replace(".", "")))
                    {
                        Controls.Add(groupBoxupdate);
                        groupBox1.Enabled = false;
                    }
                    reader.Close();
                }
            }
            catch (Exception)
            {
            }
            void UpdateButton_Click(object sender, EventArgs e)
            {
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                var request2  = (WebRequest)HttpWebRequest.Create("https://github.com/UndertakerBen/PorBraveUpd/raw/master/Version.txt");
                var response2 = request2.GetResponse();

                using (StreamReader reader = new StreamReader(response2.GetResponseStream()))
                {
                    var version = reader.ReadToEnd();
                    reader.Close();
                    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                    using (WebClient myWebClient2 = new WebClient())
                    {
                        myWebClient2.DownloadFile($"https://github.com/UndertakerBen/PorBraveUpd/releases/download/v{version}/Portable.Brave.Updater.v{version}.7z", @"Portable.Brave.Updater.v" + version + ".7z");
                    }
                    File.AppendAllText(@"Update.cmd", "@echo off" + "\n" +
                                       "timeout /t 1 /nobreak" + "\n" +
                                       "\"" + applicationPath + "\\Bin\\7zr.exe\" e \"" + applicationPath + "\\Portable.Brave.Updater.v" + version + ".7z\" -o\"" + applicationPath + "\" \"Portable Brave Updater.exe\"" + " -y\n" +
                                       "call cmd /c Start /b \"\" " + "\"" + applicationPath + "\\Portable Brave Updater.exe\"\n" +
                                       "del /f /q \"" + applicationPath + "\\Portable.Brave.Updater.v" + version + ".7z\"\n" +
                                       "del /f /q \"" + applicationPath + "\\Update.cmd\" && exit\n" +
                                       "exit\n");

                    string  arguments = " /c call Update.cmd";
                    Process process   = new Process();
                    process.StartInfo.FileName  = "cmd.exe";
                    process.StartInfo.Arguments = arguments;
                    process.Start();
                    Close();
                }
            }
        }
Пример #33
0
        public async Task DownloadFile(int a, int b, int c, int d)
        {
            GroupBox progressBox = new GroupBox
            {
                Location  = new Point(10, button10.Location.Y + button10.Height + 5),
                Size      = new Size(groupBox1.Width, 90),
                BackColor = Color.Lavender,
            };
            Label title = new Label
            {
                AutoSize  = false,
                Location  = new Point(2, 10),
                Size      = new Size(progressBox.Width - 4, 25),
                Text      = "Brave " + ring2[a] + " " + newVersion[a] + " " + architektur2[c],
                TextAlign = ContentAlignment.BottomCenter
            };

            title.Font = new Font(title.Font.Name, 9.25F, FontStyle.Bold);
            Label downloadLabel = new Label
            {
                AutoSize  = false,
                Location  = new Point(5, 35),
                Size      = new Size(200, 25),
                TextAlign = ContentAlignment.BottomLeft
            };
            Label percLabel = new Label
            {
                AutoSize  = false,
                Location  = new Point(progressBox.Size.Width - 105, 35),
                Size      = new Size(100, 25),
                TextAlign = ContentAlignment.BottomRight
            };
            ProgressBar progressBarneu = new ProgressBar
            {
                Location = new Point(5, 65),
                Size     = new Size(progressBox.Size.Width - 10, 7)
            };

            progressBox.Controls.Add(title);
            progressBox.Controls.Add(downloadLabel);
            progressBox.Controls.Add(percLabel);
            progressBox.Controls.Add(progressBarneu);
            Controls.Add(progressBox);
            List <Task> list = new List <Task>();

            try
            {
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://updates.bravesoftware.com/service/update2");
                request.Method      = "POST";
                request.UserAgent   = "Google Update/1.3.101.0;winhttp;cup-ecdsa";
                request.ContentType = "application/x-www-form-urlencoded";
                byte[] byteArray = Encoding.UTF8.GetBytes("<?xml version =\"1.0\" encoding=\"UTF-8\"?><request protocol=\"3.0\" version=\"1.3.99.0\" shell_version=\"1.3.99.0\" ismachine=\"1\" sessionid=\"{11111111-1111-1111-1111-111111111111}\" installsource=\"taggedmi\" testsource=\"auto\" requestid=\"{11111111-1111-1111-1111-111111111111}\" dedup=\"cr\"><os platform=\"win\" version=\"\" sp=\"\" arch=\"x86\"/><app appid=\"{" + arappid[a] + "}\" version=\"\" nextversion=\"\" ap=\"" + arapVersion[d - 1] + "\" lang=\"en\" brand=\"\" client=\"\" installage=\"-1\" installdate=\"-1\"><updatecheck/></app></request>");
                request.ContentLength = byteArray.Length;
                Stream dataStream = request.GetRequestStream();
                dataStream.Write(byteArray, 0, byteArray.Length);
                WebResponse response = request.GetResponse();
                using (dataStream = response.GetResponseStream())
                {
                    StreamReader reader             = new StreamReader(dataStream);
                    string       responseFromServer = reader.ReadToEnd();
                    string[]     tempURL2           = responseFromServer.Substring(responseFromServer.LastIndexOf("codebase=")).Split(new char[] { '"' });
                    string[]     tempURL4           = responseFromServer.Substring(responseFromServer.IndexOf("name=")).Split(new char[] { '"' });
                    Uri          uri = new Uri(tempURL2[1] + tempURL4[1]);
                    ServicePoint sp  = ServicePointManager.FindServicePoint(uri);
                    sp.ConnectionLimit = 2;
                    dataStream.Close();
                    using (webClient = new WebClient())
                    {
                        webClient.DownloadProgressChanged += (o, args) =>
                        {
                            Control[] buttons = Controls.Find("button" + d, true);
                            if (buttons.Length > 0)
                            {
                                Button button = (Button)buttons[0];
                                button.BackColor = Color.Orange;
                            }
                            progressBarneu.Value = args.ProgressPercentage;
                            downloadLabel.Text   = $"{args.BytesReceived / 1024d / 1024d:0.00} MB's / {args.TotalBytesToReceive / 1024d / 1024d:0.00} MB's";
                            percLabel.Text       = $"{args.ProgressPercentage}%";
                        };
                        webClient.DownloadFileCompleted += (o, args) =>
                        {
                            if (args.Cancelled == true)
                            {
                                MessageBox.Show("Download has been canceled.");
                            }
                            else
                            {
                                switch (culture1.TwoLetterISOLanguageName)
                                {
                                case "ru":
                                    downloadLabel.Text = "Распаковка";
                                    break;

                                case "de":
                                    downloadLabel.Text = "Entpacken";
                                    break;

                                default:
                                    downloadLabel.Text = "Unpacking";
                                    break;
                                }
                                string  arguments = " x " + "Brave_" + architektur[c] + "_" + buildversion[a] + "_" + ring[a] + ".exe" + " -o" + @"Update\" + entpDir[b] + " -y";
                                Process process   = new Process();
                                process.StartInfo.FileName    = @"Bin\7zr.exe";
                                process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
                                process.StartInfo.Arguments   = arguments;
                                process.Start();
                                process.WaitForExit();
                                process.StartInfo.Arguments = " x " + @"Update\" + entpDir[b] + "\\Chrome.7z -o" + @"Update\" + entpDir[b] + " -y";
                                process.Start();
                                process.WaitForExit();
                                if ((File.Exists(@"Update\" + entpDir[b] + "\\chrome-bin\\Brave.exe")) && (File.Exists(instDir[b] + "\\updates\\Version.log")))
                                {
                                    string[]        instVersion = File.ReadAllText(instDir[b] + "\\updates\\Version.log").Split(new char[] { '|' });
                                    FileVersionInfo testm       = FileVersionInfo.GetVersionInfo(applicationPath + "\\Update\\" + entpDir[b] + "\\chrome-bin\\Brave.exe");
                                    if (checkBox3.Checked)
                                    {
                                        if (testm.FileVersion != instVersion[0])
                                        {
                                            if (Directory.Exists(instDir[b] + "\\" + instVersion[0]))
                                            {
                                                Directory.Delete(instDir[b] + "\\" + instVersion[0], true);
                                            }
                                            Thread.Sleep(2000);
                                            NewMethod4(a, b, c, testm);
                                        }
                                        else if ((testm.FileVersion == instVersion[0]) && (checkBox4.Checked))
                                        {
                                            if (Directory.Exists(instDir[b] + "\\" + instVersion[0]))
                                            {
                                                Directory.Delete(instDir[b] + "\\" + instVersion[0], true);
                                            }
                                            Thread.Sleep(2000);
                                            NewMethod4(a, b, c, testm);
                                        }
                                    }
                                    else if (!checkBox3.Checked)
                                    {
                                        if (Directory.Exists(instDir[b] + "\\" + instVersion[0]))
                                        {
                                            Directory.Delete(instDir[b] + "\\" + instVersion[0], true);
                                        }
                                        Thread.Sleep(2000);
                                        NewMethod4(a, b, c, testm);
                                    }
                                }
                                else
                                {
                                    if (!Directory.Exists(instDir[b]))
                                    {
                                        Directory.CreateDirectory(instDir[b]);
                                    }
                                    NewMethod4(a, b, c, FileVersionInfo.GetVersionInfo(applicationPath + "\\Update\\" + entpDir[b] + "\\chrome-bin\\Brave.exe"));
                                }
                            }
                            if (checkBox5.Checked)
                            {
                                if (!File.Exists(deskDir + "\\" + instDir[b] + ".lnk"))
                                {
                                    NewMethod5(a, b);
                                }
                            }
                            else if (File.Exists(deskDir + "\\" + instDir[b] + ".lnk") && (instDir[b] == "Brave"))
                            {
                                NewMethod5(a, b);
                            }
                            if (!File.Exists(@instDir[b] + " Launcher.exe"))
                            {
                                File.Copy(@"Bin\Launcher\" + instDir[b] + " Launcher.exe", @instDir[b] + " Launcher.exe");
                            }
                            File.Delete("Brave_" + architektur[c] + "_" + buildversion[a] + "_" + ring[a] + ".exe");
                            switch (culture1.TwoLetterISOLanguageName)
                            {
                            case "ru":
                                downloadLabel.Text = "Распакованный";
                                break;

                            case "de":
                                downloadLabel.Text = "Entpackt";
                                break;

                            default:
                                downloadLabel.Text = "Unpacked";
                                break;
                            }
                        };
                        try
                        {
                            var task = webClient.DownloadFileTaskAsync(uri, "Brave_" + architektur[c] + "_" + buildversion[a] + "_" + ring[a] + ".exe");
                            list.Add(task);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            await Task.WhenAll(list);

            await Task.Delay(2000);

            Controls.Remove(progressBox);
        }
Пример #34
0
        private void Form1_Load(object sender, EventArgs e)
        {
            TabPage sess        = new TabPage();
            TabPage tabInfo     = new TabPage();
            TabPage tabCripta   = new TabPage();
            TabPage tabDecripta = new TabPage();

            btnNuovaSessione.Size     = new Size(789, 32);
            btnCancellaS.Size         = new Size(789, 32);
            btnNuovaSessione.Location = new Point(-1, 68);
            btnCancellaS.Location     = new Point(-1, 100);
            btnNuovaSessione.Text     = "Nuova Sessione";
            btnCancellaS.Text         = "ChiudiSessione";

            btnNuovaSessione.Click += BtnNuovaSessione_Click;
            btnCancellaS.Click     += BtnCancellaS_Click;

            Controls.Add(btnNuovaSessione);
            Controls.Add(btnCancellaS);

            this.Text = "Steganografia";
            this.CenterToScreen();
            this.MaximizeBox = false;

            tabSessione.Size                  = new Size(this.Width, this.Height);
            tabSessione.Location              = new Point(0, 130);
            tabSessione.SelectedIndexChanged += TabSessione_SelectedIndexChanged;
            tabIniziale.Text                  = "Pagina Iniziale";
            tabSessione.Controls.Add(tabIniziale);
            Controls.Add(tabSessione);
            tabICD.Size = new Size(this.Width, this.Height);

            titolo.Text     = "Benvenuto!";
            titolo.AutoSize = true;
            titolo.Location = new Point(20, 20);
            titolo.Font     = new Font(new FontFamily(System.Drawing.Text.GenericFontFamilies.SansSerif), 20);

            lblSeparatore1.Text     = "______________________________________________________________________________________________________________________";
            lblSeparatore1.AutoSize = true;
            lblSeparatore1.Location = new Point(30, 60);

            descrizione1.Text     = "Inizia subito creando una nuova Sessione!\r\nInserire messaggi segreti all'interno di un immagine non è mai stato così semplice.";
            descrizione1.Location = new Point(40, 90);
            descrizione1.AutoSize = true;

            lblSeparatore2.Text     = "______________________________________________________________________________________________________________________";
            lblSeparatore2.AutoSize = true;
            lblSeparatore2.Location = new Point(30, 120);

            descrizione2.Text     = "Collegati al Database del software per condividere le Sessioni da te create attraverso la funzione 'Pubblica nel Database'!\r\nComunica con altri utenti usufruendo delle Sessioni da loro pubblicate.";
            descrizione2.Location = new Point(40, 150);
            descrizione2.AutoSize = true;

            connessioneDB              = sProvider.TryConnection();
            checkDBConnection.Text     = String.Format("Connessione al Database: " + connessioneDB);
            checkDBConnection.AutoSize = true;
            checkDBConnection.Location = new Point(40, 200);

            reConnect.Text     = "Connetti";
            reConnect.AutoSize = true;
            reConnect.Location = new Point(40, 220);
            reConnect.Size     = new Size(165, reConnect.Height);
            reConnect.Click   += ReConnect_Click;

            lblSeparatore3.Text     = "______________________________________________________________________________________________________________________";
            lblSeparatore3.AutoSize = true;
            lblSeparatore3.Location = new Point(30, 410);

            copyright.Text        = "Copyright \u00A9 2016 Steganografia, Marco Iacocca & Matteo Sperti";
            copyright.AutoSize    = true;
            copyright.UseMnemonic = false;
            copyright.Location    = new Point(40, 440);

            tabIniziale.Controls.Add(titolo);
            tabIniziale.Controls.Add(checkDBConnection);
            tabIniziale.Controls.Add(reConnect);
            tabIniziale.Controls.Add(lblSeparatore1);
            tabIniziale.Controls.Add(descrizione1);
            tabIniziale.Controls.Add(lblSeparatore2);
            tabIniziale.Controls.Add(descrizione2);
            tabIniziale.Controls.Add(lblSeparatore3);
            tabIniziale.Controls.Add(copyright);

            readConfig = new StreamReader("config.cfg");

            string s;

            while ((s = readConfig.ReadLine()) != null)
            {
                string[] splitted = new string[8];
                splitted = s.Split('|');

                addS = new Sessione(splitted[0], splitted[1], splitted[3], splitted[2], splitted[4], splitted[5]);
                sCollection.Add(addS);
            }

            readConfig.Dispose();

            for (int i = 0; i < sCollection.Count; i++)
            {
                if (sCollection[i].DString == "")
                {
                    sCollection[i].AggiungiSessione(tabSessione, this, false);
                }
                else
                {
                    sCollection[i].AggiungiSessione(tabSessione, this, true);
                }
            }

            btnCancellaS.Visible = false;

            if (connessioneDB == "Connesso")
            {
                reConnect.Enabled = false;
            }
            else
            {
                reConnect.Enabled = true;
            }
        }
Пример #35
0
 public CheckBoxList()
 {
     check_box = new CheckBox();
     Controls.Add(check_box);
 }
        public ResourcePacksOptionControl(ScreenComponent manager) : base(manager)
        {
            Grid grid = new Grid(manager)
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Margin = Border.All(15),
            };

            Controls.Add(grid);

            grid.Columns.Add(new ColumnDefinition()
            {
                ResizeMode = ResizeMode.Parts, Width = 1
            });
            grid.Columns.Add(new ColumnDefinition()
            {
                ResizeMode = ResizeMode.Fixed, Width = 100
            });
            grid.Columns.Add(new ColumnDefinition()
            {
                ResizeMode = ResizeMode.Parts, Width = 1
            });
            grid.Rows.Add(new RowDefinition()
            {
                ResizeMode = ResizeMode.Parts, Height = 1
            });
            grid.Rows.Add(new RowDefinition()
            {
                ResizeMode = ResizeMode.Auto, Height = 1
            });
            grid.Rows.Add(new RowDefinition()
            {
                ResizeMode = ResizeMode.Auto, Height = 1
            });

            StackPanel buttons = new StackPanel(manager)
            {
                VerticalAlignment = VerticalAlignment.Stretch,
            };

            grid.AddControl(buttons, 1, 0);

            #region Manipulationsbuttons

            addButton = Button.TextButton(manager, Languages.OctoClient.Add);
            addButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            addButton.Visible             = false;
            buttons.Controls.Add(addButton);

            removeButton = Button.TextButton(manager, Languages.OctoClient.Remove);
            removeButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            removeButton.Visible             = false;
            buttons.Controls.Add(removeButton);

            moveUpButton = Button.TextButton(manager, Languages.OctoClient.Up);
            moveUpButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            moveUpButton.Visible             = false;
            buttons.Controls.Add(moveUpButton);

            moveDownButton = Button.TextButton(manager, Languages.OctoClient.Down);
            moveDownButton.HorizontalAlignment = HorizontalAlignment.Stretch;
            moveDownButton.Visible             = false;
            buttons.Controls.Add(moveDownButton);

            #endregion

            applyButton = Button.TextButton(manager, Languages.OctoClient.Apply);
            applyButton.HorizontalAlignment = HorizontalAlignment.Right;
            applyButton.VerticalAlignment   = VerticalAlignment.Bottom;
            grid.AddControl(applyButton, 0, 2, 3);

            infoLabel = new Label(ScreenManager)
            {
                HorizontalTextAlignment = HorizontalAlignment.Left,
                HorizontalAlignment     = HorizontalAlignment.Stretch,
                VerticalAlignment       = VerticalAlignment.Top,
                WordWrap = true,
            };
            grid.AddControl(infoLabel, 0, 1, 3);

            #region Listen

            loadedPacksList = new Listbox <ResourcePack>(manager)
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                SelectedItemBrush   = new BorderBrush(Color.SaddleBrown * 0.7f),
                TemplateGenerator   = ListTemplateGenerator,
            };

            grid.AddControl(loadedPacksList, 0, 0);

            activePacksList = new Listbox <ResourcePack>(manager)
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                SelectedItemBrush   = new BorderBrush(Color.SaddleBrown * 0.7f),
                TemplateGenerator   = ListTemplateGenerator,
            };

            grid.AddControl(activePacksList, 2, 0);

            #endregion

            #region Info Grid

            //Grid infoGrid = new Grid(ScreenManager)
            //{
            //    HorizontalAlignment = HorizontalAlignment.Stretch,
            //};

            //infoGrid.Columns.Add(new ColumnDefinition() { ResizeMode = ResizeMode.Auto, Width = 1 });
            //infoGrid.Columns.Add(new ColumnDefinition() { ResizeMode = ResizeMode.Parts, Width = 1 });
            //infoGrid.Rows.Add(new RowDefinition() { ResizeMode = ResizeMode.Auto, Height = 1 });
            //infoGrid.Rows.Add(new RowDefinition() { ResizeMode = ResizeMode.Auto, Height = 1 });
            //infoGrid.Rows.Add(new RowDefinition() { ResizeMode = ResizeMode.Auto, Height = 1 });

            //Label nameLabel = new Label(ScreenManager)
            //{
            //    Text = "Name:",
            //};
            //infoGrid.AddControl(nameLabel, 0, 0);

            //Label authorLabel = new Label(ScreenManager)
            //{
            //    Text = "Author:",
            //};
            //infoGrid.AddControl(authorLabel, 0, 1);

            //Label descriptionLabel = new Label(ScreenManager)
            //{
            //    Text = "Description:",
            //};
            //infoGrid.AddControl(descriptionLabel, 0, 2);

            //grid.AddControl(infoGrid, 0, 1, 3);

            #endregion

            loadedPacksList.SelectedItemChanged += loadedList_SelectedItemChanged;
            activePacksList.SelectedItemChanged += activeList_SelectedItemChanged;

            addButton.LeftMouseClick += (s, e) =>
            {
                ResourcePack pack = loadedPacksList.SelectedItem;
                loadedPacksList.Items.Remove(pack);
                activePacksList.Items.Add(pack);
                activePacksList.SelectedItem = pack;
            };

            removeButton.LeftMouseClick += (s, e) =>
            {
                ResourcePack pack = activePacksList.SelectedItem;
                activePacksList.Items.Remove(pack);
                loadedPacksList.Items.Add(pack);
                loadedPacksList.SelectedItem = pack;
            };

            moveUpButton.LeftMouseClick += (s, e) =>
            {
                ResourcePack pack = activePacksList.SelectedItem;
                if (pack == null)
                {
                    return;
                }

                int index = activePacksList.Items.IndexOf(pack);
                if (index > 0)
                {
                    activePacksList.Items.Remove(pack);
                    activePacksList.Items.Insert(index - 1, pack);
                    activePacksList.SelectedItem = pack;
                }
            };

            moveDownButton.LeftMouseClick += (s, e) =>
            {
                ResourcePack pack = activePacksList.SelectedItem;
                if (pack == null)
                {
                    return;
                }

                int index = activePacksList.Items.IndexOf(pack);
                if (index < activePacksList.Items.Count - 1)
                {
                    activePacksList.Items.Remove(pack);
                    activePacksList.Items.Insert(index + 1, pack);
                    activePacksList.SelectedItem = pack;
                }
            };

            applyButton.LeftMouseClick += (s, e) =>
            {
                manager.Game.Assets.ApplyResourcePacks(activePacksList.Items);
                Program.Restart();
            };

            // Daten laden

            AssetComponent assets = manager.Game.Assets;
            foreach (var item in assets.LoadedResourcePacks)
            {
                loadedPacksList.Items.Add(item);
            }

            foreach (var item in manager.Game.Assets.ActiveResourcePacks)
            {
                activePacksList.Items.Add(item);
                if (loadedPacksList.Items.Contains(item))
                {
                    loadedPacksList.Items.Remove(item);
                }
            }
        }
Пример #37
0
        private void CreateCellsForColumn(int insertIndex, TableColumn <T> column)
        {
            SuspendLayout();
            List <TableCell> cells;

            if (_lstItems != null)
            {
                cells = new List <TableCell>(_lstItems.Count);
                for (int i = 0; i < _lstItems.Count; i++)
                {
                    T         item = _lstItems[i];
                    TableCell cell = CreateCell(item, column);
                    cells.Add(cell);
                    if (_filter(item))
                    {
                        TableRow row = _lstRowCells[i];
                        row.SuspendLayout();
                        row.Controls.Add(cell);
                        row.ResumeLayout(false);
                    }
                }
            }
            else
            {
                cells = new List <TableCell>();
            }
            HeaderCell header = new HeaderCell()
            {
                Text    = column.Text,
                TextTag = column.Tag
            };

            if (column.Sorter != null)
            {
                header.HeaderClick += (sender, evt) => {
                    if (_sortColumn == column)
                    {
                        // cycle through states if column remains the same
                        switch (_eSortType)
                        {
                        case SortOrder.None:
                            _eSortType = SortOrder.Ascending;
                            break;

                        case SortOrder.Ascending:
                            _eSortType = SortOrder.Descending;
                            break;

                        case SortOrder.Descending:
                            _eSortType = SortOrder.None;
                            break;
                        }
                    }
                    else
                    {
                        if (_sortColumn != null)
                        {
                            // reset old column sort arrow
                            for (int i = 0; i < _columns.Count; i++)
                            {
                                if (_columns[i] == _sortColumn)
                                {
                                    _lstCells[i].header.SortType = SortOrder.None;
                                    break;
                                }
                            }
                        }
                        _sortColumn = column;
                        _eSortType  = SortOrder.Ascending;
                    }
                    header.SortType = _eSortType;
                    Sort();
                };
                header.Sortable = true;
            }
            Controls.Add(header);
            _lstCells.Insert(insertIndex, new ColumnHolder(header, cells));
            ResumeLayout(false);
        }
Пример #38
0
        public FormularMasini()
        {
            this.Size        = new System.Drawing.Size(DIMENSIUNE_X, DIMENSIUNE_Y);
            this.MaximumSize = new System.Drawing.Size(DIMENSIUNE_X, DIMENSIUNE_Y);
            this.MinimumSize = new System.Drawing.Size(DIMENSIUNE_X, DIMENSIUNE_Y);
            this.Font        = new Font("Arial", 10, FontStyle.Bold);
            this.ForeColor   = Color.White;
            this.Text        = " Evidenta Masini";
            this.MaximizeBox = false;
            //Marca
            LabelMarca           = new Label();
            LabelMarca.Width     = LATIME_CONTROL;
            LabelMarca.Height    = INALTIME_CONTROL;
            LabelMarca.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 790);
            LabelMarca.Text      = "Marca";
            LabelMarca.BackColor = Color.Black;
            Controls.Add(LabelMarca);

            TextMarca          = new TextBox();
            TextMarca.Width    = LATIME_CONTROL;
            TextMarca.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 790);
            Controls.Add(TextMarca);

            //Model
            LabelModel           = new Label();
            LabelModel.Width     = LATIME_CONTROL;
            LabelModel.Height    = INALTIME_CONTROL;
            LabelModel.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 750);
            LabelModel.Text      = "Model";
            LabelModel.BackColor = Color.Black;
            Controls.Add(LabelModel);

            TextModel          = new TextBox();
            TextModel.Width    = LATIME_CONTROL;
            TextModel.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 750);
            Controls.Add(TextModel);

            //Pret
            LabelPret           = new Label();
            LabelPret.Width     = LATIME_CONTROL;
            LabelPret.Height    = INALTIME_CONTROL;
            LabelPret.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 710);
            LabelPret.Text      = "Pret";
            LabelPret.BackColor = Color.Black;
            Controls.Add(LabelPret);


            TextPret          = new TextBox();
            TextPret.Width    = LATIME_CONTROL;
            TextPret.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 710);
            Controls.Add(TextPret);

            //AnF
            LabelAnF           = new Label();
            LabelAnF.Width     = LATIME_CONTROL;
            LabelAnF.Height    = INALTIME_CONTROL;
            LabelAnF.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 670);
            LabelAnF.Text      = "An fabricatie";
            LabelAnF.BackColor = Color.Black;
            Controls.Add(LabelAnF);


            TextAnF          = new TextBox();
            TextAnF.Width    = LATIME_CONTROL;
            TextAnF.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 670);
            Controls.Add(TextAnF);

            //Putere
            LabelPutere           = new Label();
            LabelPutere.Width     = LATIME_CONTROL;
            LabelPutere.Height    = INALTIME_CONTROL;
            LabelPutere.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 630);
            LabelPutere.Text      = "Putere(CP)";
            LabelPutere.BackColor = Color.Black;
            Controls.Add(LabelPutere);


            TextPutere          = new TextBox();
            TextPutere.Width    = LATIME_CONTROL;
            TextPutere.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 630);
            Controls.Add(TextPutere);


            //Culoare
            LabelCuloare           = new Label();
            LabelCuloare.Width     = LATIME_CONTROL;
            LabelCuloare.Height    = INALTIME_CONTROL;
            LabelCuloare.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 590);
            LabelCuloare.Text      = "Culoare";
            LabelCuloare.BackColor = Color.Black;
            Controls.Add(LabelCuloare);


            TextCuloare          = new TextBox();
            TextCuloare.Width    = LATIME_CONTROL;
            TextCuloare.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 590);
            Controls.Add(TextCuloare);

            //Cutie
            LabelCutie           = new Label();
            LabelCutie.Width     = LATIME_CONTROL;
            LabelCutie.Height    = INALTIME_CONTROL;
            LabelCutie.Location  = new System.Drawing.Point(DIMENSIUNE_X - 500, DIMENSIUNE_Y - 550);
            LabelCutie.Text      = "Cutie viteze";
            LabelCutie.BackColor = Color.Black;
            Controls.Add(LabelCutie);


            TextCutie          = new TextBox();
            TextCutie.Width    = LATIME_CONTROL;
            TextCutie.Location = new System.Drawing.Point(DIMENSIUNE_X - 200, DIMENSIUNE_Y - 550);
            Controls.Add(TextCutie);

            //butonAdd
            ButtonAdauga           = new Button();
            ButtonAdauga.Width     = 2 * LATIME_CONTROL;
            ButtonAdauga.BackColor = Color.Brown;
            ButtonAdauga.Location  = new System.Drawing.Point(DIMENSIUNE_X - 410, DIMENSIUNE_Y - 510);
            ButtonAdauga.Text      = "Adauga";
            ButtonAdauga.Click    += OnButtonAdaugaClicked;
            Controls.Add(ButtonAdauga);

            //InfoStud
            LabelInfoMasina           = new Label();
            LabelInfoMasina.Width     = 3 * LATIME_CONTROL;
            LabelInfoMasina.Height    = 13 * INALTIME_CONTROL;
            LabelInfoMasina.Location  = new System.Drawing.Point(DIMENSIUNE_X - 483, DIMENSIUNE_Y - 430);
            LabelInfoMasina.Text      = "INFORMATII MASINI:";
            LabelInfoMasina.BackColor = Color.Black;
            Controls.Add(LabelInfoMasina);

            //butonClear
            ButtonClear           = new Button();
            ButtonClear.Width     = LATIME_CONTROL;
            ButtonClear.BackColor = Color.Blue;
            ButtonClear.Location  = new System.Drawing.Point(DIMENSIUNE_X - 330, DIMENSIUNE_Y - 470);
            ButtonClear.Text      = "Sterge date";
            ButtonClear.Click    += OnButtonSterge;
            Controls.Add(ButtonClear);


            //Imagine
            Imagine           = new PictureBox();
            Imagine.SizeMode  = PictureBoxSizeMode.Zoom;
            Imagine.Width     = 2 * LATIME_CONTROL - 100;
            Imagine.Height    = 2 * LATIME_CONTROL - 50;
            Imagine.BackColor = Color.Transparent;
            Imagine.Location  = new System.Drawing.Point(DIMENSIUNE_X - 370, DIMENSIUNE_Y - 240);
            Imagine.Image     = Image.FromFile("C:/Users/Andrei/Desktop/car.gif");

            Controls.Add(Imagine);
        }
Пример #39
0
        private void ConfigureMenu()
        {
            try
            {
                _ReportModuleID = Int64.Parse(ConfigurationManager.AppSettings["ReportModuleID"]);
            }
            catch (ConfigurationErrorsException) // See http://msdn.microsoft.com/en-us/library/vstudio/system.configuration.configurationmanager.appsettings(v=vs.90).aspx
            {
                _ReportModuleID = 0;
            }

            SynapseLogger.Debug("Get Toolstrip list");
            List <Control> c = Controls.OfType <ToolStrip>().Cast <Control>().ToList();

            if (c.Count > 0)
            {
                SynapseLogger.Debug("Get top Menu");
                Control Menu   = c[0];
                Control Status = null;
                foreach (Control Ctrl in c)
                {
                    if (Ctrl.Top < Menu.Top)
                    {
                        Menu = Ctrl;
                    }
                    if (Ctrl.GetType().ToString() == "System.Windows.Forms.StatusStrip")
                    {
                        Status = Ctrl;
                    }
                }
                ToolStripMenuItem btn_report = new ToolStripMenuItem();
                btn_report.Text        = "Reports";
                btn_report.Name        = "btn_Report";
                btn_report.MergeAction = MergeAction.MatchOnly;
                btn_report.MergeIndex  = 1;
                btn_report.Click      += ReportClick;
                if (Menu.GetType().ToString() == "System.Windows.Forms.ToolStrip")
                {
                    btn_report.TextImageRelation = TextImageRelation.ImageAboveText;
                    btn_report.Image             = (Image)SynapseCore.Resource1.report;
                }
                if (_ReportModuleID != 0)
                {
                    foreach (SynapseModule mod in FormUser.Modules)
                    {
                        if (mod.ID == _ReportModuleID)
                        {
                            bool ReportMenuAdded = false;
                            foreach (ToolStripItem tsmi in ((ToolStrip)Menu).Items)
                            {
                                if (tsmi.AccessibleName == "reports")
                                {
                                    ((ToolStripMenuItem)tsmi).DropDownItems.Add(btn_report);
                                    btn_report.TextImageRelation = TextImageRelation.ImageAboveText;
                                    btn_report.Image             = (Image)SynapseCore.Resource1.report;
                                    ReportMenuAdded = true;
                                    break;
                                }
                            }
                            if (!ReportMenuAdded)
                            {
                                ((ToolStrip)Menu).Items.Add(btn_report);
                            }
                            break;
                        }
                    }
                }

                SynapseLogger.Debug("Create About Menu");

                ToolStripButton btn_about = new ToolStripButton();
                btn_about.Text   = "About";
                btn_about.Name   = "btn_About";
                btn_about.Click += AboutClick;
                if (Menu.GetType().ToString() == "System.Windows.Forms.ToolStrip")
                {
                    btn_about.TextImageRelation = TextImageRelation.ImageAboveText;
                    btn_about.Image             = (Image)SynapseCore.Resource1.about;
                }

                ((ToolStrip)Menu).Items.Add(btn_about);

                SynapseLogger.Debug("Create Language Menu");

                LanguageMenu.AutoSize  = true;
                LanguageMenu.Text      = _CurrentLanguage.LABEL;
                LanguageMenu.Tag       = _CurrentLanguage.CULTURE;
                LanguageMenu.Image     = (Image)Resource1.ResourceManager.GetObject(_CurrentLanguage.CODE);
                LanguageMenu.Alignment = ToolStripItemAlignment.Right;
                LanguageMenu.Name      = "mnu_Language";

                foreach (SynapseLanguage lang in _language)
                {
                    ToolStripMenuItem lng = new ToolStripMenuItem();
                    lng.AutoSize = true;
                    lng.Text     = lang.LABEL;
                    lng.Name     = "mnu_Language_" + lang.CODE;
                    lng.Tag      = lang.CULTURE;
                    lng.Image    = (Image)Resource1.ResourceManager.GetObject(lang.CODE);
                    lng.Click   += LanguageClick;
                    LanguageMenu.DropDownItems.Add(lng);
                }

                SynapseLogger.Debug("Add Menu to Toolbar");
                if (Status != null)
                {
                    ((ToolStrip)Status).Items.Add(LanguageMenu);
                }
                else
                {
                    ((ToolStrip)Menu).Items.Add(LanguageMenu);
                }
            }
        }
Пример #40
0
        private void SecurizeForm(bool AddMenu)
        {
            bool   UserHaveAccess      = false;
            string UserID              = string.Empty;
            bool   ScanControl         = false;
            bool   ShowTestEnvironment = true;

            if (_allModules == null)
            {
                _allModules = SynapseModule.Load();
            }
            try
            {
                ShowTestEnvironment = bool.Parse(ConfigurationManager.AppSettings["ShowTestEnvironment"]);
            }
            // TODO: Replace by more specific exception
            catch (Exception)
            {
                // TODO: Log exception
            }

            if (System.ComponentModel.LicenseManager.UsageMode != System.ComponentModel.LicenseUsageMode.Designtime)
            {
                if (log4net.LogManager.GetRepository().Configured == false)
                {
                    XmlConfigurator.Configure();
                }

                if (_formUser == null)
                {
                    UserID   = WindowsIdentity.GetCurrent().Name;
                    FormUser = new SynapseCore.Security.User(UserID, this.ModuleID);
                }

                if (_language == null)
                {
                    string languageFilter = null;
                    try
                    {
                        languageFilter = ConfigurationManager.AppSettings["ModuleLanguages"];
                    }
                    catch
                    {
                        SynapseLogger.Debug("ModuleLanguage not defined in app.config");
                    }
                    if (languageFilter != null && languageFilter != string.Empty && languageFilter != "")
                    {
                        _language = SynapseLanguage.Load("where CODE in (" + languageFilter + ")");
                    }
                    else
                    {
                        _language = SynapseLanguage.Load();
                    }
                }

                SynapseLogger.Debug("ModuleLanguage not defined in app.config");
                if (Control.ModifierKeys == (Keys.Control | Keys.Shift) && FormUser.IsMemberOf("SYNAPSE_SECURITY_USER_IMPERSONATE"))
                {
                    frm_EnterUser UserDialog = new frm_EnterUser();
                    UserDialog.ShowDialog();
                    UserID = UserDialog.UserID;
                    if (UserID != string.Empty)
                    {
                        FormUser = new SynapseCore.Security.User(UserID, this.ModuleID);
                    }
                }

                SynapseLogger.Debug("Check key modifier");
                if (FormUser.UserCulture != string.Empty && FormUser.UserCulture != null)
                {
                    _CurrentLanguage.CULTURE = FormUser.UserCulture;
                }
                else
                {
                    _CurrentLanguage.CULTURE = Thread.CurrentThread.CurrentCulture.Name;
                }

                SynapseLogger.Debug("Set Current Language");
                foreach (SynapseLanguage lang in _language)
                {
                    if (lang.CULTURE == _CurrentLanguage.CULTURE)
                    {
                        _CurrentLanguage = lang;
                    }
                }

                SynapseLogger.Debug("Set Current Language Label");
                if (_CurrentLanguage.LABEL == null)
                {
                    _CurrentLanguage = _language[0];
                }

                Security.Tools.SetCulture(_CurrentLanguage.CULTURE);
                SynapseLogger.Debug("Configure Resource Manager");
                ConfigureResourceManager();

                SynapseLogger.Debug("Set Current Module access");
                if (FormUser != null)
                {
                    foreach (SynapseModule Module in _allModules) //FormUser.Modules
                    {
                        if (_CurrentSynapse == null && Module.ID == 1)
                        {
                            _CurrentSynapse = Module;
                        }
                        if (_CurrentModule == null && Module.ID == _ModuleID)
                        {
                            _CurrentModule = Module;
                        }
                    }
                    if (FormUser.Modules.Select(m => m.ID).Contains(_CurrentModule.ID))
                    {
                        UserHaveAccess = true;
                    }
                }

                SynapseLogger.Debug("Check Module Mode");
                if (CurrentModule.ID == 1)
                {
                    if (SynapseCore.Database.DBFunction.ConnectionName != "Default")
                    {
                        Mode = SynapseModule.SynapseModuleMode.Development;
                    }
                    else
                    {
                        Mode = SynapseModule.SynapseModuleMode.Production;
                    }
                }
                else
                {
                    Mode = Application.ExecutablePath.Contains("\\Dev\\") ? SynapseModule.SynapseModuleMode.Development : SynapseModule.SynapseModuleMode.Production;
                }

                //redify
                List <Control> menupoint = Controls.OfType <ToolStrip>().Cast <Control>().ToList();
                if (menupoint.Count > 0)
                {
                    foreach (Control Ctrl in menupoint)
                    {
                        if (SynapseCore.Database.DBFunction.FormBackColor != SystemColors.Control && ShowTestEnvironment)
                        {
                            ((ToolStrip)Ctrl).BackColor = SynapseCore.Database.DBFunction.FormBackColor;
                        }
                    }
                }
                //end refify

                SynapseLogger.Debug("Add Menu");
                if (this.ShowMenu && AddMenu)
                {
                    ConfigureMenu();
                }

                SynapseLogger.Debug("Language Message");
                string LangMessage = "en";
                try
                {
                    LangMessage = _CurrentLanguage.CULTURE.Substring(0, 2).ToUpper();
                }
                // TODO: Replace by more specific exception
                catch (Exception)
                {
                    SynapseLogger.Error("Unable to determine language of message");
                }

                SynapseLogger.Debug("Message No Access");
                if (!UserHaveAccess && ModuleID != 1)
                {
                    MessageBox.Show(Properties.Resources.ResourceManager.GetString(LangMessage + "_NoAccess"));
                    Application.Exit();
                }

                SynapseLogger.Debug("Message Not Active");
                if (!CurrentModule.IS_ACTIVE && Mode == SynapseModule.SynapseModuleMode.Production)
                {
                    MessageBox.Show("(" + Mode.ToString() + ") " + Properties.Resources.ResourceManager.GetString(LangMessage + "_Maintenance"));
                    Application.Exit();
                }

                SynapseLogger.Debug("Message Not Up To Date");
                if (!CurrentModule.is_uptodate(Application.StartupPath, Mode) && !System.Diagnostics.Debugger.IsAttached)
                {
                    try
                    {
                        MessageBox.Show(Properties.Resources.ResourceManager.GetString(LangMessage + "_UpdateNeeded"));
                        string file = Application.ExecutablePath.Substring(0, Application.ExecutablePath.LastIndexOf(Mode == SynapseModule.SynapseModuleMode.Production ? "\\Prod\\" : "\\Dev\\")) + "\\Synapse.exe";
                        if (file != null)
                        {
                            SynapseCore.Controls.SynapseForm.SynapseLogger.Debug("starting " + file);
                            System.Diagnostics.Process proc = new System.Diagnostics.Process();
                            proc.EnableRaisingEvents        = false;
                            proc.StartInfo.WindowStyle      = System.Diagnostics.ProcessWindowStyle.Normal;
                            proc.StartInfo.FileName         = file;
                            proc.StartInfo.WorkingDirectory = Path.GetFullPath(file);
                            proc.StartInfo.Arguments        = Mode == SynapseModule.SynapseModuleMode.Production ? "" : "/con:ACC";
                            proc.Start();
                        }
                        else
                        {
                            SynapseCore.Controls.SynapseForm.SynapseLogger.Debug("Not exist " + file);
                        }
                        Application.Exit();
                    }
                    // TODO: Replace by more specific exception
                    catch (Exception)
                    {
                        if (!FormUser.IsMemberOf("SYNAPSE_SECURITY_ADMIN"))
                        {
                            MessageBox.Show("Application not in right location !");
                            Application.Exit();
                        }
                    }
                }

                SynapseLogger.Debug("Message Development");
                if (Mode == SynapseModule.SynapseModuleMode.Development && !DevACK)
                {
                    MessageBox.Show(Properties.Resources.ResourceManager.GetString(LangMessage + "_DevelopmentMode"));
                    DevACK = true;
                }
                try
                {
                    ScanControl = bool.Parse(ConfigurationManager.AppSettings["ScanControl"]);
                }
                // DONE: Replaced by more specific exception (see http://msdn.microsoft.com/en-us/library/vstudio/system.configuration.configurationmanager.appsettings(v=vs.90).aspx)
                catch (ConfigurationErrorsException)
                {
                    // TODO: Remove swallowing of Exception
                }

                if (UpdateControls && ModuleID != 0 && ScanControl)
                {
                    System.IO.TextWriter w = new System.IO.StreamWriter(Application.StartupPath + "\\" + this.Name + "_res.SynapseResource", false, System.Text.Encoding.Unicode);
                    w.Write(SynapseCore.Security.Tools.UpdateControlsInDB(this.Controls, this.ModuleID, null).ToString());

                    w.Flush();
                    w.Close();
                }

                SynapseLogger.Debug("Init Form");
                initForm(Security.Tools.SecureAndTranslateMode.Secure | Security.Tools.SecureAndTranslateMode.Transalte);
            }
        }
Пример #41
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();
            _hfPaymentInfoToken = new HiddenFieldWithClass()
            {
                ID = "_hfPaymentInfoToken", CssClass = "js-response-token"
            };
            Controls.Add(_hfPaymentInfoToken);

            _hfCollectJSRawResponse = new HiddenFieldWithClass()
            {
                ID = "_hfTokenizerRawResponse", CssClass = "js-tokenizer-raw-response"
            };
            Controls.Add(_hfCollectJSRawResponse);

            _hfEnabledPaymentTypesJSON = new HiddenFieldWithClass()
            {
                ID = "_hfEnabledPaymentTypesJSON", CssClass = "js-enabled-payment-types"
            };
            Controls.Add(_hfEnabledPaymentTypesJSON);

            _hfEnabledPaymentTypesJSON.Value = this.EnabledPaymentTypes.ToJson();

            _hfSelectedPaymentType = new HiddenFieldWithClass()
            {
                ID = "_hfSelectedPaymentType", CssClass = "js-selected-payment-type"
            };
            Controls.Add(_hfSelectedPaymentType);


            /* Payment Type Selector*/
            if (EnabledPaymentTypes.Length > 1)
            {
                Literal lPaymentSelectorHTML = new Literal()
                {
                    ID = "lPaymentSelectorHTML"
                };

                lPaymentSelectorHTML.Text = $@"
<div class='gateway-type-selector btn-group btn-group-justified' role='group'>
    <a class='btn btn-default active js-payment-creditcard payment-creditcard' runat='server'>
        Card
    </a>
    <a class='btn btn-default js-payment-ach payment-ach' runat='server'>
        Bank Account
    </a>
</div>";

                _paymentTypeSelector = new Panel()
                {
                    ID = "_paymentTypeSelector", CssClass = "js-gateway-paymenttype-selector gateway-paymenttype-selector"
                };
                _paymentTypeSelector.Controls.Add(lPaymentSelectorHTML);
                Controls.Add(_paymentTypeSelector);
            }

            var pnlPaymentInputs = new Panel {
                ID = "pnlPaymentInputs", CssClass = "js-nmi-payment-inputs nmi-payment-inputs"
            };

            /* Credit Card Inputs */
            if (EnabledPaymentTypes.Contains(NMIPaymentType.card))
            {
                _gatewayCreditCardContainer = new Panel()
                {
                    ID = "_gatewayCreditCardContainer", CssClass = "gateway-creditcard-container gateway-payment-container js-gateway-creditcard-container"
                };
                pnlPaymentInputs.Controls.Add(_gatewayCreditCardContainer);

                _divCreditCardNumber = new HtmlGenericControl("div");
                _divCreditCardNumber.AddCssClass("js-credit-card-input iframe-input credit-card-input");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardNumber);

                _divCreditCardBreak = new HtmlGenericControl("div");
                _divCreditCardBreak.AddCssClass("break");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardBreak);

                _divCreditCardExp = new HtmlGenericControl("div");
                _divCreditCardExp.AddCssClass("js-credit-card-exp-input iframe-input credit-card-exp-input");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardExp);

                _divCreditCardCVV = new HtmlGenericControl("div");
                _divCreditCardCVV.AddCssClass("js-credit-card-cvv-input iframe-input credit-card-cvv-input");
                _gatewayCreditCardContainer.Controls.Add(_divCreditCardCVV);
            }


            /* ACH Inputs */
            if (EnabledPaymentTypes.Contains(NMIPaymentType.ach))
            {
                _gatewayACHContainer = new Panel()
                {
                    ID = "_gatewayACHContainer", CssClass = "gateway-ach-container gateway-payment-container js-gateway-ach-container"
                };
                pnlPaymentInputs.Controls.Add(_gatewayACHContainer);

                _divCheckAccountNumber = new HtmlGenericControl("div");
                _divCheckAccountNumber.AddCssClass("js-check-account-number-input iframe-input check-account-number-input");
                _gatewayACHContainer.Controls.Add(_divCheckAccountNumber);

                _divCheckRoutingNumber = new HtmlGenericControl("div");
                _divCheckRoutingNumber.AddCssClass("js-check-routing-number-input iframe-input check-routing-number-input");
                _gatewayACHContainer.Controls.Add(_divCheckRoutingNumber);

                _divCheckFullName = new HtmlGenericControl("div");
                _divCheckFullName.AddCssClass("js-check-fullname-input iframe-input check-fullname-input");
                _gatewayACHContainer.Controls.Add(_divCheckFullName);
            }

            /* Submit Payment */

            // collectJs needs a payment button to work, so add it but don't show it
            _aPaymentButton = new HtmlGenericControl("button");
            _aPaymentButton.Attributes["type"] = "button";
            _aPaymentButton.Style[HtmlTextWriterStyle.Display] = "none";
            _aPaymentButton.AddCssClass("js-payment-button payment-button");
            pnlPaymentInputs.Controls.Add(_aPaymentButton);

            Controls.Add(pnlPaymentInputs);

            _divValidationMessage = new HtmlGenericControl("div");
            _divValidationMessage.AddCssClass("alert alert-validation js-payment-input-validation");
            _divValidationMessage.InnerHtml =
                @"<span class='js-validation-message'></span>";
            this.Controls.Add(_divValidationMessage);

            _hiddenInputStyleHook = new TextBox();
            _hiddenInputStyleHook.Attributes["class"] = "js-input-style-hook form-control nmi-input-style-hook form-group";
            _hiddenInputStyleHook.Style["display"]    = "none";

            Controls.Add(_hiddenInputStyleHook);

            _divInputInvalid = new HtmlGenericControl("div");
            _divInputInvalid.AddCssClass("form-group has-error");
            _divInputInvalid.InnerHtml =
                @"<input type='text' class='js-input-invalid-style-hook form-control'>";
            _divInputInvalid.Style["display"] = "none";
            Controls.Add(_divInputInvalid);
        }
Пример #42
0
        public MainForm()
        {
            InitializeComponent();

            // Парсим

            if (File.Exists("MikroSRZ104Config.ea"))
            {
                string   name, ipAddress, factoryNum, sensorSwitchDev, sensorCircLoad;
                String[] sensorInfo = new String[3];
                int      sensorsCount;
                double   thresholdMinResistance, thresholdMaxResistance;

                XmlDocument config = new XmlDocument();
                config.Load("MikroSRZ104Config.ea");

                XmlNode rootNode = config.DocumentElement;

                XmlNodeList devices = rootNode.ChildNodes;

                int devicesCount = rootNode.ChildNodes.Count;

                mikroSRZArray         = new MikroSRZ[devicesCount];
                miniPagesArray        = new MiniPageMikroSRZ[devicesCount];
                sensorTablePagesArray = new SensorsTablePage[devicesCount];

                int i = 0;

                foreach (XmlNode device in rootNode.ChildNodes)
                {
                    name                   = "";
                    ipAddress              = "";
                    factoryNum             = "";
                    sensorSwitchDev        = "";
                    sensorCircLoad         = "";
                    thresholdMinResistance = 20;
                    thresholdMaxResistance = 200;

                    sensorsCount = 0;

                    foreach (XmlNode fieldOfDevice in device.ChildNodes)
                    {
                        switch (fieldOfDevice.Name)
                        {
                        case "NAME":
                            name = fieldOfDevice.InnerText;
                            break;

                        case "IP":
                            ipAddress = fieldOfDevice.InnerText;
                            break;

                        case "ISA":
                            sensorsCount++;
                            break;
                        }
                    }

                    mikroSRZArray[i] = new MikroSRZ(name, ipAddress, sensorsCount);

                    int j = 0;

                    foreach (XmlNode fieldOfDevice in device.ChildNodes)
                    {
                        switch (fieldOfDevice.Name)
                        {
                        case "MIN_THRESHOLD_RES":
                            thresholdMinResistance = Convert.ToDouble(fieldOfDevice.InnerText);
                            break;

                        case "MAX_THRESHOLD_RES":
                            thresholdMaxResistance = Convert.ToDouble(fieldOfDevice.InnerText);
                            break;

                        case "ISA":
                            foreach (XmlNode item in fieldOfDevice.ChildNodes)
                            {
                                switch (item.Name)
                                {
                                case "FACTORY_NUM":
                                    factoryNum = item.InnerText;
                                    break;

                                case "NAME":

                                    sensorInfo = item.InnerText.Split(new char[] { ' ' }, 3,
                                                                      StringSplitOptions.RemoveEmptyEntries);

                                    switch (sensorInfo.Length)
                                    {
                                    case 1:
                                        sensorSwitchDev = "-";
                                        sensorCircLoad  = "-";
                                        break;

                                    case 2:
                                        sensorSwitchDev = sensorInfo[1];
                                        sensorCircLoad  = "-";
                                        break;

                                    case 3:
                                        sensorSwitchDev = sensorInfo[1];
                                        sensorCircLoad  = sensorInfo[2];
                                        break;
                                    }

                                    Array.Clear(sensorInfo, 0, sensorInfo.Length);
                                    break;
                                }
                            }

                            mikroSRZArray[i].CreateSensor(j, factoryNum, sensorSwitchDev, sensorCircLoad,
                                                          thresholdMinResistance, thresholdMaxResistance);
                            sensorSwitchDev = "";
                            sensorCircLoad  = "";
                            j++;
                            break;
                        }
                    }
                    i++;
                }

                int locationX = 0;

                for (int k = 0; k < mikroSRZArray.Length; k++)
                {
                    sensorTablePagesArray[k] = new SensorsTablePage(mikroSRZArray[k].Sensors);
                    mikroSRZArray[k].Subscribe(sensorTablePagesArray[k]);
                    miniPagesArray[k] = new MiniPageMikroSRZ(mikroSRZArray[k].Name, sensorTablePagesArray[k],
                                                             new Point(locationX, 0));
                    Controls.Add(miniPagesArray[k]);
                    Controls.Add(sensorTablePagesArray[k]);
                    locationX += miniPagesArray[k].Size.Width;

                    mikroSRZArray[k].DataChanged += miniPagesArray[k].Method;
                }

                workerThread = new Thread(ConnectCycle);
                workerThread.Start();
            }
        }
Пример #43
0
        private void Print()
        {
            for (int y = 0; y < roomSize; y++)
            {
                for (int x = 0; x < roomSize; x++)
                {
                    switch (Map.mapa[x, y])        //tady se vypere prislusny obrazek
                    {
                    case 'X':
                    {
                        PictureBox tile = new PictureBox();
                        tile.Image    = wall;
                        tile.Margin   = new Padding(0);
                        tile.Size     = new Size(30, 30);
                        tile.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(tile);
                        break;
                    }

                    case 'o':
                    {
                        mapGraph.AddVertex(x + " " + y);
                        PictureBox tile = new PictureBox();
                        tile.Image    = coin;
                        tile.Margin   = new Padding(0);
                        tile.Size     = new Size(30, 30);
                        tile.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(tile);
                        break;
                    }

                    case 'p':
                    {
                        mapGraph.AddVertex(x + " " + y);
                        PictureBox tile = new PictureBox();
                        tile.Image    = powerUp;
                        tile.Margin   = new Padding(0);
                        tile.Size     = new Size(30, 30);
                        tile.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(tile);
                        break;
                    }

                    case '>':
                    {
                        mapGraph.AddVertex(x + " " + y);
                        pacman.Image    = pacmanRight;
                        pacman.Margin   = new Padding(0);
                        pacman.Size     = new Size(30, 30);
                        pacman.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(pacman);
                        break;
                    }

                    case 'f':
                    {
                        mapGraph.AddVertex(x + " " + y);
                        purpleMonstrum.Image    = purpleM;
                        purpleMonstrum.Margin   = new Padding(0);
                        purpleMonstrum.Size     = new Size(30, 30);
                        purpleMonstrum.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(purpleMonstrum);
                        break;
                    }

                    case 'm':
                    {
                        mapGraph.AddVertex(x + " " + y);
                        blueMonstrum.Image    = blueM;
                        blueMonstrum.Margin   = new Padding(0);
                        blueMonstrum.Size     = new Size(30, 30);
                        blueMonstrum.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(blueMonstrum);
                        break;
                    }

                    case 'z':
                    {
                        mapGraph.AddVertex(x + " " + y);
                        yellowMonstrum.Image    = yellowM;
                        yellowMonstrum.Margin   = new Padding(0);
                        yellowMonstrum.Size     = new Size(30, 30);
                        yellowMonstrum.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(yellowMonstrum);
                        break;
                    }

                    default:
                    {
                        mapGraph.AddVertex(x + " " + y);
                        PictureBox tile = new PictureBox();
                        tile.Image    = null;
                        tile.Margin   = new Padding(0);
                        tile.Size     = new Size(30, 30);
                        tile.Location = new Point(x * 30, (y + 1) * 30);
                        Controls.Add(tile);
                        break;
                    }
                    }
                }
            }
            for (int y = 0; y < roomSize; y++)
            {
                for (int x = 0; x < roomSize; x++)
                {
                    if (Map.mapa[x, y] != 'X')
                    {
                        AddEdgesToGraph(x, y);
                    }
                }
            }
        }
Пример #44
0
        /// <summary>
        /// Изменить доступность элементов управления
        /// </summary>
        private void enable()
        {
            Control ctrl     = null;
            bool    bEnabled = false;

            for (INDEX_CONTROL indx = (INDEX_CONTROL.UNKNOWN + 1); indx < INDEX_CONTROL.COUNT; indx++)
            {
                ctrl = Controls.Find(indx.ToString(), true)[0];
                if (Mode == MODE.UNKNOWN)
                {
                    ctrl.Enabled = false;
                }
                else
                {
                    bEnabled = _matrixEnabled[(int)_mode, (int)indx];
                    if ((!(m_objLeading == null)) &&
                        (bEnabled == true))
                    {
                        switch (Mode)
                        {
                        case MODE.DAY:
                            switch (indx)
                            {
                            case INDEX_CONTROL.DAY:
                                //bEnabled = false;
                                break;

                            case INDEX_CONTROL.MONTH:
                                //bEnabled = false;
                                break;

                            case INDEX_CONTROL.YEAR:
                                //bEnabled = false;
                                break;

                            case INDEX_CONTROL.HOUR:
                                bEnabled = false;
                                break;

                            default:
                                break;
                            }
                            break;

                        case MODE.MONTH:
                            switch (indx)
                            {
                            case INDEX_CONTROL.DAY:
                                bEnabled = false;
                                break;

                            case INDEX_CONTROL.MONTH:
                                //bEnabled = false;
                                break;

                            case INDEX_CONTROL.YEAR:
                                //bEnabled = false;
                                break;

                            case INDEX_CONTROL.HOUR:
                                bEnabled = false;
                                break;

                            default:
                                break;
                            }
                            break;

                        case MODE.YEAR:
                            switch (indx)
                            {
                            case INDEX_CONTROL.DAY:
                                bEnabled = false;
                                break;

                            case INDEX_CONTROL.MONTH:
                                bEnabled = false;
                                break;

                            case INDEX_CONTROL.YEAR:
                                //bEnabled = false;
                                break;

                            case INDEX_CONTROL.HOUR:
                                bEnabled = false;
                                break;

                            default:
                                break;
                            }
                            break;

                        case MODE.HOUR:
                            // все включено
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        ;
                    }
                    ctrl.Enabled = bEnabled;
                }
            }
        }
Пример #45
0
        private void MovementPacman(int direction)
        {
            int i, j;

            switch (direction)
            {
            case 0:
            {
                i = ((pacman.Location.X) / 30);
                j = ((pacman.Location.Y) / 30) - 2;

                if (Map.mapa[i, j] == 'o')
                {
                    Point      Mazatko = new Point(pacman.Location.X, pacman.Location.Y - 30);
                    PictureBox Smazat  = GetChildAtPoint(Mazatko) as PictureBox;
                    if (Smazat.Image == coin)
                    {
                        Map.mapa[i, j] = ' ';
                        points        += 100;
                        Map.coinAmount--;
                        score.Text   = Convert.ToString(points);
                        Smazat.Image = null;
                    }
                }
                if (Map.mapa[i, j] == 'p')
                {
                    Map.mapa[i, j] = ' ';
                    health++;
                    lives.Text = Convert.ToString(health);
                    Point Mazatko = new Point(pacman.Location.X, pacman.Location.Y - 30);
                    var   Smazat  = GetChildAtPoint(Mazatko);
                    Controls.Remove(Smazat);
                    Smazat.Dispose();
                }
                if (Map.mapa[i, j] != 'X')
                {
                    pacman.Location = new Point(pacman.Location.X, pacman.Location.Y - speedPacman);
                }

                break;
            }

            case 1:
            {
                i = ((pacman.Location.X) / 30) + 1;
                j = ((pacman.Location.Y) / 30) - 1;

                if (Map.mapa[i, j] == 'o')
                {
                    Point      Mazatko = new Point(pacman.Location.X + 30, pacman.Location.Y);
                    PictureBox Smazat  = GetChildAtPoint(Mazatko) as PictureBox;
                    if (Smazat.Image == coin)
                    {
                        Map.mapa[i, j] = ' ';
                        points        += 100;
                        Map.coinAmount--;
                        score.Text   = Convert.ToString(points);
                        Smazat.Image = null;
                    }
                }
                if (Map.mapa[i, j] == 'p')
                {
                    Map.mapa[i, j] = ' ';
                    health++;
                    lives.Text = Convert.ToString(health);
                    Point Mazatko = new Point(pacman.Location.X + 30, pacman.Location.Y);
                    toDelete.Enqueue(Mazatko);
                    PictureBox Smazat = GetChildAtPoint(Mazatko) as PictureBox;
                    Controls.Remove(Smazat);
                    Smazat.Dispose();
                }
                if (Map.mapa[i, j] != 'X')
                {
                    pacman.Location = new Point(pacman.Location.X + speedPacman, pacman.Location.Y);
                }

                break;
            }

            case 2:
            {
                i = (pacman.Location.X / 30);
                j = (pacman.Location.Y / 30);


                if (Map.mapa[i, j] == 'o')
                {
                    Point      Mazatko = new Point(pacman.Location.X, pacman.Location.Y + 30);
                    PictureBox Smazat  = GetChildAtPoint(Mazatko) as PictureBox;
                    if (Smazat.Image == coin)
                    {
                        Map.mapa[i, j] = ' ';
                        points        += 100;
                        Map.coinAmount--;
                        score.Text   = Convert.ToString(points);
                        Smazat.Image = null;
                    }
                }
                if (Map.mapa[i, j] == 'p')
                {
                    Map.mapa[i, j] = ' ';
                    health++;
                    lives.Text = Convert.ToString(health);
                    Point Mazatko = new Point(pacman.Location.X, pacman.Location.Y + 30);
                    var   Smazat  = GetChildAtPoint(Mazatko);
                    Controls.Remove(Smazat);
                    Smazat.Dispose();
                }
                if (Map.mapa[i, j] != 'X')
                {
                    pacman.Location = new Point(pacman.Location.X, pacman.Location.Y + speedPacman);
                }

                break;
            }

            case 3:
            {
                i = ((pacman.Location.X) / 30) - 1;
                j = ((pacman.Location.Y) / 30) - 1;

                if (Map.mapa[i, j] == 'o')
                {
                    Point      Mazatko = new Point(pacman.Location.X - 30, pacman.Location.Y);
                    PictureBox Smazat  = GetChildAtPoint(Mazatko) as PictureBox;
                    if (Smazat.Image == coin)
                    {
                        Map.mapa[i, j] = ' ';
                        points        += 100;
                        Map.coinAmount--;
                        score.Text   = Convert.ToString(points);
                        Smazat.Image = null;
                    }
                }
                if (Map.mapa[i, j] == 'p')
                {
                    Map.mapa[i, j] = ' ';
                    health++;
                    lives.Text = Convert.ToString(health);
                    Point Mazatko = new Point(pacman.Location.X - 30, pacman.Location.Y);
                    var   Smazat  = GetChildAtPoint(Mazatko);
                    Controls.Remove(Smazat);
                    Smazat.Dispose();
                }
                if (Map.mapa[i, j] != 'X')
                {
                    pacman.Location = new Point(pacman.Location.X - speedPacman, pacman.Location.Y);
                }

                break;
            }
            }
            Win();
        }
Пример #46
0
        /// <summary>
        /// Main from loader
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MainFormLoader(object sender, EventArgs e)
        {
            timerSlowDisplay.Start();

            #region Adapter filling

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.Applications". При необходимости она может быть перемещена или удалена.
            applicationsTableAdapter.Fill(dbssDS.Applications);

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.Masters". При необходимости она может быть перемещена или удалена.
            mastersTableAdapter.Fill(dbssDS.Masters);

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.Services". При необходимости она может быть перемещена или удалена.
            servicesTableAdapter.Fill(dbssDS.Services);

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.Manufacturers". При необходимости она может быть перемещена или удалена.
            manufacturersTableAdapter.Fill(dbssDS.Manufacturers);

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.DATA". При необходимости она может быть перемещена или удалена.
            dataTableAdapter.Fill(dbssDS.DATA);

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.CarOwners". При необходимости она может быть перемещена или удалена.
            carOwnersTableAdapter.Fill(dbssDS.CarOwners);

            // TODO: данная строка кода позволяет загрузить данные в таблицу "dbssDS.Cars". При необходимости она может быть перемещена или удалена.
            carsTableAdapter.Fill(dbssDS.Cars);

            #endregion

            // TODO: create a connection
            sqlConnect = new SqlConnection(Properties.Settings.Default.ConnectionString);

            // TODO: create a command
            sqlCommand = new SqlCommand
            {
                Connection = sqlConnect
            };

            pb = new PictureBox();

            timespan = DateTime.Now.Millisecond;

            #region Create list of tables source & list of panels

            PanelList = Controls.OfType <Panel>().ToList();
            PanelList.Reverse();

            SourceList = new List <BindingSource>(7)
            {
                carsBindingSource,
                carOwnersBindingSource,
                mastersBindingSource,
                manufacturersBindingSource,
                applicationsBindingSource,
                servicesBindingSource,
                dataBindingSource
            };

            List <MonthCalendar> mc = new List <MonthCalendar>(7)
            {
                applicationsCalendar,
                carOwnersCalendar,
                carsCalendar,
                dataCalendar,
                manufacturersCalendar,
                mastersCalendar,
                servicesCalendar
            };

            // Filling calendar
            for (int i = 0; i < mc.Count; i++)
            {
                for (int j = 0; j < mastersGrid.Rows.Count - 1; j++)
                {
                    mc[i].AddAnnuallyBoldedDate(
                        (DateTime)mastersGrid.Rows[j].Cells["mastersBirthColumn"].Value);
                }
            }
            mc.Clear();
            mc.TrimExcess();

            carsOpenItem.PerformClick();

            #endregion
        }
Пример #47
0
        private void InitializeComponent()
        {
            lblUsername       = new Label();
            txtUsername       = new TextBoxOrComboBox();
            lblPassword       = new Label();
            lblStatus         = new Label();
            txtPassword       = new TextBox();
            btnLogin          = new Button();
            pictureBoxLogo    = new PictureBox();
            ckBoxSavePassword = new CheckBox();
            lblEmailExample   = new Label();
            linkLabelCreateMicrosoftAccountID = new LinkLabel();
            linkLabelPrivacy = new LinkLabel();
            SuspendLayout();
            //
            // lblUsername
            //
            lblUsername.Location = new Point(48, 126);
            lblUsername.Name     = "lblUsername";
            lblUsername.Size     = new Size(216, 18);
            lblUsername.TabIndex = 7;
            lblUsername.Text     = "&Microsoft Account ID:";
            lblUsername.Anchor   = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
                                                    | AnchorStyles.Right)));
            //
            // txtUsername
            //
            txtUsername.Location = new Point(48, 144);
            txtUsername.Name     = "txtUsername";
            txtUsername.Size     = new Size(216, 23);
            txtUsername.TabIndex = 8;
            txtUsername.Anchor   = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
                                                    | AnchorStyles.Right)));

            //
            // lblPassword
            //
            lblPassword.Location = new Point(48, 190);
            lblPassword.Name     = "lblPassword";
            lblPassword.Size     = new Size(216, 18);
            lblPassword.TabIndex = 9;
            lblPassword.Text     = "&Password:"******"linkLabelCreateMicrosoftAccountID";
            linkLabelCreateMicrosoftAccountID.Size         = new Size(216, 40);
            linkLabelCreateMicrosoftAccountID.Text         = "Create Microsoft Account ID";
            linkLabelCreateMicrosoftAccountID.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelCreateMicrosoftAccountID_LinkClicked);
            linkLabelCreateMicrosoftAccountID.Visible      = false;
            linkLabelCreateMicrosoftAccountID.TabIndex     = 13;
            //
            // linkLabelPrivacy
            //
            linkLabelPrivacy.Location     = new Point(48, 140);
            linkLabelPrivacy.Name         = "linkLabelPrivacy";
            linkLabelPrivacy.Size         = new Size(216, 40);
            linkLabelPrivacy.Text         = "Privacy Policy";
            linkLabelPrivacy.LinkClicked += new LinkLabelLinkClickedEventHandler(linkLabelPrivacy_LinkClicked);
            linkLabelPrivacy.Visible      = false;
            linkLabelCreateMicrosoftAccountID.TabIndex = 14;

            //
            // txtPassword
            //
            txtPassword.Location     = new Point(48, 208);
            txtPassword.Name         = "txtPassword";
            txtPassword.PasswordChar = '*';
            txtPassword.Size         = new Size(216, 20);
            txtPassword.TabIndex     = 10;
            txtPassword.Text         = "";
            txtPassword.Anchor       = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
                                                        | AnchorStyles.Right)));
            //
            // btnLogin
            //
            btnLogin.FlatStyle = FlatStyle.System;
            btnLogin.Location  = new Point(189, 256);
            btnLogin.Name      = "btnLogin";
            btnLogin.TabIndex  = 20;
            btnLogin.Text      = "&Login";
            btnLogin.Click    += new EventHandler(btnLogin_Click);
            btnLogin.Anchor    = ((AnchorStyles)(AnchorStyles.Bottom | AnchorStyles.Right));
            //
            // pictureBoxLogo
            //
            pictureBoxLogo.Location    = new Point(48, 40);
            pictureBoxLogo.Name        = "pictureBoxLogo";
            pictureBoxLogo.Size        = new Size(216, 50);
            pictureBoxLogo.TabStop     = false;
            pictureBoxLogo.Click      += new EventHandler(pictureBox1_Click);
            pictureBoxLogo.MouseEnter += new EventHandler(pictureBox1_MouseEnter);
            pictureBoxLogo.MouseLeave += new EventHandler(pictureBox1_MouseLeave);
            //
            // ckBoxSavePassword
            //
            ckBoxSavePassword.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left)
                                                        )));
            ckBoxSavePassword.FlatStyle = FlatStyle.System;
            ckBoxSavePassword.Location  = new Point(50, 232);
            ckBoxSavePassword.Name      = "ckBoxSavePassword";
            ckBoxSavePassword.Size      = new Size(216, 16);
            ckBoxSavePassword.TabIndex  = 11;
            ckBoxSavePassword.Text      = "Remember my &password";
            //
            // lblEmailExample
            //
            lblEmailExample.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right)
                                                      )));
            lblEmailExample.ForeColor = SystemColors.ControlDarkDark;
            lblEmailExample.FlatStyle = FlatStyle.System;
            lblEmailExample.Location  = new Point(48, 168);
            lblEmailExample.Name      = "lblEmailExample";
            lblEmailExample.Size      = new Size(216, 16);
            lblEmailExample.Text      = "([email protected])";

            lblStatus.Anchor    = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            lblStatus.FlatStyle = FlatStyle.System;
            lblStatus.Name      = "lblStatus";
            lblStatus.Text      = "";
            lblStatus.TextAlign = ContentAlignment.MiddleCenter;
            lblStatus.Size      = new Size(309, 56);
            lblStatus.Location  = new Point(3, 165);

            //
            // SoapboxLoginControl
            //
            Controls.Add(linkLabelCreateMicrosoftAccountID);
            Controls.Add(linkLabelPrivacy);
            Controls.Add(lblEmailExample);
            Controls.Add(ckBoxSavePassword);
            Controls.Add(pictureBoxLogo);
            Controls.Add(lblUsername);
            Controls.Add(txtUsername);
            Controls.Add(lblPassword);
            Controls.Add(txtPassword);
            Controls.Add(btnLogin);
            Controls.Add(lblStatus);
            Name = "SoapboxLoginControl";
            Size = new Size(322, 399);
            Controls.SetChildIndex(btnLogin, 0);
            Controls.SetChildIndex(txtPassword, 0);
            Controls.SetChildIndex(lblPassword, 0);
            Controls.SetChildIndex(txtUsername, 0);
            Controls.SetChildIndex(lblUsername, 0);
            Controls.SetChildIndex(pictureBoxLogo, 0);
            Controls.SetChildIndex(ckBoxSavePassword, 0);
            Controls.SetChildIndex(lblEmailExample, 0);
            Controls.SetChildIndex(linkLabelPrivacy, 0);
            Controls.SetChildIndex(linkLabelCreateMicrosoftAccountID, 0);
            Controls.SetChildIndex(lblStatus, 0);
            ResumeLayout(false);
        }
Пример #48
0
        public override void Load()
        {
            listCoordMur     = RemplissageDeCord(Properties.Resources.Murcoord, listCoordMur);
            listCoordEnnemis = RemplissageDeCord(Properties.Resources.EnnemisCoord, listCoordEnnemis);
            listCoordPapier  = RemplissageDeCord(Properties.Resources.papierCoord, listCoordPapier);
            string[] aStrNomPapier = new string[7] {
                "pbPapier1", "pbPapier2", "pbPapier3", "pbPapier4", "pbPapier5", "pbPapier6", "pbSac"
            };

            //pour le joueur et les ennemi j'utilise un système de "ghost"
            //normalement la hitbox serait légèrement plus grande que l'image affichée
            //car cette dernière ne remplis pas toute la box.
            //alors je réduis la taille du joueur/ennemi , c'est ce qui sera sa hitbox effective
            //et j'affiche l'image dans une autre picturebox qui la suivra, son "ghost"

            //ici on initialise le joueur avec son "Ghost"
            pbJoueur.Size     = new System.Drawing.Size(23, 26);
            pbJoueur.Location = new System.Drawing.Point(98, 231);

            pbGhostJoueur.Size     = new System.Drawing.Size(29, 32);
            pbGhostJoueur.Location = new System.Drawing.Point(95, 228);
            //pbJoueur.BackColor = Color.Crimson; //utile pour afficher la hitbox pour le débuggage
            pbJoueur.Visible        = false;
            pbGhostJoueur.Image     = aSpriteJoueur[EtatSpriteJoueur, 1];
            pbGhostJoueur.BackColor = Color.Transparent;
            Controls.Add(pbJoueur);
            Controls.Add(pbGhostJoueur);

            //on va donc assigner toute les coordonnées contenues dans le fichier XML grâce à cette méthode
            aPBMurs = RemplissageProprietePictureBox(aPBMurs, listCoordMur);
            foreach (PictureBox mur in aPBMurs)
            {
                Controls.Add(mur);
            }

            //ici on initialise les ennemis et on lie leurs "ghost"
            aPBEnnemis = RemplissageProprietePictureBox(aPBEnnemis, listCoordEnnemis);
            connexionSpriteHitboxEnnemi();
            int iEnnemis = 0;

            foreach (PictureBox ennemi in aPBEnnemis)
            {
                Image[,] aSpriteEnnemi         = SelectionSet(iEnnemis);
                aPBGhostEnnemi[iEnnemis].Image = aSpriteEnnemi[aEtatSpriteEnnemi[iEnnemis], 1];
                Controls.Add(ennemi);
                Controls.Add(aPBGhostEnnemi[iEnnemis]);
                iEnnemis++;
            }

            //ici on initialise les papiers
            aPBPapier = RemplissageProprietePictureBox(aPBPapier, listCoordPapier);
            int iNomPapier = 0;

            foreach (PictureBox papier in aPBPapier)
            {
                aPBPapier[iNomPapier].Name  = aStrNomPapier[iNomPapier];
                aPBPapier[iNomPapier].Image = aSpriteSac[iNomPapier];
                iNomPapier++;
                Controls.Add(papier);
            }

            //ici on modifie le dernier sac pour le faire disparaître momentanéement
            aPBPapier[6].Enabled   = false;
            aPBPapier[6].Visible   = false;
            aPBPapier[6].BackColor = Color.Transparent;

            timer1.Start();
            timerSpriteEnnemi.Start();
            //on demarre le timer d'animation du joueur sur un keypress
        }
Пример #49
0
 protected override void CreateChildControls()
 {
     Control control = Page.LoadControl(_ascxPath);
     Controls.Add(control);
 }
Пример #50
0
        private void RefreshLayout()
        {
            if (_auth == null)
            {
                return;
            }

            SuspendLayout();
            ckBoxSavePassword.Width = Width - ckBoxSavePassword.Left - 10;
            linkLabelCreateMicrosoftAccountID.Width = Width - linkLabelCreateMicrosoftAccountID.Left - 10;
            LayoutHelper.NaturalizeHeight(pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, linkLabelCreateMicrosoftAccountID, linkLabelPrivacy, btnLogin);

            if (ShowCreateMicrosoftAccountID)
            {
                LayoutHelper.DistributeVertically(4, false, pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, linkLabelCreateMicrosoftAccountID, linkLabelPrivacy, btnLogin);
            }
            else
            {
                LayoutHelper.DistributeVertically(4, false, pictureBoxLogo, lblUsername, txtUsername, lblEmailExample, lblPassword, txtPassword, ckBoxSavePassword, btnLogin);
            }

            ckBoxSavePassword.Visible = _auth.AllowSavePassword;

            lblUsername.Width     =
                lblPassword.Width = lblEmailExample.Width = txtUsername.Width;
            lblUsername.Left      =
                lblPassword.Left  = lblEmailExample.Left = txtUsername.Left;

            if (BidiHelper.IsRightToLeft)
            {
                pictureBoxLogo.Left = txtUsername.Right - pictureBoxLogo.Width;
            }
            else
            {
                pictureBoxLogo.Left = txtUsername.Left;
            }

            Controls.Remove(lblStatus);

            DisplayHelper.AutoFitSystemButton(btnLogin, btnLogin.Width, int.MaxValue);
            LayoutHelper.FitControlsBelow(10, pictureBoxLogo);

            LayoutHelper.NaturalizeHeightAndDistribute(3, lblUsername, txtUsername, lblEmailExample);
            LayoutHelper.FitControlsBelow(10, lblEmailExample);
            if (ShowCreateMicrosoftAccountID)
            {
                LayoutHelper.NaturalizeHeightAndDistribute(3, lblPassword, txtPassword, ckBoxSavePassword);
                LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, new ControlGroup(linkLabelCreateMicrosoftAccountID, linkLabelPrivacy), btnLogin);
            }
            else
            {
                LayoutHelper.NaturalizeHeightAndDistribute(3, lblPassword, txtPassword, ckBoxSavePassword);
                LayoutHelper.NaturalizeHeightAndDistribute(15, ckBoxSavePassword, btnLogin);
            }

            if (BidiHelper.IsRightToLeft)
            {
                btnLogin.Left          = txtPassword.Left;
                ckBoxSavePassword.Left = txtPassword.Right - ckBoxSavePassword.Width;
                linkLabelCreateMicrosoftAccountID.Left = txtPassword.Right - linkLabelCreateMicrosoftAccountID.Width;
                linkLabelPrivacy.Left = txtPassword.Right - linkLabelPrivacy.Width;
            }
            else
            {
                btnLogin.Left          = txtPassword.Right - btnLogin.Width;
                ckBoxSavePassword.Left = linkLabelCreateMicrosoftAccountID.Left = linkLabelPrivacy.Left = txtPassword.Left;
                linkLabelCreateMicrosoftAccountID.Left -= 2;
                linkLabelPrivacy.Left -= 2;
            }

            Controls.Add(lblStatus);
            ResumeLayout();
        }
Пример #51
0
    // Update is called once per frame
    void Update()
    {
        if (active)
        {
            if (alpha < alphaTarget)
            {
                alpha = Mathf.Min(alpha + alphaSpeed, alphaTarget);
            }
            Text[] texts = GetComponentsInChildren <Text>();
            foreach (Text t in texts)
            {
                t.color = new Color(t.color.r, t.color.g, t.color.b, alpha);
            }
            Image[] images = GetComponentsInChildren <Image>();
            foreach (Image im in images)
            {
                im.color = new Color(im.color.r, im.color.g, im.color.b, alpha);
            }



            if (!horizontal)
            {
                if (Controls.DownMenu())
                {
                    cursor = Next(cursor);//cursor = (cursor + 1) % options.Length;
                    selected.transform.position = new Vector2(sx, sy - sep * cursor);
                    Sounds.Play("sound_menu_change");

                    selected.transform.SetParent(optionsObj[cursor].transform);
                    selected.transform.localPosition = Vector2.zero;//new
                    options[cursor].selectedObject   = selected;
                }
                if (Controls.UpMenu())
                {
                    cursor = Last(cursor);//cursor = (cursor + options.Length - 1) % options.Length;
                    selected.transform.position = new Vector2(sx, sy - sep * cursor);
                    Sounds.Play("sound_menu_change");

                    selected.transform.SetParent(optionsObj[cursor].transform);
                    selected.transform.localPosition = Vector2.zero;//new
                    options[cursor].selectedObject   = selected;
                }
            }
            if (horizontal)
            {
                if (Controls.RightMenu())
                {
                    cursor = Next(cursor);//cursor = (cursor + 1) % options.Length;
                    selected.transform.position = new Vector2(sx + sep * cursor, sy);
                    Sounds.Play("sound_menu_change");

                    selected.transform.SetParent(optionsObj[cursor].transform);
                    selected.transform.localPosition = Vector2.zero;//new
                    options[cursor].selectedObject   = selected;
                }
                if (Controls.LeftMenu())
                {
                    cursor = Last(cursor);//cursor = (cursor + options.Length - 1) % options.Length;
                    selected.transform.position = new Vector2(sx + sep * cursor, sy);
                    Sounds.Play("sound_menu_change");

                    selected.transform.SetParent(optionsObj[cursor].transform);
                    selected.transform.localPosition = Vector2.zero;//new
                    options[cursor].selectedObject   = selected;
                }
            }
            bool occupied = false;
            foreach (Option op in options)
            {
                //Debug.Log(op.GetComponent<Text>().text + op.selected);
                if (op.selected)
                {
                    occupied = true;
                }
            }
            if (Controls.LastMenu() && !occupied)
            {
                Sounds.Play("sound_menu_cancel");
                if (parent != null)
                {
                    Disappear(false);
                    parent.GetComponent <Menu>().Appear();
                }
            }
            if (Controls.Select())
            {
                if (optionsObj[cursor].GetComponent <Option>().menu != null)
                {
                    optionsObj[cursor].GetComponent <Option>().menu.GetComponent <Menu>().parent = gameObject;
                }

                optionsObj[cursor].GetComponent <Option>().parentMenu = gameObject;
                optionsObj[cursor].GetComponent <Option>().Select();
                if (optionsObj[cursor].GetComponent <OptionKey>() != null)
                {
                    optionsObj[cursor].GetComponent <OptionKey>();
                }

                Sounds.Play("sound_menu_select");
            }
        }

        foreach (Option op in options)
        {
            op.hovering = false;
        }
        options[cursor].Hover();
        Informations.SetInfo(options[cursor].information);



        if (!active)
        {
            if (alpha > alphaTarget)
            {
                alpha = Mathf.Max(alpha - alphaSpeed, alphaTarget);
            }
            else if (alpha == 0)
            {
                gameObject.SetActive(false);
                //transform.position = new Vector2(transform.position.x - Mathf.Abs(disappearDistance), transform.position.y);
            }
            Text[] texts = GetComponentsInChildren <Text>();
            foreach (Text t in texts)
            {
                t.color = new Color(t.color.r, t.color.g, t.color.b, alpha);
            }
            Image[] images = GetComponentsInChildren <Image>();
            foreach (Image im in images)
            {
                im.color = new Color(im.color.r, im.color.g, im.color.b, alpha);
            }
        }

        if (target != 0)
        {
            float dx;
            if (target < 0)
            {
                dx      = -Mathf.Min(speed, Mathf.Abs(target));
                target -= dx;
            }
            else
            {
                dx      = Mathf.Min(speed, Mathf.Abs(target));
                target -= dx;
            }
            Vector2 pos = transform.position;
            transform.position = new Vector2(pos.x + dx, pos.y);
        }
    }
Пример #52
0
        internal void processToScreen()
        {
            toolTip1.RemoveAll();

            disableNumericUpDownControls(this);

            // process hashdefines and update display
            foreach (string value in MainV2.comPort.MAV.param.Keys)
            {
                if (value == null || value == "")
                    continue;

                var name = value;
                var text = Controls.Find(name, true);
                foreach (var ctl in text)
                {
                    try
                    {
                        if (ctl.GetType() == typeof (NumericUpDown))
                        {
                            var thisctl = ((NumericUpDown) ctl);
                            thisctl.Maximum = 9000;
                            thisctl.Minimum = -9000;
                            thisctl.Value = (decimal) (float) MainV2.comPort.MAV.param[value];
                            thisctl.Increment = (decimal) 0.001;
                            if (thisctl.Name.EndsWith("_P") || thisctl.Name.EndsWith("_I") ||
                                thisctl.Name.EndsWith("_D")
                                || thisctl.Name.EndsWith("_LOW") || thisctl.Name.EndsWith("_HIGH") || thisctl.Value == 0
                                || thisctl.Value.ToString("0.###", new CultureInfo("en-US")).Contains("."))
                            {
                                thisctl.DecimalPlaces = 3;
                            }
                            else
                            {
                                thisctl.Increment = 1;
                                thisctl.DecimalPlaces = 1;
                            }

                            if (thisctl.Name.EndsWith("_IMAX"))
                            {
                                thisctl.Maximum = 180;
                                thisctl.Minimum = -180;
                            }

                            thisctl.Enabled = true;

                            thisctl.BackColor = Color.FromArgb(0x43, 0x44, 0x45);
                            thisctl.Validated += null;
                            if (tooltips[value] != null)
                            {
                                try
                                {
                                    toolTip1.SetToolTip(ctl, ((paramsettings) tooltips[value]).desc);
                                }
                                catch
                                {
                                }
                            }
                            thisctl.Validated += EEPROM_View_float_TextChanged;
                        }
                        else if (ctl.GetType() == typeof (ComboBox))
                        {
                            var thisctl = ((ComboBox) ctl);

                            thisctl.SelectedIndex = (int) (float) MainV2.comPort.MAV.param[value];

                            thisctl.Validated += ComboBox_Validated;
                        }
                    }
                    catch
                    {
                    }
                }
                if (text.Length == 0)
                {
                    //Console.WriteLine(name + " not found");
                }
            }
        }
Пример #53
0
 /// <summary>
 /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
 /// </summary>
 protected override void CreateChildControls()
 {
     base.CreateChildControls();
     Controls.Clear();
     RockControlHelper.CreateChildControls(this, Controls);
 }
Пример #54
0
        /// <summary>
        /// Desktop/Local Get Next Task - Get task from the Algorithm folder of VS Solution.
        /// </summary>
        /// <returns></returns>
        public AlgorithmNodePacket NextJob(out string location)
        {
            location = AlgorithmLocation;
            Log.Trace("JobQueue.NextJob(): Selected " + location);

            // check for parameters in the config
            var parameters = new Dictionary <string, string>();

            var parametersConfigString = Config.Get("parameters");

            if (parametersConfigString != string.Empty)
            {
                parameters = JsonConvert.DeserializeObject <Dictionary <string, string> >(parametersConfigString);
            }

            var controls = new Controls()
            {
                MinuteLimit   = Config.GetInt("symbol-minute-limit", 10000),
                SecondLimit   = Config.GetInt("symbol-second-limit", 10000),
                TickLimit     = Config.GetInt("symbol-tick-limit", 10000),
                RamAllocation = int.MaxValue
            };

            //If this isn't a backtesting mode/request, attempt a live job.
            if (_liveMode)
            {
                var liveJob = new LiveNodePacket
                {
                    Type       = PacketType.LiveNode,
                    Algorithm  = File.ReadAllBytes(AlgorithmLocation),
                    Brokerage  = Config.Get("live-mode-brokerage", PaperBrokerageTypeName),
                    Channel    = AccessToken,
                    UserId     = UserId,
                    ProjectId  = ProjectId,
                    Version    = Globals.Version,
                    DeployId   = AlgorithmTypeName,
                    Parameters = parameters,
                    Language   = Language,
                    Controls   = controls
                };

                try
                {
                    // import the brokerage data for the configured brokerage
                    var brokerageFactory = Composer.Instance.Single <IBrokerageFactory>(factory => factory.BrokerageType.MatchesTypeName(liveJob.Brokerage));
                    liveJob.BrokerageData = brokerageFactory.BrokerageData;
                }
                catch (Exception err)
                {
                    Log.Error(err, string.Format("Error resolving BrokerageData for live job for brokerage {0}:", liveJob.Brokerage));
                }

                return(liveJob);
            }

            //Default run a backtesting job.
            var backtestJob = new BacktestNodePacket(0, 0, "", new byte[] {}, 10000, "local")
            {
                Type       = PacketType.BacktestNode,
                Algorithm  = File.ReadAllBytes(AlgorithmLocation),
                Channel    = AccessToken,
                UserId     = UserId,
                ProjectId  = ProjectId,
                Version    = Globals.Version,
                BacktestId = AlgorithmTypeName,
                Language   = Language,
                Parameters = parameters,
                Controls   = controls
            };

            return(backtestJob);
        }
Пример #55
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LIGHT));
     TELE              = new ReaLTaiizor.Controls.LabelEdit();
     LOPB              = new System.Windows.Forms.PictureBox();
     PWDTB             = new ReaLTaiizor.Controls.BigTextBox();
     PLPB              = new ReaLTaiizor.Controls.PoisonProgressBar();
     SSBR              = new ReaLTaiizor.Controls.ForeverStatusBar();
     CEB               = new ReaLTaiizor.Controls.MaterialButton();
     CYB               = new ReaLTaiizor.Controls.MaterialButton();
     MTC               = new ReaLTaiizor.Controls.MaterialTabControl();
     Generate          = new System.Windows.Forms.TabPage();
     HYS               = new ReaLTaiizor.Controls.MaterialSwitch();
     WRPB              = new System.Windows.Forms.PictureBox();
     History           = new System.Windows.Forms.TabPage();
     HYP               = new System.Windows.Forms.Panel();
     Setting           = new System.Windows.Forms.TabPage();
     PWLN              = new ReaLTaiizor.Controls.HopeTrackBar();
     DKUC              = new UC.THEME.DK();
     LTUC              = new UC.THEME.LT();
     TMCB              = new ReaLTaiizor.Controls.MaterialCheckBox();
     SMCB              = new ReaLTaiizor.Controls.MaterialComboBox();
     AMCB              = new ReaLTaiizor.Controls.MaterialComboBox();
     RTPB              = new System.Windows.Forms.PictureBox();
     MTS               = new ReaLTaiizor.Controls.MaterialTabSelector();
     STATUST           = new System.Windows.Forms.Timer(components);
     STATUSMT          = new System.Windows.Forms.Timer(components);
     materialCheckBox1 = new ReaLTaiizor.Controls.MaterialCheckBox();
     materialCheckBox2 = new ReaLTaiizor.Controls.MaterialCheckBox();
     materialCheckBox3 = new ReaLTaiizor.Controls.MaterialCheckBox();
     TETT              = new ReaLTaiizor.Controls.MetroToolTip();
     ((System.ComponentModel.ISupportInitialize)(LOPB)).BeginInit();
     MTC.SuspendLayout();
     Generate.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(WRPB)).BeginInit();
     History.SuspendLayout();
     Setting.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(RTPB)).BeginInit();
     SuspendLayout();
     //
     // TELE
     //
     TELE.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                         | System.Windows.Forms.AnchorStyles.Right)));
     TELE.BackColor = System.Drawing.Color.Transparent;
     TELE.Enabled   = false;
     TELE.Font      = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
     TELE.ForeColor = System.Drawing.Color.White;
     TELE.Location  = new System.Drawing.Point(0, 0);
     TELE.Name      = "TELE";
     TELE.Size      = new System.Drawing.Size(359, 25);
     TELE.TabIndex  = 1;
     TELE.Text      = "Nerator";
     TELE.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // LOPB
     //
     LOPB.BackColor = System.Drawing.Color.Transparent;
     LOPB.Enabled   = false;
     LOPB.Image     = global::Nerator.Properties.Resources.ShowPassword;
     LOPB.Location  = new System.Drawing.Point(0, 0);
     LOPB.Name      = "LOPB";
     LOPB.Size      = new System.Drawing.Size(25, 24);
     LOPB.SizeMode  = System.Windows.Forms.PictureBoxSizeMode.Zoom;
     LOPB.TabIndex  = 3;
     LOPB.TabStop   = false;
     //
     // PWDTB
     //
     PWDTB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                          | System.Windows.Forms.AnchorStyles.Right)));
     PWDTB.BackColor             = System.Drawing.Color.White;
     PWDTB.Font                  = new System.Drawing.Font("Tahoma", 11F);
     PWDTB.ForeColor             = System.Drawing.Color.DimGray;
     PWDTB.Image                 = global::Nerator.Properties.Resources.PasteSpecial;
     PWDTB.Location              = new System.Drawing.Point(6, 106);
     PWDTB.MaxLength             = 50;
     PWDTB.Multiline             = false;
     PWDTB.Name                  = "PWDTB";
     PWDTB.ReadOnly              = false;
     PWDTB.Size                  = new System.Drawing.Size(315, 41);
     PWDTB.TabIndex              = 6;
     PWDTB.Text                  = "Nerator";
     PWDTB.TextAlignment         = System.Windows.Forms.HorizontalAlignment.Center;
     PWDTB.UseSystemPasswordChar = false;
     //
     // PLPB
     //
     PLPB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                         | System.Windows.Forms.AnchorStyles.Right)));
     PLPB.Location = new System.Drawing.Point(10, 146);
     PLPB.Name     = "PLPB";
     PLPB.Size     = new System.Drawing.Size(307, 5);
     PLPB.Style    = ReaLTaiizor.Enum.Poison.ColorStyle.Green;
     PLPB.TabIndex = 12;
     PLPB.Theme    = ReaLTaiizor.Enum.Poison.ThemeStyle.Light;
     PLPB.Value    = 50;
     //
     // SSBR
     //
     SSBR.BaseColor    = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(222)))), ((int)(((byte)(222)))));
     SSBR.Dock         = System.Windows.Forms.DockStyle.Bottom;
     SSBR.Font         = new System.Drawing.Font("Segoe UI", 8F);
     SSBR.ForeColor    = System.Drawing.Color.White;
     SSBR.Location     = new System.Drawing.Point(0, 336);
     SSBR.Name         = "SSBR";
     SSBR.RectColor    = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(63)))), ((int)(((byte)(159)))));
     SSBR.ShowTimeDate = true;
     SSBR.Size         = new System.Drawing.Size(359, 22);
     SSBR.TabIndex     = 13;
     SSBR.Text         = "The application continues to run smoothly.";
     SSBR.TextColor    = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
     SSBR.TimeColor    = System.Drawing.Color.FromArgb(((int)(((byte)(54)))), ((int)(((byte)(54)))), ((int)(((byte)(54)))));
     SSBR.TimeFormat   = "HH:mm:ss";
     //
     // CEB
     //
     CEB.Anchor                  = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     CEB.AutoSizeMode            = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     CEB.Cursor                  = System.Windows.Forms.Cursors.Hand;
     CEB.Depth                   = 0;
     CEB.DrawShadows             = true;
     CEB.HighEmphasis            = true;
     CEB.Icon                    = global::Nerator.Properties.Resources.QuillInk;
     CEB.Location                = new System.Drawing.Point(6, 156);
     CEB.Margin                  = new System.Windows.Forms.Padding(4, 6, 4, 6);
     CEB.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     CEB.Name                    = "CEB";
     CEB.Size                    = new System.Drawing.Size(104, 36);
     CEB.TabIndex                = 14;
     CEB.Text                    = "CREATE";
     CEB.Type                    = ReaLTaiizor.Controls.MaterialButton.MaterialButtonType.Contained;
     CEB.UseAccentColor          = false;
     CEB.UseVisualStyleBackColor = true;
     CEB.Click                  += new System.EventHandler(CEB_Click);
     //
     // CYB
     //
     CYB.Anchor                  = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     CYB.AutoSizeMode            = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     CYB.Cursor                  = System.Windows.Forms.Cursors.Hand;
     CYB.Depth                   = 0;
     CYB.DrawShadows             = true;
     CYB.HighEmphasis            = true;
     CYB.Icon                    = global::Nerator.Properties.Resources.CopyClipboard;
     CYB.Location                = new System.Drawing.Point(234, 156);
     CYB.Margin                  = new System.Windows.Forms.Padding(4, 6, 4, 6);
     CYB.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     CYB.Name                    = "CYB";
     CYB.Size                    = new System.Drawing.Size(87, 36);
     CYB.TabIndex                = 15;
     CYB.Text                    = "COPY";
     CYB.Type                    = ReaLTaiizor.Controls.MaterialButton.MaterialButtonType.Contained;
     CYB.UseAccentColor          = false;
     CYB.UseVisualStyleBackColor = true;
     CYB.Click                  += new System.EventHandler(CYB_Click);
     //
     // MTC
     //
     MTC.Alignment = System.Windows.Forms.TabAlignment.Bottom;
     MTC.Controls.Add(Generate);
     MTC.Controls.Add(History);
     MTC.Controls.Add(Setting);
     MTC.Depth         = 0;
     MTC.ItemSize      = new System.Drawing.Size(44, 18);
     MTC.Location      = new System.Drawing.Point(12, 98);
     MTC.Margin        = new System.Windows.Forms.Padding(3, 0, 3, 3);
     MTC.MouseState    = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     MTC.Multiline     = true;
     MTC.Name          = "MTC";
     MTC.Padding       = new System.Drawing.Point(0, 0);
     MTC.SelectedIndex = 0;
     MTC.Size          = new System.Drawing.Size(335, 227);
     MTC.TabIndex      = 16;
     //
     // Generate
     //
     Generate.BackColor = System.Drawing.SystemColors.Control;
     Generate.Controls.Add(HYS);
     Generate.Controls.Add(CEB);
     Generate.Controls.Add(CYB);
     Generate.Controls.Add(PWDTB);
     Generate.Controls.Add(PLPB);
     Generate.Controls.Add(WRPB);
     Generate.Location = new System.Drawing.Point(4, 4);
     Generate.Name     = "Generate";
     Generate.Padding  = new System.Windows.Forms.Padding(3);
     Generate.Size     = new System.Drawing.Size(327, 201);
     Generate.TabIndex = 1;
     Generate.Text     = "Generate";
     //
     // HYS
     //
     HYS.Anchor                  = System.Windows.Forms.AnchorStyles.Bottom;
     HYS.AutoSize                = true;
     HYS.Checked                 = true;
     HYS.CheckState              = System.Windows.Forms.CheckState.Checked;
     HYS.Depth                   = 0;
     HYS.Location                = new System.Drawing.Point(117, 157);
     HYS.Margin                  = new System.Windows.Forms.Padding(0);
     HYS.MouseLocation           = new System.Drawing.Point(-1, -1);
     HYS.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     HYS.Name                    = "HYS";
     HYS.Ripple                  = true;
     HYS.Size                    = new System.Drawing.Size(108, 37);
     HYS.TabIndex                = 16;
     HYS.Text                    = "History";
     HYS.UseAccentColor          = true;
     HYS.UseVisualStyleBackColor = true;
     HYS.CheckedChanged         += new System.EventHandler(HYS_CheckedChanged);
     //
     // WRPB
     //
     WRPB.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)));
     WRPB.BackColor = System.Drawing.Color.Transparent;
     WRPB.Image     = global::Nerator.Properties.Resources.WaitRabbit;
     WRPB.Location  = new System.Drawing.Point(0, 0);
     WRPB.Margin    = new System.Windows.Forms.Padding(0);
     WRPB.Name      = "WRPB";
     WRPB.Size      = new System.Drawing.Size(327, 103);
     WRPB.SizeMode  = System.Windows.Forms.PictureBoxSizeMode.Zoom;
     WRPB.TabIndex  = 17;
     WRPB.TabStop   = false;
     //
     // History
     //
     History.BackColor = System.Drawing.SystemColors.Control;
     History.Controls.Add(HYP);
     History.Location = new System.Drawing.Point(4, 4);
     History.Name     = "History";
     History.Padding  = new System.Windows.Forms.Padding(3);
     History.Size     = new System.Drawing.Size(327, 201);
     History.TabIndex = 0;
     History.Text     = "History";
     //
     // HYP
     //
     HYP.AutoScroll = true;
     HYP.BackColor  = System.Drawing.Color.Transparent;
     HYP.Dock       = System.Windows.Forms.DockStyle.Fill;
     HYP.Location   = new System.Drawing.Point(3, 3);
     HYP.Margin     = new System.Windows.Forms.Padding(0);
     HYP.Name       = "HYP";
     HYP.Size       = new System.Drawing.Size(321, 195);
     HYP.TabIndex   = 0;
     //
     // Setting
     //
     Setting.BackColor = System.Drawing.SystemColors.Control;
     Setting.Controls.Add(PWLN);
     Setting.Controls.Add(DKUC);
     Setting.Controls.Add(LTUC);
     Setting.Controls.Add(TMCB);
     Setting.Controls.Add(SMCB);
     Setting.Controls.Add(AMCB);
     Setting.Controls.Add(RTPB);
     Setting.Location = new System.Drawing.Point(4, 4);
     Setting.Name     = "Setting";
     Setting.Padding  = new System.Windows.Forms.Padding(3);
     Setting.Size     = new System.Drawing.Size(327, 201);
     Setting.TabIndex = 2;
     Setting.Text     = "Setting";
     //
     // PWLN
     //
     PWLN.AlwaysValueVisible = true;
     PWLN.Anchor             = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     PWLN.BallonArrowColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
     PWLN.BallonColor      = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
     PWLN.BarColor         = System.Drawing.Color.FromArgb(((int)(((byte)(218)))), ((int)(((byte)(220)))), ((int)(((byte)(223)))));
     PWLN.BaseColor        = System.Drawing.SystemColors.Control;
     PWLN.Cursor           = System.Windows.Forms.Cursors.Hand;
     PWLN.FillBarColor     = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
     PWLN.Font             = new System.Drawing.Font("Segoe UI", 8F);
     PWLN.ForeColor        = System.Drawing.Color.White;
     PWLN.HeadBorderColor  = System.Drawing.Color.DodgerBlue;
     PWLN.HeadColor        = System.Drawing.Color.Black;
     PWLN.Location         = new System.Drawing.Point(6, 57);
     PWLN.MaxValue         = 50;
     PWLN.MinValue         = 0;
     PWLN.Name             = "PWLN";
     PWLN.ShowValue        = true;
     PWLN.Size             = new System.Drawing.Size(315, 45);
     PWLN.TabIndex         = 17;
     PWLN.Text             = "PWLN";
     PWLN.ThemeColor       = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
     TETT.SetToolTip(PWLN, "Password Length");
     PWLN.UnknownColor = System.Drawing.Color.White;
     PWLN.Value        = 15;
     //
     // DKUC
     //
     DKUC.Anchor      = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     DKUC.BackColor   = System.Drawing.Color.Transparent;
     DKUC.Location    = new System.Drawing.Point(218, 98);
     DKUC.Margin      = new System.Windows.Forms.Padding(5);
     DKUC.MaximumSize = new System.Drawing.Size(103, 97);
     DKUC.MinimumSize = new System.Drawing.Size(103, 97);
     DKUC.Name        = "DKUC";
     DKUC.Size        = new System.Drawing.Size(103, 97);
     DKUC.TabIndex    = 16;
     //
     // LTUC
     //
     LTUC.Anchor      = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     LTUC.BackColor   = System.Drawing.Color.Transparent;
     LTUC.Location    = new System.Drawing.Point(6, 98);
     LTUC.Margin      = new System.Windows.Forms.Padding(5);
     LTUC.MaximumSize = new System.Drawing.Size(103, 97);
     LTUC.MinimumSize = new System.Drawing.Size(103, 97);
     LTUC.Name        = "LTUC";
     LTUC.Size        = new System.Drawing.Size(103, 97);
     LTUC.TabIndex    = 15;
     //
     // TMCB
     //
     TMCB.Anchor                  = System.Windows.Forms.AnchorStyles.Bottom;
     TMCB.AutoSize                = true;
     TMCB.Checked                 = true;
     TMCB.CheckState              = System.Windows.Forms.CheckState.Checked;
     TMCB.Cursor                  = System.Windows.Forms.Cursors.Hand;
     TMCB.Depth                   = 0;
     TMCB.Location                = new System.Drawing.Point(110, 164);
     TMCB.Margin                  = new System.Windows.Forms.Padding(0);
     TMCB.MouseLocation           = new System.Drawing.Point(-1, -1);
     TMCB.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     TMCB.Name                    = "TMCB";
     TMCB.Ripple                  = true;
     TMCB.Size                    = new System.Drawing.Size(103, 37);
     TMCB.TabIndex                = 12;
     TMCB.Text                    = "Top Most";
     TMCB.UseVisualStyleBackColor = true;
     TMCB.CheckedChanged         += new System.EventHandler(TMCB_CheckedChanged);
     //
     // SMCB
     //
     SMCB.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     SMCB.AutoResize        = false;
     SMCB.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     SMCB.Cursor            = System.Windows.Forms.Cursors.Hand;
     SMCB.Depth             = 0;
     SMCB.DrawMode          = System.Windows.Forms.DrawMode.OwnerDrawVariable;
     SMCB.DropDownHeight    = 174;
     SMCB.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     SMCB.DropDownWidth     = 135;
     SMCB.Font              = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
     SMCB.ForeColor         = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     SMCB.FormattingEnabled = true;
     SMCB.Hint              = "Special Mode";
     SMCB.IntegralHeight    = false;
     SMCB.ItemHeight        = 43;
     SMCB.Items.AddRange(new object[] {
         "Mixed",
         "Symbol",
         "Number"
     });
     SMCB.Location              = new System.Drawing.Point(186, 6);
     SMCB.MaxDropDownItems      = 4;
     SMCB.MouseState            = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.OUT;
     SMCB.Name                  = "SMCB";
     SMCB.Size                  = new System.Drawing.Size(135, 49);
     SMCB.TabIndex              = 14;
     SMCB.SelectedIndexChanged += new System.EventHandler(SMCB_SelectedIndexChanged);
     //
     // AMCB
     //
     AMCB.AutoResize        = false;
     AMCB.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     AMCB.Cursor            = System.Windows.Forms.Cursors.Hand;
     AMCB.Depth             = 0;
     AMCB.DrawMode          = System.Windows.Forms.DrawMode.OwnerDrawVariable;
     AMCB.DropDownHeight    = 174;
     AMCB.DropDownStyle     = System.Windows.Forms.ComboBoxStyle.DropDownList;
     AMCB.DropDownWidth     = 135;
     AMCB.Font              = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
     AMCB.ForeColor         = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
     AMCB.FormattingEnabled = true;
     AMCB.Hint              = "Alphabetic Mode";
     AMCB.IntegralHeight    = false;
     AMCB.ItemHeight        = 43;
     AMCB.Items.AddRange(new object[] {
         "Mixed",
         "Uppercase",
         "Lowercase"
     });
     AMCB.Location              = new System.Drawing.Point(6, 6);
     AMCB.MaxDropDownItems      = 4;
     AMCB.MouseState            = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.OUT;
     AMCB.Name                  = "AMCB";
     AMCB.Size                  = new System.Drawing.Size(135, 49);
     AMCB.TabIndex              = 13;
     AMCB.SelectedIndexChanged += new System.EventHandler(AMCB_SelectedIndexChanged);
     //
     // RTPB
     //
     RTPB.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                         | System.Windows.Forms.AnchorStyles.Right)));
     RTPB.BackColor = System.Drawing.Color.Transparent;
     RTPB.Image     = global::Nerator.Properties.Resources.WhiteCat;
     RTPB.Location  = new System.Drawing.Point(0, 71);
     RTPB.Margin    = new System.Windows.Forms.Padding(0);
     RTPB.Name      = "RTPB";
     RTPB.Size      = new System.Drawing.Size(327, 93);
     RTPB.SizeMode  = System.Windows.Forms.PictureBoxSizeMode.Zoom;
     RTPB.TabIndex  = 5;
     RTPB.TabStop   = false;
     //
     // MTS
     //
     MTS.BaseTabControl = MTC;
     MTS.Cursor         = System.Windows.Forms.Cursors.Default;
     MTS.Depth          = 0;
     MTS.Font           = new System.Drawing.Font("Roboto", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
     MTS.HeadAlignment  = ReaLTaiizor.Controls.MaterialTabSelector.Alignment.Center;
     MTS.Location       = new System.Drawing.Point(12, 75);
     MTS.Margin         = new System.Windows.Forms.Padding(3, 3, 3, 0);
     MTS.MouseState     = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     MTS.Name           = "MTS";
     MTS.Size           = new System.Drawing.Size(335, 23);
     MTS.TabIndex       = 17;
     MTS.Text           = "materialTabSelector1";
     MTS.TitleTextState = ReaLTaiizor.Controls.MaterialTabSelector.TextState.Normal;
     //
     // STATUST
     //
     STATUST.Enabled  = true;
     STATUST.Interval = 1000;
     STATUST.Tick    += new System.EventHandler(STATUST_Tick);
     //
     // STATUSMT
     //
     STATUSMT.Enabled  = true;
     STATUSMT.Interval = 50;
     STATUSMT.Tick    += new System.EventHandler(STATUSMT_Tick);
     //
     // materialCheckBox1
     //
     materialCheckBox1.Depth                   = 0;
     materialCheckBox1.Location                = new System.Drawing.Point(0, 0);
     materialCheckBox1.Margin                  = new System.Windows.Forms.Padding(0);
     materialCheckBox1.MouseLocation           = new System.Drawing.Point(-1, -1);
     materialCheckBox1.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     materialCheckBox1.Name                    = "materialCheckBox1";
     materialCheckBox1.Ripple                  = true;
     materialCheckBox1.Size                    = new System.Drawing.Size(104, 37);
     materialCheckBox1.TabIndex                = 0;
     materialCheckBox1.Text                    = "materialCheckBox1";
     materialCheckBox1.UseVisualStyleBackColor = true;
     //
     // materialCheckBox2
     //
     materialCheckBox2.Depth                   = 0;
     materialCheckBox2.Location                = new System.Drawing.Point(0, 0);
     materialCheckBox2.Margin                  = new System.Windows.Forms.Padding(0);
     materialCheckBox2.MouseLocation           = new System.Drawing.Point(-1, -1);
     materialCheckBox2.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     materialCheckBox2.Name                    = "materialCheckBox2";
     materialCheckBox2.Ripple                  = true;
     materialCheckBox2.Size                    = new System.Drawing.Size(104, 37);
     materialCheckBox2.TabIndex                = 0;
     materialCheckBox2.Text                    = "materialCheckBox2";
     materialCheckBox2.UseVisualStyleBackColor = true;
     //
     // materialCheckBox3
     //
     materialCheckBox3.Depth                   = 0;
     materialCheckBox3.Location                = new System.Drawing.Point(0, 0);
     materialCheckBox3.Margin                  = new System.Windows.Forms.Padding(0);
     materialCheckBox3.MouseLocation           = new System.Drawing.Point(-1, -1);
     materialCheckBox3.MouseState              = ReaLTaiizor.Helper.MaterialDrawHelper.MaterialMouseState.HOVER;
     materialCheckBox3.Name                    = "materialCheckBox3";
     materialCheckBox3.Ripple                  = true;
     materialCheckBox3.Size                    = new System.Drawing.Size(104, 37);
     materialCheckBox3.TabIndex                = 0;
     materialCheckBox3.Text                    = "materialCheckBox3";
     materialCheckBox3.UseVisualStyleBackColor = true;
     //
     // TETT
     //
     TETT.BackColor      = System.Drawing.Color.White;
     TETT.BorderColor    = System.Drawing.Color.FromArgb(((int)(((byte)(204)))), ((int)(((byte)(204)))), ((int)(((byte)(204)))));
     TETT.ForeColor      = System.Drawing.Color.FromArgb(((int)(((byte)(170)))), ((int)(((byte)(170)))), ((int)(((byte)(170)))));
     TETT.IsDerivedStyle = true;
     TETT.OwnerDraw      = true;
     TETT.Style          = ReaLTaiizor.Enum.Metro.Style.Light;
     TETT.StyleManager   = null;
     TETT.ThemeAuthor    = "Taiizor";
     TETT.ThemeName      = "MetroLight";
     //
     // LIGHT
     //
     AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
     AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Dpi;
     ClientSize          = new System.Drawing.Size(359, 358);
     Controls.Add(SSBR);
     Controls.Add(MTS);
     Controls.Add(MTC);
     Controls.Add(LOPB);
     Controls.Add(TELE);
     Icon          = ((System.Drawing.Icon)(resources.GetObject("$Icon")));
     MaximizeBox   = false;
     MaximumSize   = new System.Drawing.Size(359, 358);
     MinimumSize   = new System.Drawing.Size(359, 358);
     Name          = "LIGHT";
     Sizable       = false;
     StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     Text          = "New Generation Password Generator";
     FormClosed   += new System.Windows.Forms.FormClosedEventHandler(LIGHT_FormClosed);
     ((System.ComponentModel.ISupportInitialize)(LOPB)).EndInit();
     MTC.ResumeLayout(false);
     Generate.ResumeLayout(false);
     Generate.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(WRPB)).EndInit();
     History.ResumeLayout(false);
     Setting.ResumeLayout(false);
     Setting.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(RTPB)).EndInit();
     ResumeLayout(false);
 }
Пример #56
0
        private void ChangeView(EFormView newformview)
        {
            if (CurrentFoemView == newformview)
            {
                return;
            }
            if (CurrentFoemView != EFormView.None)
            {
                if (CurrentUCView != null)
                {
                    Controls.Remove(CurrentUCView);
                }
            }

            UserControl newuc      = null;
            IEPGView    newepgview = null;

            switch (newformview)
            {
            case EFormView.None:
                CurrentFoemView = EFormView.None;
                return;

            case EFormView.EPG:
                newuc      = new UCEPGView();
                newepgview = newuc as IEPGView;
                break;

            case EFormView.EPGGrouped:
                newuc      = new UCEPGView2();
                newepgview = newuc as IEPGView;
                break;

            case EFormView.Scheduled:
                newuc      = new UCEPGView3();
                newepgview = newuc as IEPGView;
                break;

            case EFormView.EditGroups:
                newuc      = new UCEditGroups();
                newepgview = newuc as IEPGView;
                break;

            case EFormView.EditSources:
                newuc      = new UCSourceEditor();
                newepgview = newuc as IEPGView;
                break;

            case EFormView.Search:
                newuc      = new UCSearch();
                newepgview = newuc as IEPGView;
                break;

            case EFormView.TagedTitles:
                newuc      = new UCTagedTitles();
                newepgview = newuc as IEPGView;
                break;
            }

            CurrentUCView  = newuc;
            CurrentEPGView = newepgview;
            Controls.Add(CurrentUCView);
            CurrentUCView.Dock = DockStyle.Fill;
            CurrentUCView.BringToFront();
            CurrentEPGView.RefreshData();
            ApplyColorThemeA(newuc);
        }
Пример #57
0
        protected override void CreateChildControls()
        {
            string toolTipText = LocalizeString(ToolTipKey);

            if (string.IsNullOrEmpty(CssClass))
            {
                CssClass = "dnnLabel";
            }

            else if (!CssClass.Contains("dnnLabel"))
            {
                CssClass += " dnnLabel";
            }


            //var outerPanel = new Panel();
            //outerPanel.CssClass = "dnnLabel";
            //Controls.Add(outerPanel);

            var outerLabel = new System.Web.UI.HtmlControls.HtmlGenericControl {
                TagName = "label"
            };

            Controls.Add(outerLabel);

            var label = new Label {
                ID = "Label", Text = LocalizeString(ResourceKey)
            };

            if (RequiredField)
            {
                label.CssClass += " dnnFormRequired";
            }
            outerLabel.Controls.Add(label);

            var link = new LinkButton {
                ID = "Link", CssClass = "dnnFormHelp", TabIndex = -1
            };

            link.Attributes.Add("aria-label", "Help");
            Controls.Add(link);

            if (!String.IsNullOrEmpty(toolTipText))
            {
                //CssClass += "dnnLabel";

                var tooltipPanel = new Panel()
                {
                    CssClass = "dnnTooltip"
                };
                Controls.Add(tooltipPanel);

                var panel = new Panel {
                    ID = "Help", CssClass = "dnnFormHelpContent dnnClear"
                };
                tooltipPanel.Controls.Add(panel);

                var helpLabel = new Label {
                    ID = "Text", CssClass = "dnnHelpText", Text = LocalizeString(ToolTipKey)
                };
                panel.Controls.Add(helpLabel);

                var pinLink = new HyperLink {
                    CssClass = "pinHelp"
                };
                pinLink.Attributes.Add("href", "#");
                pinLink.Attributes.Add("aria-label", "Pin");
                panel.Controls.Add(pinLink);

                JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn);
                JavaScript.RequestRegistration(CommonJs.DnnPlugins);
                //ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Scripts/initTooltips.js");
            }
        }
Пример #58
0
 private void InitializeComponent()
 {
     listBox1  = new ListBox();
     button3   = new Button();
     button2   = new Button();
     button1   = new Button();
     textBox1  = new TextBox();
     textBox2  = new TextBox();
     groupBox1 = new GroupBox();
     textBox3  = new TextBox();
     label1    = new Label();
     groupBox1.SuspendLayout();
     SuspendLayout();
     listBox1.FormattingEnabled = true;
     listBox1.Location          = new Point(8, 70);
     listBox1.Name                  = "listBox1";
     listBox1.Size                  = new Size(199, 407);
     listBox1.TabIndex              = 0;
     listBox1.SelectedIndexChanged += new EventHandler(listBox1_SelectedIndexChanged);
     button3.Location               = new Point(157, 488);
     button3.Name     = "button3";
     button3.Size     = new Size(52, 23);
     button3.TabIndex = 7;
     button3.Text     = "Close";
     button3.UseVisualStyleBackColor = true;
     button3.Click                  += new EventHandler(button3_Click);
     button2.DialogResult            = DialogResult.OK;
     button2.Location                = new Point(85, 488);
     button2.Name                    = "button2";
     button2.Size                    = new Size(52, 23);
     button2.TabIndex                = 6;
     button2.Text                    = "No Opt";
     button2.UseVisualStyleBackColor = true;
     button2.Click                  += new EventHandler(button2_Click);
     button1.DialogResult            = DialogResult.OK;
     button1.Location                = new Point(15, 488);
     button1.Name                    = "button1";
     button1.Size                    = new Size(52, 23);
     button1.TabIndex                = 5;
     button1.Text                    = "Pick";
     button1.UseVisualStyleBackColor = true;
     button1.Click                  += new EventHandler(button1_Click);
     textBox1.Location               = new Point(217, 100);
     textBox1.Name                   = "textBox1";
     textBox1.Size                   = new Size(100, 20);
     textBox1.TabIndex               = 8;
     textBox2.Location               = new Point(217, 126);
     textBox2.Name                   = "textBox2";
     textBox2.Size                   = new Size(100, 20);
     textBox2.TabIndex               = 9;
     textBox2.Text                   = "-1";
     groupBox1.Controls.Add((Control)label1);
     groupBox1.Controls.Add((Control)textBox3);
     groupBox1.Location    = new Point(8, 12);
     groupBox1.Name        = "groupBox1";
     groupBox1.Size        = new Size(195, 50);
     groupBox1.TabIndex    = 10;
     groupBox1.TabStop     = false;
     groupBox1.Text        = "Search";
     textBox3.BorderStyle  = BorderStyle.FixedSingle;
     textBox3.Location     = new Point(43, 19);
     textBox3.Name         = "textBox3";
     textBox3.Size         = new Size(146, 20);
     textBox3.TabIndex     = 0;
     textBox3.TextChanged += new EventHandler(textBox3_TextChanged);
     label1.AutoSize       = true;
     label1.Location       = new Point(6, 24);
     label1.Name           = "label1";
     label1.Size           = new Size(31, 13);
     label1.TabIndex       = 1;
     label1.Text           = "Text:";
     AutoScaleDimensions   = new SizeF(6f, 13f);
     AutoScaleMode         = AutoScaleMode.Font;
     ClientSize            = new Size(215, 522);
     Controls.Add((Control)groupBox1);
     Controls.Add((Control)textBox2);
     Controls.Add((Control)textBox1);
     Controls.Add((Control)button3);
     Controls.Add((Control)button2);
     Controls.Add((Control)button1);
     Controls.Add((Control)listBox1);
     FormBorderStyle = FormBorderStyle.FixedToolWindow;
     MaximizeBox     = false;
     MinimizeBox     = false;
     Name            = "RareOptSearch";
     Text            = "Rare Option";
     Load           += new EventHandler(Form4_Load);
     groupBox1.ResumeLayout(false);
     groupBox1.PerformLayout();
     ResumeLayout(false);
     PerformLayout();
 }
Пример #59
0
        public MyForm()
        {
            TableLayoutPanel table = new TableLayoutPanel
            {
                RowCount    = 5,
                ColumnCount = 2,
                Dock        = DockStyle.Fill
            };

            Controls.Add(table);

            Label countryLabel = new Label
            {
                Text      = "Country",
                TextAlign = ContentAlignment.MiddleRight
            };

            table.Controls.Add(countryLabel);

            TextBox countryTextBox = new TextBox
            {
                Dock = DockStyle.Fill
            };

            table.Controls.Add(countryTextBox);

            Label ageLabel = new Label
            {
                Text      = "Age",
                TextAlign = ContentAlignment.MiddleRight
            };

            table.Controls.Add(ageLabel);

            NumericUpDown ageBox = new NumericUpDown {
                Dock = DockStyle.Fill
            };

            table.Controls.Add(ageBox);

            Label timesLabel = new Label
            {
                Text      = "Times elected",
                TextAlign = ContentAlignment.MiddleRight
            };

            table.Controls.Add(timesLabel);

            NumericUpDown timesBox = new NumericUpDown {
                Dock = DockStyle.Fill
            };

            table.Controls.Add(timesBox);

            Label worldLabel = new Label
            {
                Text      = "Saved the world",
                TextAlign = ContentAlignment.MiddleRight
            };

            table.Controls.Add(worldLabel);

            CheckBox worldBox = new CheckBox {
                Checked = true
            };

            table.Controls.Add(worldBox);

            Button presidentButton = new Button
            {
                Text = "Can I Be President?",
                Dock = DockStyle.Top
            };

            table.Controls.Add(presidentButton);
            table.SetColumnSpan(presidentButton, 2);
        }
        private void InitializeComponent()
        {
            _cancelButton    = new Button();
            _checkedListBox  = new CheckedListBox();
            _okButton        = new Button();
            _addFileButton   = new Button();
            _addFolderButton = new Button();
            SuspendLayout();

            _cancelButton.Anchor                  = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
            _cancelButton.DialogResult            = DialogResult.Cancel;
            _cancelButton.Location                = new Point(344, 330);
            _cancelButton.Name                    = "cancelButton";
            _cancelButton.Size                    = new Size(75, 23);
            _cancelButton.TabIndex                = 4;
            _cancelButton.Text                    = global::QuickSharp.CodeAssist.DotNet.Resources.ReferencesFormCancel;
            _cancelButton.UseVisualStyleBackColor = true;

            _checkedListBox.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
                                                       | AnchorStyles.Left)
                                                      | AnchorStyles.Right)));
            _checkedListBox.CheckOnClick        = true;
            _checkedListBox.HorizontalScrollbar = true;
            _checkedListBox.IntegralHeight      = false;
            _checkedListBox.Location            = new Point(12, 12);
            _checkedListBox.Name     = "checkedListBox";
            _checkedListBox.Size     = new Size(407, 308);
            _checkedListBox.Sorted   = true;
            _checkedListBox.TabIndex = 0;

            _okButton.Anchor                  = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
            _okButton.DialogResult            = DialogResult.OK;
            _okButton.Location                = new Point(263, 330);
            _okButton.Name                    = "okButton";
            _okButton.Size                    = new Size(75, 23);
            _okButton.TabIndex                = 3;
            _okButton.Text                    = QuickSharp.CodeAssist.DotNet.Resources.ReferencesFormOK;
            _okButton.UseVisualStyleBackColor = true;
            _okButton.Click                  += new EventHandler(OkButton_Click);

            _addFileButton.Anchor   = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left)));
            _addFileButton.Location = new Point(12, 330);
            _addFileButton.Name     = "addFileButton";
            _addFileButton.Size     = new Size(75, 23);
            _addFileButton.TabIndex = 1;
            _addFileButton.Text     = QuickSharp.CodeAssist.DotNet.Resources.ReferencesFormAddFile;
            _addFileButton.UseVisualStyleBackColor = true;
            _addFileButton.Click += new EventHandler(AddFileButton_Click);

            _addFolderButton.Anchor   = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Left)));
            _addFolderButton.Location = new Point(93, 330);
            _addFolderButton.Name     = "addFolderButton";
            _addFolderButton.Size     = new Size(92, 23);
            _addFolderButton.TabIndex = 2;
            _addFolderButton.Text     = QuickSharp.CodeAssist.DotNet.Resources.ReferencesFormAddFolder;
            _addFolderButton.UseVisualStyleBackColor = true;
            _addFolderButton.Click += new EventHandler(AddFolderButton_Click);

            AcceptButton        = _okButton;
            AutoScaleDimensions = new SizeF(6F, 13F);
            AutoScaleMode       = AutoScaleMode.Font;
            CancelButton        = _cancelButton;
            ClientSize          = new Size(431, 365);
            Controls.Add(_addFolderButton);
            Controls.Add(_addFileButton);
            Controls.Add(_okButton);
            Controls.Add(_checkedListBox);
            Controls.Add(_cancelButton);
            Font          = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            MinimizeBox   = false;
            MinimumSize   = new Size(400, 200);
            Name          = "ManageReferenceDatabaseForm";
            ShowIcon      = false;
            ShowInTaskbar = false;
            StartPosition = FormStartPosition.CenterParent;
            Text          = Resources.ReferencesFormTitle;
            ResumeLayout(false);
        }