protected void OnAppRightClick(ref ContextMenuInfo eventInfo, out bool BubbleEvent) { BubbleEvent = true; try { if (eventInfo.BeforeAction) { if (_modalForm != null && _modalForm.FormID != eventInfo.FormUID) { BubbleEvent = false; return; } } IB1Form theForm = null; if (_forms.TryGetValue(eventInfo.FormUID, out theForm)) { theForm.OnRightClickEvent(ref eventInfo, out BubbleEvent); } } catch (Exception ex) { var handled = _errorHandler.HandleException(ex); if (!handled) { Exit(); } } }
protected void OnFormUnloadAfter(string formID, ItemEvent pVal) { IB1Form theForm = null; if (_forms.TryGetValue(formID, out theForm)) { _forms.Remove(formID); theForm.Dispose(); theForm = null; } }
protected void OnAppFormDataEvent(ref BusinessObjectInfo BusinessObjectInfo, out bool BubbleEvent) { BubbleEvent = true; try { IB1Form theForm = null; if (_forms.TryGetValue(BusinessObjectInfo.FormUID, out theForm)) { theForm.OnFormDataEvent(ref BusinessObjectInfo, out BubbleEvent); } } catch (Exception ex) { var handled = _errorHandler.HandleException(ex); if (!handled) { Exit(); } } }
internal void AddForm(IB1Form form) { _forms.Add(form.FormID, form); }
protected void OnAppItemEvent(string FormUID, ref ItemEvent pVal, out bool BubbleEvent) { BubbleEvent = true; try { if (_modalForm != null && _modalForm.FormID != FormUID) { var runInModal = true; switch (pVal.EventType) { case BoEventTypes.et_FORM_LOAD: case BoEventTypes.et_FORM_DRAW: case BoEventTypes.et_FORM_UNLOAD: case BoEventTypes.et_FORM_VISIBLE: case BoEventTypes.et_FORM_DEACTIVATE: case BoEventTypes.et_CHOOSE_FROM_LIST: runInModal = false; break; } switch (pVal.FormTypeEx) { case "0": //MESSAGE BOX case "10000075": //CALENDARIO case "10000076": //CALCULADORA runInModal = false; break; } if (runInModal) { if (pVal.BeforeAction) { BubbleEvent = false; } else { _modalForm.Select(); } return; } } if (pVal.EventType == BoEventTypes.et_FORM_LOAD && pVal.BeforeAction) { OnFormLoadBefore(FormUID, pVal); } IB1Form theForm = null; if (_forms.TryGetValue(FormUID, out theForm)) { if ((pVal.EventType == BoEventTypes.et_FORM_ACTIVATE || pVal.EventType == BoEventTypes.et_FORM_LOAD) && !pVal.BeforeAction && theForm.IsModal) { _modalForm = theForm; } theForm.OnItemEvent(FormUID, ref pVal, out BubbleEvent); if (pVal.EventType == BoEventTypes.et_FORM_CLOSE && pVal.BeforeAction && FormUID == theForm.FormID) { _modalForm = null; } } if (pVal.EventType == BoEventTypes.et_FORM_UNLOAD && !pVal.BeforeAction) { OnFormUnloadAfter(FormUID, pVal); } } catch (Exception ex) { var handled = _errorHandler.HandleException(ex); if (!handled) { Exit(); } else { if (pVal.BeforeAction) { BubbleEvent = false; } } } }
protected void OnAppMenuEvent(ref MenuEvent pVal, out bool BubbleEvent) { BubbleEvent = true; try { Form activeForm = null; try { activeForm = _sboApplication.Forms.ActiveForm; } catch (COMException) { activeForm = null; } if (pVal.BeforeAction && activeForm != null) { if (_modalForm != null && _modalForm.FormID != activeForm.UniqueID) { var runInModal = true; switch (pVal.MenuUID) { case "1292": case "1293": case "1299": case "1294": case "1281": case "1282": case "1288": case "1289": case "1290": case "1291": case "1283": case "1284": case "1285": case "1286": case "1287": runInModal = false; break; } if (runInModal) { BubbleEvent = false; _modalForm.Select(); return; } } } IB1Form theForm = null; if (activeForm != null && _forms.TryGetValue(activeForm.UniqueID, out theForm)) { theForm.OnMenuEvent(ref pVal, out BubbleEvent); } if (!pVal.BeforeAction) { var userForm = _userForms.TryResolve <IB1Form>(pVal.MenuUID); if (userForm != null) { userForm.Show(); } } } catch (Exception ex) { var handled = _errorHandler.HandleException(ex); if (!handled) { Exit(); } } }