private void hyperLinkEdit1_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.CustomDisplayTextEventArgs e) { if (hyperLinkEdit1.EditValue != null) { if (!string.IsNullOrEmpty(hyperLinkEdit1.EditValue.ToString())) { NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy(); DirectoryInfo i = p.CreateUncFolderFinfo(hyperLinkEdit1.EditValue.ToString()); if (i != null) { e.DisplayText = i.Name; } } } }
private void cmdOk_Click(object sender, EventArgs e) { try { //se non esiste un file da allegare if (hyperLinkEdit2.EditValue != null) { if (string.IsNullOrEmpty(hyperLinkEdit2.EditValue.ToString())) { XtraMessageBox.Show("Inserire un nome file corretto", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy(); FileInfo f = p.CretateUncFileFinfo(hyperLinkEdit2.EditValue.ToString()); if (f == null) { XtraMessageBox.Show("File inesistente", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } //se non eseguo alcuna azione sul file if (((int)(radioGroup1.EditValue)) == 3) { _createdFileName = hyperLinkEdit2.EditValue.ToString(); this.DialogResult = DialogResult.OK; this.Close(); return; } //se non esiste il percorso di destinazione if (hyperLinkEdit1.EditValue != null) { if (string.IsNullOrEmpty(hyperLinkEdit1.EditValue.ToString())) { XtraMessageBox.Show("Impostare un percorso di destinazione corretto", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy(); DirectoryInfo f = p.CreateUncFolderFinfo(hyperLinkEdit1.EditValue.ToString()); if (f == null) { XtraMessageBox.Show("Directory inesistente", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } if (IsFileMovedOrCopied()) { this.DialogResult = DialogResult.OK; } else { this.DialogResult = DialogResult.Cancel; } this.Close(); } catch (Exception ex) { ErrorHandler.Show(ex); } }