public RunTimeView(IEnterInterpreterHost pEnterClientInterface, Epi.View pView, int pParentRecordId, string pParentGlobalRecordId, IScope pScope = null) { // to do set the enter interpreter // application domain. Assembly a = Assembly.Load(pView.Project.EnterMakeviewIntepreter); // Get the type to use. Type myType = a.GetType(pView.Project.EnterMakeviewIntepreter + ".EpiInterpreterParser"); // Create an instance. if (pScope == null) { this.mEpiInterpreter = (IEnterInterpreter)Activator.CreateInstance(myType, new object[] { pEnterClientInterface }); } else { this.mEpiInterpreter = (IEnterInterpreter)Activator.CreateInstance(myType, new object[] { pEnterClientInterface, pScope }); } this.mEpiInterpreter.Context.Scope.Name = pView.Name; this.mEpiInterpreter.Host = pEnterClientInterface; this.EnterClientInterface = pEnterClientInterface; this.AfterStack = new Stack <KeyValuePair <EventActionEnum, StackCommand> >(); this.parentViewRecordId = pParentRecordId; this.parentViewGlobalRecordId = pParentGlobalRecordId; this.RecordNumberMap = new Dictionary <int, int>(); this.mView = pView; this.mView.ForeignKeyField.CurrentRecordValueString = this.ParentGlobalRecordId; }
public RunTimeView(IEnterInterpreterHost pEnterClientInterface, Epi.View pView, int pParentRecordId, string pParentGlobalRecordId, IScope pScope = null) { // to do set the enter interpreter // application domain. Assembly a = Assembly.Load(pView.Project.EnterMakeviewIntepreter); // Get the type to use. Type myType = a.GetType(pView.Project.EnterMakeviewIntepreter + ".EpiInterpreterParser"); // Create an instance. if (pScope == null) { this.mEpiInterpreter = (IEnterInterpreter)Activator.CreateInstance(myType, new object[] { pEnterClientInterface }); } else { this.mEpiInterpreter = (IEnterInterpreter)Activator.CreateInstance(myType, new object[] { pEnterClientInterface, pScope }); } this.mEpiInterpreter.Context.Scope.Name = pView.Name; this.mEpiInterpreter.Host = pEnterClientInterface; this.EnterClientInterface = pEnterClientInterface; this.AfterStack = new Stack<KeyValuePair<EventActionEnum, StackCommand>>(); this.parentViewRecordId = pParentRecordId; this.parentViewGlobalRecordId = pParentGlobalRecordId; this.RecordNumberMap = new Dictionary<int, int>(); this.mView = pView; this.mView.ForeignKeyField.CurrentRecordValueString = this.ParentGlobalRecordId; }
public SocialNetworkGraph(Epi.View view, Epi.Data.IDbDriver db) { InitializeComponent(); this.db = db; this.view = view; this.Loaded += new RoutedEventHandler(SocialNetworkGraph_Loaded); grdMain.SizeChanged += new SizeChangedEventHandler(grdMain_SizeChanged); }
public LayerList(ESRI.ArcGIS.Client.Map myMap, Epi.View view, Epi.Data.IDbDriver db, DashboardHelper dashboardHelper) { InitializeComponent(); this.myMap = myMap; this.view = view; this.db = db; this.dashboardHelper = dashboardHelper; }
public LayerList(ESRI.ArcGIS.Client.Map myMap, Epi.View view, Epi.Data.IDbDriver db, DashboardHelper dashboardHelper) { InitializeComponent(); #region Translation tblockMapLayers.Text = DashboardSharedStrings.GADGET_MAP_LAYERS; #endregion }
public RepublishSurveyFields(string pOrganizationKey, Epi.View pView, string pTemplate) { InitializeComponent(); this.OrganizationKey = pOrganizationKey; this.view = pView; this.template = pTemplate; }
public void ClickFieldHandler(object sender, ClickFieldEventArg e) { Control currentControl = (Control)sender; if (e.Field is RelatedViewField) { this.EnterCheckCodeEngine.CheckCodeHandler(sender, new RunCheckCodeEventArgs(EventActionEnum.ClickField, "")); if (CheckRequiredFields(currentControl)) { RelatedViewField rvField = (RelatedViewField)e.Field; Epi.View childView = rvField.GetProject().Metadata.GetChildView(rvField); if (childView == null) { MsgBox.Show(SharedStrings.WARNING_CHILD_VIEW_NOT_SET, SharedStrings.ENTER); } else { childView.ReturnToParent = rvField.ShouldReturnToParent; if (childView != null) { this.SetFieldData(); this.EnterCheckCodeEngine.SaveRecord(); childView.ForeignKeyField.CurrentRecordValueString = rvField.GetView().CurrentGlobalRecordId; this.OpenViewHandler(this, new OpenViewEventArgs(childView)); } } } } else if (e.Field is CommandButtonField) { ControlFactory factory = ControlFactory.Instance; Epi.Page ThisPage = this.EnterCheckCodeEngine.CurrentView.CurrentPage; Epi.Fields.Field ThisField = this.EnterCheckCodeEngine.CurrentView.CurrentField; this.EnterCheckCodeEngine.CheckCodeHandler(sender, new RunCheckCodeEventArgs(EventActionEnum.ClickField, "")); } else if (e.Field is ImageField) { SelectImage(e.Field as ImageField, sender as PictureBox); } else if (e.Field is CheckBoxField) { ControlFactory factory = ControlFactory.Instance; Epi.Page ThisPage = this.EnterCheckCodeEngine.CurrentView.CurrentPage; Epi.Fields.Field ThisField = this.EnterCheckCodeEngine.CurrentView.CurrentField; this.EnterCheckCodeEngine.CheckCodeHandler(sender, new RunCheckCodeEventArgs(EventActionEnum.ClickField, "")); } else if (e.Field is OptionField) { ControlFactory factory = ControlFactory.Instance; Epi.Page ThisPage = this.EnterCheckCodeEngine.CurrentView.CurrentPage; Epi.Fields.Field ThisField = this.EnterCheckCodeEngine.CurrentView.CurrentField; this.EnterCheckCodeEngine.CheckCodeHandler(sender, new RunCheckCodeEventArgs(EventActionEnum.ClickField, "")); } }
public TransmissionChain(Epi.View view, Epi.Data.IDbDriver db, Canvas transmissionCanvas, Canvas transmissionDates, MainWindow mainWindow) { this.db = db; this.view = view; this.transmissionCanvas = transmissionCanvas; this.transmissionDates = transmissionDates; this.mainWindow = mainWindow; this.IsEnterOpen = false; }
private void FillComboBox(Epi.View view) { cbxTime.Items.Clear(); foreach (Epi.Fields.Field f in view.Fields) { if ((f is Epi.Fields.DateField) || (f is Epi.Fields.DateTimeField) || (f is Epi.Fields.TimeField)) { cbxTime.Items.Add(f.Name); } } }
public LayerAdder(ESRI.ArcGIS.Client.Map myMap, Epi.View view, Epi.Data.IDbDriver db, DashboardHelper dashboardHelper, LayerList layerList, MapControl mapControl) { InitializeComponent(); this.myMap = myMap; this.view = view; this.db = db; this.dashboardHelper = dashboardHelper; this.layerList = layerList; this.mapControl = mapControl; AddItem(); }
/// <summary> /// Copy a view /// </summary> /// <param name="other"></param> public void CopyTo(Epi.View other) { other.Name = this.NameWithoutPrefix; other.IsRelatedView = this.IsRelatedView; /* * other.CheckCodeVariableDefinitions = this.CheckCodeVariableDefinitions; * other.CheckCodeBefore = this.CheckCodeBefore; * other.WebSurveyId = this.CheckCodeAfter; * other.RecordCheckCodeBefore = this.RecordCheckCodeBefore; * other.RecordCheckCodeAfter = this.RecordCheckCodeAfter; * other.IsRelatedView = this.IsRelatedView;*/ }
public LayerListItem(ESRI.ArcGIS.Client.Map myMap, Epi.View view, Epi.Data.IDbDriver db, DashboardHelper dashboardHelper, MapControl mapControl) { InitializeComponent(); this.myMap = myMap; this.view = view; this.db = db; this.dashboardHelper = dashboardHelper; this.mapControl = mapControl; cbxLayerType.SelectionChanged += new SelectionChangedEventHandler(cbxLayerType_SelectionChanged); cbxLayerType.SelectedIndex = 0; lblLayerType.Foreground = new SolidColorBrush(FontColor); }
/*private void OpenView(object sender, RunCheckCodeEventArgs e) * { * * }*/ public void CloseView(object sender, RunCheckCodeEventArgs e) { //execute after stack until current level = view while (this.AfterStack.Count > 0) { this.AfterStack.Pop().Value.Execute(); } this.mCurrentField = null; this.mCurrentPage = null; this.mView = null; // then execute current level after_view //this.RunCheckCodeCommands(this.mView.CheckCodeAfter); }
public RunTimeView(IEnterInterpreterHost pEnterClientInterface, Epi.View pView) { // to do set the enter interpreter // application domain. Assembly a = Assembly.Load(pView.Project.EnterMakeviewIntepreter); // Get the type to use. Type myType = a.GetType(pView.Project.EnterMakeviewIntepreter + ".EpiInterpreterParser"); // Create an instance. this.mEpiInterpreter = (IEnterInterpreter)Activator.CreateInstance(myType, new object[] { pEnterClientInterface }); this.mEpiInterpreter.Host = pEnterClientInterface; //this.mEpiInterpreter = new EpiInterpreterParser(Epi.Resources.ResourceLoader.GetEnterCompiledGrammarTable(), pEnterClientInterface, Rule_Context.eRunMode.Enter); this.EnterClientInterface = pEnterClientInterface; this.AfterStack = new Stack <KeyValuePair <EventActionEnum, StackCommand> >(); this.RecordNumberMap = new Dictionary <int, int>(); this.mView = pView; }
public RunTimeView(IEnterInterpreterHost pEnterClientInterface, Epi.View pView) { // to do set the enter interpreter // application domain. Assembly a = Assembly.Load(pView.Project.EnterMakeviewIntepreter); // Get the type to use. Type myType = a.GetType(pView.Project.EnterMakeviewIntepreter + ".EpiInterpreterParser"); // Create an instance. this.mEpiInterpreter = (IEnterInterpreter)Activator.CreateInstance(myType, new object[] { pEnterClientInterface }); this.mEpiInterpreter.Host = pEnterClientInterface; //this.mEpiInterpreter = new EpiInterpreterParser(Epi.Resources.ResourceLoader.GetEnterCompiledGrammarTable(), pEnterClientInterface, Rule_Context.eRunMode.Enter); this.EnterClientInterface = pEnterClientInterface; this.AfterStack = new Stack<KeyValuePair<EventActionEnum, StackCommand>>(); this.RecordNumberMap = new Dictionary<int, int>(); this.mView = pView; }
public TimeConfigDialog(Epi.View view) { InitializeComponent(); FillComboBox(view); }
public void CopyFrom(Epi.View other) { throw new NotImplementedException(); }
public OpenViewEventArgs(Epi.View pView, string record) { this.mView = pView; this.RecordNumber = record; }
public OpenViewEventArgs(Epi.View pView) { this.mView = pView; this.RecordNumber = string.Empty; }
private async void CheckForDbConnectivityAsync() { if (IsShowingConnectionEditor == true || IsCheckingConnection == true) // don't check for connectivity while the editor is open or if we're already checking { return; } IsCheckingConnection = true; await Task.Factory.StartNew(delegate { Epi.Project project = null; try { if (!System.IO.File.Exists(this.FileInfo.FullName)) { IsConnected = false; IsCheckingConnection = false; return; } project = new Epi.Project(this.FileInfo.FullName); Epi.Data.IDbDriver db = project.CollectedData.GetDatabase(); if (db != null) { ConnectionString = db.ConnectionString; InputConnectionString = db.ConnectionString; if (db is Epi.Data.Office.OleDbDatabase) { IsLocalStorage = true; IsServerBasedStorage = false; } else { IsLocalStorage = false; IsServerBasedStorage = true; } } //if (project.CollectedData.GetDatabase() is Epi.Data.Office.OleDbDatabase) //{ // string dataSource = project.CollectedData.DataSource; // dataSource = dataSource.Replace("data source=", String.Empty); // bool fileExists = System.IO.File.Exists(dataSource); // if (!fileExists) // { // IsConnected = false; // return; // } //} Epi.View view = project.Views["CaseInformationForm"]; IsConnected = true; } catch (Epi.GeneralException) { IsConnected = false; } catch (System.Security.Cryptography.CryptographicException) { // keys don't match IsConnected = false; } catch (Exception) { IsConnected = false; } finally { if (project != null) { project.Dispose(); } IsCheckingConnection = false; } }); }
/*private void OpenView(object sender, RunCheckCodeEventArgs e) { }*/ public void CloseView(object sender, RunCheckCodeEventArgs e) { //execute after stack until current level = view while (this.AfterStack.Count > 0) { this.AfterStack.Pop().Value.Execute(); } this.mCurrentField = null; this.mCurrentPage = null; this.mView = null; // then execute current level after_view //this.RunCheckCodeCommands(this.mView.CheckCodeAfter); }
void IAnalysisCheckCode.ShowGridTable(List <DataRow> table, List <string> identifierList, Epi.View epiView) { Epi.Windows.Analysis.Forms.OutputEventArg args = new OutputEventArg(); args.Table = table; args.IdentifierList = identifierList; if (epiView != null) { args.EpiView = epiView; } args.OutputEventType = OutputEventArg.OutputEventArgEnum.ShowGridTable; queue.Enqueue(args); OnChanged(); }
public void OpenViewHandler(object sender, OpenViewEventArgs e) { Epi.View view = mCurrentProject.Views.GetViewById(e.ViewId); if (this.mCurrentView.Count == 0) { this.mCurrentView.Push(new RunTimeView(e.EnterCheckCodeInterface, view)); } else { if ( this.mCurrentProject.FilePath != view.GetProject().FilePath || view.ParentView == null || view.ParentView.Name != this.mCurrentView.Peek().View.Name ) { while (this.mCurrentView.Count > 0) { this.mCurrentView.Pop().CloseView(this, new RunCheckCodeEventArgs(EventActionEnum.CloseView, "")); } this.mCurrentView.Push(new RunTimeView(e.EnterCheckCodeInterface, view)); } else { RunTimeView runTimeView = this.mCurrentView.Peek(); int CurrentRecordId = runTimeView.View.CurrentRecordId; string CurrentGlobalRecordId = runTimeView.View.CurrentGlobalRecordId; EpiInfo.Plugin.IScope scope = runTimeView.EpiInterpreter.Context.GetNewScope(runTimeView.View.Name, runTimeView.EpiInterpreter.Context.Scope); foreach (Epi.Fields.Field field in runTimeView.View.Fields) { if (field is EpiInfo.Plugin.IVariable) { PluginVariable pluginVariable = new PluginVariable(); pluginVariable.VariableScope = EpiInfo.Plugin.VariableScope.Standard; pluginVariable.Name = field.Name; pluginVariable.DataType = ((EpiInfo.Plugin.IVariable)field).DataType; if (field is Epi.Fields.CheckBoxField || field is Epi.Fields.YesNoField) { if (((Epi.Fields.IDataField)field).CurrentRecordValueString == "1") { pluginVariable.Expression = "true"; } else if (((Epi.Fields.IDataField)field).CurrentRecordValueString == "0") { pluginVariable.Expression = "false"; } else { pluginVariable.Expression = null; } } else { pluginVariable.Expression = ((Epi.Fields.IDataField)field).CurrentRecordValueString; } scope.Define(pluginVariable); } } this.mCurrentView.Push(new RunTimeView(e.EnterCheckCodeInterface, view, CurrentRecordId, CurrentGlobalRecordId, scope)); } } this.mCurrentView.Peek().OpenViewHandler(sender, e); }