public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IWindowsFormsEditorService service = null; if (((context != null) && (context.Instance != null)) && (provider != null)) { service = (IWindowsFormsEditorService) provider.GetService(typeof(IWindowsFormsEditorService)); if (service != null) { FormPermission instance = (FormPermission) context.Instance; DataFormPermissionSettingForm dialog = new DataFormPermissionSettingForm(); dialog.FormPermission = instance; if ((service.ShowDialog(dialog) == DialogResult.OK) && (dialog.FormPermission != null)) { return dialog.FormPermission.DaoDataFormName; } } } return value; }
private void propertyGrid_HelpRequested(object sender, HelpEventArgs hlpevent) { if (LoggingService.IsDebugEnabled) { LoggingService.DebugFormatted("propertyGrid_DoubleClick-'{0}'", new object[] { this.propertyGrid.SelectedGridItem.PropertyDescriptor.Name }); } Actdef selectedObject = this.propertyGrid.SelectedObject as Actdef; string name = this.propertyGrid.SelectedGridItem.PropertyDescriptor.Name; if (name != null) { if (!(name == "SubflowProdefName")) { if (name == "ParticipantName") { fSelectParticipant participant = new fSelectParticipant(); participant.ParticipantID = selectedObject.ParticipantId; participant.ShowDialog(this); if ((participant.ParticipantID != null) && (participant.ParticipantName != null)) { selectedObject.ParticipantId = participant.ParticipantID; selectedObject.ParticipantName = participant.ParticipantName; this.mProDefDoc.CurrentUnitOfWork.RegisterDirty(selectedObject); } } else if (name == "ApplicationName") { fSelectApplication application = new fSelectApplication(); application.ApplicationID = selectedObject.ApplicationId; application.ShowDialog(this); if ((application.ApplicationID != null) && (application.ApplicationName != null)) { selectedObject.ApplicationId = application.ApplicationID; selectedObject.ApplicationName = application.ApplicationName; this.mProDefDoc.CurrentUnitOfWork.RegisterDirty(selectedObject); } } else if (name == "ActdefFormPermission") { bool flag = false; if (selectedObject.ActdefFormPermission == null) { selectedObject.ActdefFormPermission = new WfActdefFormPermission(selectedObject); flag = true; } if (selectedObject.ActdefFormPermission != null) { DataFormPermissionSettingForm form = new DataFormPermissionSettingForm(); form.FormPermission = selectedObject.ActdefFormPermission; if (form.ShowDialog() == DialogResult.OK) { if ((form.FormPermission == null) && !flag) { this.mProDefDoc.CurrentUnitOfWork.RegisterRemoved(selectedObject.ActdefFormPermission); } selectedObject.ActdefFormPermission = form.FormPermission as WfActdefFormPermission; if (flag && (selectedObject.ActdefFormPermission != null)) { this.mProDefDoc.CurrentUnitOfWork.RegisterNew(selectedObject.ActdefFormPermission); } else if (selectedObject.ActdefFormPermission != null) { this.mProDefDoc.CurrentUnitOfWork.RegisterDirty(selectedObject.ActdefFormPermission); } } else if (flag) { selectedObject.ActdefFormPermission = null; } form.Close(); } } } else { fSelectSubflow subflow = new fSelectSubflow(); subflow.SubFlowProdefID = selectedObject.SubflowProdefId; subflow.ShowDialog(this); if ((subflow.SubFlowProdefID != null) && (subflow.SubFlowProdefName != null)) { selectedObject.SubflowProdefId = subflow.SubFlowProdefID; selectedObject.SubflowProdefName = subflow.SubFlowProdefName; this.mProDefDoc.CurrentUnitOfWork.RegisterDirty(selectedObject); } } } }