private void lnkTemplateOptions_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { if (cmbTemplate.SelectedItem != null) { var templateItem = (SupportedPluginComponent)cmbTemplate.SelectedItem; if (PluginsManager.ShowTemplateOptions(templateItem)) { OnSettingsUpdate?.Invoke(this, new EventArgs()); OnControlUpdate?.Invoke(this, new EventArgs()); UpdateFileName(); } } EnableButtons(); } catch (Exception ex) { MessageBoxHelper.ProcessException(ex); } }
public void update() { NetworkStream stream = m_client.GetStream(); //network stream object to receive data while (true) { string jsonString = serializer.Serialize(Controlsdata); // string we want to send byte[] rawData = Encoding.ASCII.GetBytes(jsonString); //convert jsonString to bytes stream.Write(rawData, 0, rawData.Length); OnControlUpdate?.Invoke(Controlsdata); Thread.Sleep(120); } }
private void btnGenerateScript_Click(object sender, EventArgs e) { try { if (ValidateForm()) { string tableName = (string)cmbDatabaseEntity.SelectedItem; DatabaseEntity entity; if (!_entities.TryGetValue(tableName, out entity)) { entity = PluginsManager.GetEntityInfoFromPlugin(Project.Controller, tableName); _entities[tableName] = entity; } var component = (GeneratorComponent)cmbComponent.SelectedItem; var code = ActiveTemplate.Generate(entity, component); if (!string.IsNullOrWhiteSpace(code)) { txtGeneratedCode.Text = code; ProjectsController.SaveCodeToProject(ActiveTemplate, component, Project, tableName, code, txtFileName.Text); OnControlUpdate?.Invoke(this, new EventArgs()); if (chkCopyToClipboard.Checked) { txtGeneratedCode.SelectAll(); txtGeneratedCode.Copy(); MessageBox.Show("Copied to Clipboard", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } EnableButtons(); } catch (Exception ex) { MessageBoxHelper.ProcessException(ex); } }
public void UnSubscribe(OnControlUpdate _controlUpdate) { ControlUpdate -= _controlUpdate; }
public void Subscribe(OnControlUpdate _controlUpdate) { ControlUpdate += _controlUpdate; }