public PropertyCmdView(PropertyCall propertyCall, bool isNew) { InitializeComponent(); if (isNew) { this.Text = Rekod.Properties.Resources.CMD_NewProgram; } else { this.Text = Rekod.Properties.Resources.CMD_SettingsProgram; } if (propertyCall == null) { return; } _propertyCall = propertyCall; this.txtIcon.Text = _propertyCall.Icon; this.txtFile.Text = _propertyCall.File; this.txtTitle.Text = _propertyCall.Title; this.txtParams.Text = _propertyCall.Params; this.pIcon.BackgroundImage = IconModule.GetIcon(txtIcon.Text, txtFile.Text).ToBitmap(); }
private void btnFile_Click(object sender, EventArgs e) { var dial = new OpenFileDialog(); if (dial.ShowDialog() != DialogResult.OK) { return; } txtFile.Text = GetRelativePath(dial.FileName); this.pIcon.BackgroundImage = IconModule.GetIcon(txtIcon.Text, txtFile.Text).ToBitmap(); }
private void AddConrolPanelTools(ICollection <PropertyCall> listPropertyCall) { if (listPropertyCall == null) { return; } var toolBar = Program.BManager.FindToolBar("TbFastStart"); toolBar.ListButton.Clear(); _listToolStripItem.Clear(); foreach (var item in listPropertyCall.Reverse()) { Icon icon = IconModule.GetIcon(item.Icon, item.File); ToolButton_VM button = new ToolButton_VM(toolBar, item.Title, ToolButton_Click); button.Image = (icon != null) ? icon.ToBitmap() : null; toolBar.ListButton.Add(button); _listToolStripItem.Add(button, item); } }