private void Form1_FormClosing(object sender, FormClosingEventArgs e) { _lL.Dispose(); if (_dataAccess != null) { _dataAccess.Dispose(); } this.SetWindowsPostion(); }
public void Dispose() { _defaultFont?.Dispose(); _boldFont?.Dispose(); List?.Dispose(); ListLabel?.Dispose(); Tree?.Dispose(); TreeLabel?.Dispose(); Form?.Dispose(); }
private void LLAction(string action) { if (ensureService()) { ListLabel LL = new ListLabel(); OpenEdgeDataProvider Provider = new OpenEdgeDataProvider(); Provider.ServiceAdapter = OpenEdgeServiceAdapter; Provider.ServiceName = Config.ServiceName; Provider.Initialize(); LL.DataSource = Provider; try { if (action == "Design") { if (Config.DesignerPreviewMaxRows > 0) { Provider.MaxRows = Config.DesignerPreviewMaxRows; } LL.Design(); } else { LL.Print(); } } catch (ListLabelException ex) { MessageBox.Show(ex.Message); } finally { Provider.Dispose(); LL.Dispose(); } } else { MessageBox.Show("No connection available"); } }
private void LLAction(string action) { var param = new RestConnectionParameter(); param.RestURL = Properties.Settings.Default.RestURL; param.Userid = Properties.Settings.Default.Userid; param.Password = Properties.Settings.Default.Password; var ll = new ListLabel(); var dp = new OpenEdgeDataProvider(); dp.ServiceAdapter = new RestServiceAdapter(param); dp.ServiceName = Properties.Settings.Default.ServiceName; dp.Initialize(); ll.DataSource = dp; try { if (action == "DESIGN") { if (Properties.Settings.Default.DesignerPreviewMaxRows > 0) { dp.MaxRows = Properties.Settings.Default.DesignerPreviewMaxRows; } ll.Design(); } else if (action == "PRINT") { ll.Print(); } else { } } catch (ListLabelException e) { MessageBox.Show(e.Message); } ll.Dispose(); dp.Dispose(); }
private void button1_Click(object sender, EventArgs e) { ListLabel LL = new ListLabel(); OpenEdgeDataProvider dp = new OpenEdgeDataProvider(); ServiceAdapter s = new ServiceAdapter(_schema); try { dp.ServiceName = TextServiceName.Text; dp.ServiceAdapter = s; dp.Initialize(); if (TableCombo.Text != "<none>") { LL.DataMember = TableCombo.Text; if (AutoMasterModeNone.Checked) { LL.AutoMasterMode = LlAutoMasterMode.None; } if (AutomasterModeAsVariables.Checked) { LL.AutoMasterMode = LlAutoMasterMode.AsVariables; } if (AutoMasterModeAsFields.Checked) { LL.AutoMasterMode = LlAutoMasterMode.AsFields; } } LL.DataSource = dp; LL.Design(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } LL.Dispose(); }