private void StartForm(FormFetchEventArgs e) { currentFormId = e.Info.RequestInfo.CompilationRequestId; FieldFactory.Types = e.Types; WorkflowManager wm = null; try { wm = new WorkflowManager(e.Info, e.WorkflowNodes, e.WorkflowEdges, e.Types, e.Presentation, e.Data); formScreen = new FormScreen(wm, configuration.Configuration.SaveOnLowBattery); formScreen.FillingFinished += OnFormFillingFinished; formScreen.BatteryLevelNotification += OnBatteryLevelNotification; formScreen.Closed += OnFormScreenClosed; if (recentScreen != null) { recentScreen.Hide(); } if (loginScreen != null) { loginScreen.Hide(); } formScreen.Text = e.Info.Name; //formScreen.ChangeOrientation(SystemSettings.ScreenOrientation); formScreen.Show(); } catch (WorkflowException w) { NotificationHelper.ShowNotification(ExceptionManager.Error, w.Message); } }
public void CreateForm(object sender, FormFetchEventArgs args) { FieldsManager fm = new FieldsManager(args.Types); new FormView(comManager, this, fm, new WorkflowManager(fm, args.WorkflowNodes, args.WorkflowEdges, args.Types), args.WorkflowNodes.ChildNodes[1].ChildNodes.Count).Show(); }
private void OnFormFetched(object source, FormFetchEventArgs args) { if (args.Result == CommunicationResult.Success) { Invoke(new EventHandler <FormFetchEventArgs>(CreateForm), source, args); } else { //Show Error } }
private void OnDataSetFetched(object sender, FormFetchEventArgs e) { Invoke(new Action(delegate() { Cursor.Current = Cursors.Default; if (formScreen != null) { formScreen.EnableButtons(true); } if (e.Result == CommunicationResult.Success) { if (UpdateRecentForms()) { warningButton.Visible = true; } else { warningButton.Visible = false; } StartForm(e); if (loginScreen != null) { loginScreen.DataSubmitted -= OnLoginDataSubmitted; loginScreen.CancelConnection -= OnConnectionCanceled; loginScreen.Close(); } } else { NotificationHelper.ShowNotification(ExceptionManager.Error, e.Message, 10, OnNotificationMessageChanged); } communicationManager.IsFetching = false; })); }