private void btnAttach1_CheckedChanged(object sender, EventArgs e) { if (!File.Exists(FullFileName)) { return; } if (frmAttach1.IsDisposed) { frmAttach1 = new FormAttachment(); } if (btnAttch1.CheckState == CheckState.Checked) { frmAttach1.workpath = DirectoryCore.Get_AttachmentsDirectory(FullFileName); //frmAttach1.label1.Text = Path.GetFileName(fileListView1.selfilename) + " 的附件"; frmAttach1.TopLevel = false; frmAttach1.Bounds = htmEdit1.Bounds; frmAttach1.Parent = this;// frmAttach1.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); frmAttach1.Show(); } else { frmAttach1.Close(); } //updateAttachTitle(); htmEdit1.Visible = !btnAttch1.Checked; btnReadMode1.Enabled = !btnAttch1.Checked; winTextBox1.ReadOnly = btnAttch1.Checked; }
public FormMain() { InitializeComponent(); //显示树窗口 frTree = new FormTreeLeft(); frTree.formParent = this; frTree.Show(dockPanel1); //显示附件窗口 Attachment.ActiveNodeId = "-1"; FormAttachment frmAttchment = new FormAttachment(); Attachment.AttForm = frmAttchment; frmAttchment.Show(dockPanel1); }
private void btnAddAttachment_Click(object sender, EventArgs e) { try { FormAttachment frm = new FormAttachment(this.connectionId, this.bugId, true); frm.ShowDialog(); Attachment newAtt = frm.NewAttachment; if (newAtt != null) { bugToUpdate.Attachments.Add(newAtt); GetBugDetailsAndSetControls(this.bugId, false); } } catch (Exception ex) { MyLogger.Write(ex, "btnAddAttachment_Click", LoggingCategory.Exception); MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnAddAttachment_Click(object sender, EventArgs e) { // not allowed many attachments for Bugzilla 3.0 // get the version of this connection MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance(); string version = _appSettings.GetConnectionById(this.connectionId).Version; int versionINT = int.Parse(version.Substring(0, version.IndexOf("."))); if (versionINT >= 3 && addedBug.Attachments.Count == 1) { MessageBox.Show(this, string.Format(Messages.MsgAttNotAllowed, Environment.NewLine), Messages.Info, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { FormAttachment frm = new FormAttachment(this.connectionId, -1, false); frm.ShowDialog(); Attachment newAtt = frm.NewAttachment; if (newAtt != null) { addedBug.Attachments.Add(newAtt); PopulateAttachmentList(); } } }