Exemple #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="view">View</param>
 /// <param name="fieldNode">Xml field node</param>
 public DateTimeField(View view, XmlNode fieldNode)
     : base(view)
 {
     construct();
     this.fieldNode = fieldNode;
     this.view.Project.Metadata.GetFieldData(this, this.fieldNode);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="view">View</param>
 /// <param name="fieldNode">Xml field node</param>
 public MultilineTextField(View view, XmlNode fieldNode)
     : base(view)
 {
     this.fieldNode = fieldNode;
     this.view.Project.Metadata.GetFieldData(this, this.fieldNode);
     Construct();
 }
 /// <summary>
 /// Constructor
 /// </summary>        
 /// <param name="destinationView">The form within the project that will accept the packaged data</param>
 /// <param name="mergeType">Determines how to handle data merging during the import.</param>
 public ImportEncryptedDataPackageDialog(View destinationView, DataMergeType mergeType = DataMergeType.UpdateAndAppend)
 {
     InitializeComponent();
     this.destinationView = destinationView;
     destinationProject = this.destinationView.Project;
     Construct(mergeType);
 }
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="givenView">The View to load check code for</param>
 /// <param name="givenMainForm">The main form</param>
 public DataDictionary(View givenView, MainForm givenMainForm)
 {
     view = givenView;
     project = view.Project;
     mainForm = givenMainForm;
     Construct();
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="destinationForm">The form that will receive the incoming data</param>
 /// <param name="xmlDataPackage">The data package in Xml format</param>
 public XmlMultiKeyDataUnpackager(View destinationForm, XmlDocument xmlDataPackage)
     : base(destinationForm, xmlDataPackage)
 {
     #region Input Validation
     if (destinationForm == null) { throw new ArgumentNullException("sourceForm"); }
     if (xmlDataPackage == null) { throw new ArgumentNullException("xmlDataPackage"); }
     #endregion // Input Validation
 }
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="frm">The calling form</param>
 /// <param name="node">The original page node</param>        
 public RenamePageDialog(MainForm frm, PageNode node)
     : base(frm)
 {
     // This call is required by the Windows Form Designer.
     InitializeComponent();
     this.PageNode = node;
     this.parentView = node.Page.view;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="sourceForm">The form within the project whose data will be packaged.</param>
 /// <param name="packageName">The name of the data package.</param>
 public XmlSqlDataPackager(View sourceForm, string packageName)
     : base(sourceForm, packageName)
 {
     #region Input Validation
     if (sourceForm == null) { throw new ArgumentNullException("sourceForm"); }
     if (String.IsNullOrEmpty(packageName)) { throw new ArgumentNullException("packageName"); }
     #endregion // Input Validation
 }
 /// <summary>
 /// The constructor
 /// </summary>
 /// <param name="destinationView">The destination form.</param>
 /// <param name="packagePaths">The file paths for the packages to be imported.</param>
 /// <param name="password">The password for the encryption.</param>
 public ProjectUnpackager(View destinationView, List<string> packagePaths, string password)
 {
     this.destinationView = destinationView;
     this.destinationProject = destinationView.Project;
     this.packagePaths = packagePaths;
     this.password = password;
     gch = GCHandle.Alloc(password, GCHandleType.Pinned);
 }
 public MergeConnection(string tableName, IDbDriver db, string parentKey, string childKey)
 {
     this.view = null;
     this.db = db;
     this.TableName = tableName;
     this.ConnectionName = "";
     this.ChildKeyField = childKey;
     this.ParentKeyField = parentKey;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 public FormDataImporter(Project sourceProject, Project destinationProject, View destinationView, List<View> viewsToProcess)
 {
     this.formsToProcess = viewsToProcess;
     this.sourceProject = sourceProject;
     this.destinationProject = destinationProject;
     this.sourceView = sourceProject.Views[destinationView.Name];
     this.destinationView = destinationView;
     Construct();
 }
Exemple #11
0
        /// <summary>
        /// Constructor
        /// </summary>        
        /// <param name="destinationView">The destination form; should be the currently-open view</param>
        public ImportWebDataForm(View destinationView)
        {
            InitializeComponent();

            this.destinationProject = destinationView.Project;
            this.destinationView = destinationView;

            Construct();
        }
 public MergeConnection(View view, IDbDriver db, string parentKey, string childKey)
 {
     this.view = view;
     this.db = db;
     this.TableName = "";
     this.ConnectionName = "";
     this.ChildKeyField = childKey;
     this.ParentKeyField = parentKey;
 }
Exemple #13
0
 /// <summary>
 /// Constructor for ViewNode
 /// </summary>
 /// <param name="view">The current view</param>
 public ViewNode(View view)
 {
     Initialize();
     this.View = view;
     this.Text = view.Name;
     foreach (Page page in view.Pages)
     {
         this.Nodes.Add(new PageNode(page));
     }
 }
 public RelatedConnection(View view, IDbDriver db, string parentKey, string childKey, bool useUnmatched, bool sameDataSource)
 {
     this.view = view;
     this.db = db;
     this.TableName = "";
     this.ConnectionName = "";
     this.ChildKeyField = childKey;
     this.ParentKeyField = parentKey;
     this.UseUnmatched = useUnmatched;
     this.SameDataSource = sameDataSource;
 }
 public void UnSubscribe()
 {
     this.Controls.Clear();
     this.host = null;            
     this.dashboard = null;
     this.host = null;
     this.enterMainForm = null;
     this.currentView = null;
     this.db = null;
     this.loadedRuntimeView = null;
 }
Exemple #16
0
 public void Render(Epi.View view)
 {
     try
     {
         if (!view.IsRelatedView)
         {
             this.currentView = view;
         }
     }
     catch (Exception ex)
     {
         //temporarily catch all
     }
 }
Exemple #17
0
 public void Render(Epi.View view)
 {
     try
     {
         if (!view.IsRelatedView)
         {
             this.currentView = view;
         }
     }
     catch (Exception ex)
     {
         //temporarily catch all
     }
 }
Exemple #18
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        /// <param name="view">The View to load check code for</param>
        /// <param name="frm">The main form</param>
        public CheckCode(View currentview, MakeViewMainForm frm)
        {
            mainForm = frm;
            if(currentview!=null)
            currentview.MustRefreshFieldCollection = true;
            view = currentview;
            Construct();
            EpiInfo.Plugin.IEnterInterpreter MR = mainForm.EpiInterpreter;
            MR.Context.RemoveVariablesInScope(VariableScope.Standard);

            if (!string.IsNullOrEmpty(view.CheckCode))
            {
                try
                {
                    mainForm.EpiInterpreter.Execute(view.CheckCode);
                }
                catch
                {

                }
            }

            foreach (Field field in view.Fields)
            {
                if (field is IDataField)
                {
                    EpiInfo.Plugin.IVariable definedVar = (EpiInfo.Plugin.IVariable)field;
                    MR.Context.DefineVariable(definedVar);
                }
                else if (field is Epi.Fields.LabelField)
                {
                    PluginVariable p = new PluginVariable();
                    p.Name = field.Name;
                    p.Prompt = ((Epi.Fields.LabelField)field).PromptText;
                    p.VariableScope = EpiInfo.Plugin.VariableScope.DataSource;
                    p.DataType = EpiInfo.Plugin.DataType.Text;
                    MR.Context.DefineVariable(p);
                }
                else
                {
                }
            }

            BuildComboBox();

            this.codeText.SelectionStart = 0;
            this.codeText.SelectionLength = 0;
        }
        /// <summary>
        /// Constructor for FindRecords dialog
        /// </summary>
        /// <param name="view">The current view</param>
        /// <param name="mainForm">Enter module's main form</param>
        public FindRecords(View view, EnterMainForm mainForm)
            : base(mainForm)
        {
            #region Input Validation
            if (view == null)
            {
                {
                    throw new ArgumentNullException("view");
                }
            }
            #endregion Input Validation

            InitializeComponent();
            this.view = view;
            this.mainForm = mainForm;
            this.KeyPreview = true;
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="sourceForm">The form within the project whose data will be packaged.</param>
        /// <param name="packageName">The name of the data package.</param>
        public XmlDataPackager(View sourceForm, string packageName)
        {
            #region Input Validation
            if (sourceForm == null) { throw new ArgumentNullException("sourceForm"); }
            if (String.IsNullOrEmpty(packageName)) { throw new ArgumentNullException("packageName"); }
            #endregion // Input Validation

            IncludeNullFieldData = true;
            RecordProcessingScope = RecordProcessingScope.Undeleted;
            SourceForm = sourceForm;
            SourceProject = SourceForm.Project;
            PackageName = packageName;
            GridColumnsToNull = new Dictionary<string, List<string>>();
            FieldsToNull = new Dictionary<string, List<string>>();
            KeyFields = new List<Field>();
            ParentIdList = new List<string>();
            CurrentDistanceFromRoot = 0;
            PreviousDistanceFromRoot = 0;
        }
 public LineListingViewer(View view, IDbDriver db, string title)
 {
     try
     {
         InitializeComponent();
         host = new ElementHost();
         host.Dock = DockStyle.Fill;
         control = new EpiDashboard.SimpleDataGrid(view, db);
         control.RecordSelected += new EpiDashboard.Mapping.RecordSelectedHandler(control_RecordSelected);
         host.Child = control;
         this.Controls.Add(host);
         this.Text += " - " + title;
         this.Shown += new EventHandler(LineListingViewer_Shown);
     }
     catch (Exception ex)
     {
         //catching all for debugging purposes
     }
 }
Exemple #22
0
        public void Render(Epi.View view)
        {
            try
            {
                if (!view.IsRelatedView)
                {
                    EpiDashboard.DashboardHelper helper = new EpiDashboard.DashboardHelper(view, DBReadExecute.GetDataDriver(view.Project.FilePath));
                    dashboard = new EpiDashboard.DashboardControl(helper);

                    this.WindowState = FormWindowState.Maximized;

                    helper.SetDashboardControl(dashboard);
                    dashboard.RecordCountChanged += new EpiDashboard.RecordCountChangedHandler(dashboard_RecordCountChanged);
                    host.Child = dashboard;
                    dashboard.UpdateRecordCount();
                    dashboard.ReCacheDataSource();
                }
            }
            catch (Exception ex)
            {
                //temporarily catch all
            }
        }
        /// <summary>
        /// Constructor
        /// </summary>        
        /// <param name="destinationView">The form that will accept the data</param>
        /// <param name="packagePath">The package to be imported</param>
        /// <param name="mergeType">Determines how to handle data merging during the import.</param>
        public ImportEncryptedDataPackageDialog(View destinationView, string packagePath, DataMergeType mergeType = DataMergeType.UpdateAndAppend)
        {
            InitializeComponent();
            this.destinationView = destinationView;
            destinationProject = this.destinationView.Project;

            if (System.IO.File.Exists(packagePath))
            {
                checkboxBatchImport.Checked = false;
                txtPackageFile.Text = packagePath;
            }
            else if (System.IO.Directory.Exists(packagePath))
            {
                checkboxBatchImport.Checked = true;
                txtPackageFile.Text = packagePath;
            }
            else
            {
                throw new System.IO.FileNotFoundException(ImportExportSharedStrings.ERROR_PACKAGE_DOESNT_EXIST, packagePath);
            }

            Construct(mergeType);
        }
Exemple #24
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            if (_project == null)
            {
                MessageBox.Show("No project is selected. Please try again.");
            }

            this.Cursor = Cursors.Wait;

            string guid = Guid.NewGuid().ToString();

            Project newProject = ContactTracing.ImportExport.ImportExportHelper.CreateNewOutbreak("Sierra Leone",
                                                                                                  "en-US", @"Projects\VHF\vhf_" + _project.OutbreakName + "_" + guid + ".prj",
                                                                                                  @"Projects\VHF\vhf_" + _project.OutbreakName + "_" + guid + ".mdb",
                                                                                                  _project.OutbreakDate.Ticks.ToString(),
                                                                                                  _project.OutbreakName);

            Epi.View caseForm = _project.Views[Core.Constants.CASE_FORM_NAME];

            ContactTracing.ImportExport.FormCopier formCopier = new ImportExport.FormCopier(_project, newProject, caseForm);
            formCopier.Copy();

            this.Cursor = Cursors.Arrow;
        }
        /// <summary>
        /// Creates an XmlElement representing an Epi Info 7 view's data.
        /// </summary>
        /// <param name="xmlDataPackage">The data package xml document that the XmlElement should be added to</param>
        /// <param name="form">The form whose data will be serialized</param>
        /// <returns>XmlElement; represents the form's data in Xml format, suitable for use in data packaging</returns>
        protected override XmlElement CreateXmlFormDataElement(XmlDocument xmlDataPackage, View form)
        {
            #region Input Validation
            if (xmlDataPackage == null) { throw new ArgumentNullException("xmlDataPackage"); }
            if (form == null) { throw new ArgumentNullException("form"); }
            #endregion // Input Validation

            XmlElement data = xmlDataPackage.CreateElement("Data");

            OnStatusChanged(String.Format("Packaging data for form {0}...", form.Name));
            OnResetProgress();

            /* This seems like an usual set of steps to just iterate over the data. The problem is that we can't "just
             * iterate over the data" - the data is split up page tables, with one table representing one page on the
             * form. While a JOIN might be able to bring everything together into one table, it might not - for example,
             * if there are >255 fields after the JOIN, an OleDb exception will be thrown.
             *
             * To get around this issue: The code first iterates over the rows in the BASE TABLE, obtaining the GUID
             * values for each. The GUIDs and their corresponding XmlElement go into a dictionary.
             *
             * Later, each row in each page is iterated over; as the GUIDs for each page table are accessed, the corresponding
             * XmlElement is pulled from the dictionary. Field data is added to it for each field that has data. In this
             * manner, it doesn't matter that each row is technically accessed out-of-order because they'll still show up
             * in-order in the resulting Xml.
             *
             * Filtering adds another layer of complexity. To filter, a JOIN operation is needed so that the filters can
             * be applied across all those tables, since the fields in the filter may be across different tables. The
             * RowFilter class provides a way to handle this; we simply get the query from that object and apply it to the
             * reader. Only GUIDs that match the filter are added to the dictionary of guids.
             */

            // We need to exclude records from child forms that may now be orphaned as a result of a filter applied to the parent
            if (form.IsRelatedView && PreviousDistanceFromRoot < CurrentDistanceFromRoot)
            {
                ParentIdList.Clear();
                foreach (KeyValuePair<string, XmlElement> kvp in IdList) { ParentIdList.Add(kvp.Key); }
            }

            IdList.Clear(); // Very important, this needs to be re-set in case we've already processed a form (this is a class level variable)

            if (!ExportInfo.RecordsPackaged.ContainsKey(form))
            {
                ExportInfo.RecordsPackaged.Add(form, 0);
            }

            //bool filterThisForm = false;
            RowFilters filters = null;
            Query selectQuery = null;

            IDbDriver db = SourceProject.CollectedData.GetDatabase();

            if (Filters != null && Filters.ContainsKey(form.Name) && Filters[form.Name].Count() > 0)
            {
                //filterThisForm = true;
                filters = Filters[form.Name];
                filters.RecordProcessingScope = RecordProcessingScope;
                selectQuery = filters.GetGuidSelectQuery(form);
            }

            double totalRecords = Convert.ToDouble(db.ExecuteScalar(db.CreateQuery("SELECT COUNT(*) FROM " + form.TableName)));

            string selectQueryText = "SELECT * " + form.FromViewSQL;

            if (selectQuery != null)
            {
                int whereClauseIndex = selectQuery.SqlStatement.LastIndexOf(" WHERE ");

                if (whereClauseIndex >= 0)
                {
                    selectQueryText = "SELECT * " + form.FromViewSQL + " " + selectQuery.SqlStatement.Substring(whereClauseIndex);
                }
            }

            selectQuery = db.CreateQuery(selectQueryText);

            int processedRecords = 0;

            using (IDataReader guidReader = db.ExecuteReader(selectQuery))
            //using (IDataReader guidReader = filterThisForm ? db.ExecuteReader(selectQuery) : db.GetTableDataReader(form.TableName))
            {
                while (guidReader.Read())
                {
                    string guid = guidReader["GlobalRecordId"].ToString();
                    string fkey = guidReader["FKEY"].ToString();
                    string recstatus = guidReader["RECSTATUS"].ToString();
                    string firstSaveUserId = string.Empty;
                    DateTime? firstSaveTime = null;
                    string lastSaveUserId = string.Empty;
                    DateTime? lastSaveTime = null;

                    firstSaveUserId = guidReader["FirstSaveLogonName"].ToString();
                    if (guidReader["FirstSaveTime"] != DBNull.Value)
                    {
                        firstSaveTime = (DateTime)guidReader["FirstSaveTime"];
                    }
                    lastSaveUserId = guidReader["LastSaveLogonName"].ToString();
                    if (guidReader["LastSaveTime"] != DBNull.Value)
                    {
                        lastSaveTime = (DateTime)guidReader["LastSaveTime"];
                    }

                    if (
                        (recstatus.Equals("1", StringComparison.OrdinalIgnoreCase) && RecordProcessingScope == Epi.RecordProcessingScope.Undeleted) ||
                        (recstatus.Equals("0", StringComparison.OrdinalIgnoreCase) && RecordProcessingScope == Epi.RecordProcessingScope.Deleted) ||
                        (RecordProcessingScope == Epi.RecordProcessingScope.Both))
                    {
                        if (!form.IsRelatedView || ParentIdList.Contains(fkey))
                        {
                            XmlElement record = xmlDataPackage.CreateElement("Record");
                            XmlAttribute id = xmlDataPackage.CreateAttribute("Id");
                            id.Value = guid;
                            record.Attributes.Append(id);

                            if (!string.IsNullOrEmpty(fkey))
                            {
                                XmlAttribute foreignKey = xmlDataPackage.CreateAttribute("Fkey");
                                foreignKey.Value = fkey;
                                record.Attributes.Append(foreignKey);
                            }
                            if (!string.IsNullOrEmpty(firstSaveUserId))
                            {
                                XmlAttribute firstSaveId = xmlDataPackage.CreateAttribute("FirstSaveUserId");
                                firstSaveId.Value = firstSaveUserId;
                                record.Attributes.Append(firstSaveId);
                            }
                            if (!string.IsNullOrEmpty(lastSaveUserId))
                            {
                                XmlAttribute lastSaveId = xmlDataPackage.CreateAttribute("LastSaveUserId");
                                lastSaveId.Value = lastSaveUserId;
                                record.Attributes.Append(lastSaveId);
                            }
                            if (firstSaveTime.HasValue)
                            {
                                XmlAttribute firstSaveDateTime = xmlDataPackage.CreateAttribute("FirstSaveTime");
                                firstSaveDateTime.Value = firstSaveTime.Value.Ticks.ToString();
                                record.Attributes.Append(firstSaveDateTime);
                            }
                            if (lastSaveTime.HasValue)
                            {
                                XmlAttribute lastSaveDateTime = xmlDataPackage.CreateAttribute("LastSaveTime");
                                lastSaveDateTime.Value = lastSaveTime.Value.Ticks.ToString();
                                record.Attributes.Append(lastSaveDateTime);
                            }
                            if (!String.IsNullOrEmpty(recstatus))
                            {
                                XmlAttribute recStatusAttribute = xmlDataPackage.CreateAttribute("RecStatus");
                                recStatusAttribute.Value = recstatus;
                                record.Attributes.Append(recStatusAttribute);
                            }
                            IdList.Add(guid, record);
                            //totalRecords++;

                            ExportInfo.TotalRecordsPackaged++;
                            ExportInfo.RecordsPackaged[form]++;

                            foreach (Field field in form.Fields)
                            {
                                if (field is IDataField && field is RenderableField && !(field is GridField) && !(FieldsToNull.ContainsKey(form.Name) && FieldsToNull[form.Name].Contains(field.Name)))
                                {
                                    RenderableField renderableField = field as RenderableField;
                                    if (renderableField != null)
                                    {
                                        XmlElement fieldData = xmlDataPackage.CreateElement("Field");

                                        XmlAttribute name = xmlDataPackage.CreateAttribute("Name");
                                        name.Value = renderableField.Name;
                                        fieldData.Attributes.Append(name);

                                        string value = guidReader[field.Name].ToString();

                                        if (!string.IsNullOrEmpty(value))
                                        {
                                            if (field is DateTimeField)
                                            {
                                                DateTime dt = Convert.ToDateTime(value);
                                                fieldData.InnerText = dt.Ticks.ToString();
                                            }
                                            else if (field is ImageField)
                                            {
                                                value = Convert.ToBase64String((Byte[])guidReader[field.Name]);
                                                fieldData.InnerText = value;
                                            }
                                            else if (field is NumberField)
                                            {
                                                value = Convert.ToDouble(value).ToString(System.Globalization.CultureInfo.InvariantCulture);
                                                fieldData.InnerText = value;
                                            }
                                            else
                                            {
                                                fieldData.InnerText = value;
                                            }
                                        }

                                        if (String.IsNullOrEmpty(fieldData.InnerText) && IncludeNullFieldData == false)
                                        {
                                            // do nothing, for now...
                                        }
                                        else
                                        {
                                            record.AppendChild(fieldData);
                                        }
                                        data.AppendChild(record);
                                    }
                                }
                            }
                        }
                    }

                    processedRecords++;
                    double progress = (((double)processedRecords) / ((double)totalRecords)) * 100;
                    OnProgressChanged(progress);
                }
            }

            foreach (GridField gridField in form.Fields.GridFields)
            {
                data.AppendChild(CreateXmlGridElement(xmlDataPackage, form, gridField));
                ExportInfo.GridsProcessed++;
            }

            return data;
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="view">The view</param>
 /// <param name="fieldNode">Xml field node</param>
 public DDLFieldOfLegalValues(View view, XmlNode fieldNode)
     : base(view)
 {
     this.fieldNode = fieldNode;
     this.view.Project.Metadata.GetFieldData(this, this.fieldNode);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="view">The view</param>
 public DDLFieldOfLegalValues(View view)
     : base(view)
 {
 }
Exemple #28
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="view"></param>
 /// <param name="fieldNode"></param>
 public GridField(View view, XmlNode fieldNode)
     : base(view)
 {
     this.fieldNode = fieldNode;
     this.view.Project.Metadata.GetFieldData(this, this.fieldNode);
 }
Exemple #29
0
 /// <summary>
 /// Constructor for the class. Receives View object.
 /// </summary>
 /// <param name="view">The view this field belongs to.</param>
 public GridField(View view)
     : base(view)
 {
 }
Exemple #30
0
        private void Construct()
        {
            InitializeComponent();
            DockManager.FastMoveDraw = false;
            DockManager.Style = DockVisualStyle.VS2005;

            if (view == null)
            {
                view = mainForm.CurrentView;
            }

            if (string.IsNullOrEmpty(this.view.CheckCode.Trim()))
            {
                this.view.CheckCode = View.InitialCheckCode;
            }

            this.Text = "Check Code Editor - [ " + this.view.Name + " ]";

            this.CheckCodeCommandDesigned += new CheckCodeCommandDesignHandler(commandExplorer_CheckCodeCommandDesigned);
            this.codeText.MouseWheel += new MouseEventHandler(codeText_MouseWheel);
            this.tvCodeBlocks.AfterSelect += new TreeViewEventHandler(tvCodeBlocks_SelectHandler);
            this.tvCodeBlocks.MouseDoubleClick += new MouseEventHandler(tvCodeBlocks_MouseDoubleClickHandler);

            this.btnAddBlock.Enabled = false;
            this.keywords = new List<string>();
            this.operators = new List<string>();

            this.keywords.Add("after");
            this.keywords.Add("always");
            this.keywords.Add("assign");
            this.keywords.Add("autosearch");

            this.keywords.Add("before");

            this.keywords.Add("call");
            this.keywords.Add("clear");
            this.keywords.Add("click");

            this.keywords.Add("define");
            this.keywords.Add("definevariables");
            this.keywords.Add("dialog");
            this.keywords.Add("disable");

            this.keywords.Add("else");
            this.keywords.Add("enable");
            this.keywords.Add("end-definevariables");

            this.keywords.Add("end");
            this.keywords.Add("end-view");
            this.keywords.Add("end-record");
            this.keywords.Add("end-page");
            this.keywords.Add("end-before");
            this.keywords.Add("end-after");
            this.keywords.Add("end-click");
            this.keywords.Add("end-field");
            this.keywords.Add("end-if");
            this.keywords.Add("end-sub");
            this.keywords.Add("execute");

            this.keywords.Add("field");
            this.keywords.Add("form");
            this.keywords.Add("format");

            this.keywords.Add("geocode");
            this.keywords.Add("goto");
            this.keywords.Add("help");
            this.keywords.Add("hide");
            this.keywords.Add("highlight");

            this.keywords.Add("if");

            this.keywords.Add("newrecord");
            this.keywords.Add("page");
            this.keywords.Add("record");

            this.keywords.Add("sub");

            this.keywords.Add("then");
            this.keywords.Add("titletext");
            this.keywords.Add("unhide");
            this.keywords.Add("unhighlight");

            this.keywords.Add("view");

            this.keywords.Add("quit");
            this.keywords.Add("save");

            this.operators.Add("(.)");
            this.operators.Add("(+)");
            this.operators.Add("(-)");
            this.operators.Add("=");
            this.operators.Add("+");
            this.operators.Add("-");
            this.operators.Add(">");
            this.operators.Add("<");
            this.operators.Add(">=");
            this.operators.Add("<=");
            this.operators.Add("<>");
            this.operators.Add("^");
            this.operators.Add("&");
            this.operators.Add("*");
            this.operators.Add("%");
            this.operators.Add("mod");
            this.operators.Add("(.)");
            this.operators.Add("not");
            this.operators.Add("or");
            this.operators.Add("and");
            this.operators.Add("xor");

            PopulateTextArea(); // need this for findblock to work correctly

            // change view ... end-view to form ... end-form
            int viewStart = this.findBlock("view", "", "");
            string PreviousCheckCode = this.view.CheckCode;
            try
            {
                codeText.Text = ""; // clear out text area so duplicate won't be added

                if (viewStart > -1)
                {
                    string PreText = this.view.CheckCode.Substring(0, viewStart);
                    string PostText = this.view.CheckCode.Substring(viewStart + 4, this.view.CheckCode.Length - (viewStart + 4));
                    string temp = PreText + "Form" + PostText;

                    viewStart = temp.IndexOf("end-view", StringComparison.OrdinalIgnoreCase);
                    PreText = temp.Substring(0, viewStart);
                    PostText = temp.Substring(viewStart + 9, temp.Length - (viewStart + 9));
                    temp = PreText + "End-Form" + PostText;

                    this.view.CheckCode = temp;
                    GetPublishedViewKeys();
                    this.view.GetMetadata().UpdateView(this.view);
                }
            }
            catch (Exception ex)
            {
                this.view.CheckCode = PreviousCheckCode;
            }

            PopulateTextArea();

            this.isDirty = false;
            this.WindowState = FormWindowState.Maximized;
        }
Exemple #31
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="field">The Field to load check code for</param>
 /// <param name="frm">The main form</param>
 public CheckCode(Field field, MakeViewMainForm frm,View currentview)
 {
     mainForm = frm;
     if (currentview != null)
     currentview.MustRefreshFieldCollection = true;
     view = currentview;
     Construct();
     BuildComboBox();
     string Identifier;
     if (field.Name.Trim().IndexOf(' ') > -1)
     {
         Identifier = "[" + field.Name + "]";
     }
     else
     {
         Identifier = field.Name;
     }
     if (field is Epi.Fields.CommandButtonField)
     {
         this.GotoLine("field", "click", Identifier, true);
     }
     else
     this.GotoLine("field", "", Identifier, true);
 }
Exemple #32
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="page">The Page to load check code for</param>
 /// <param name="frm">The main form</param>
 public CheckCode(Page page, MakeViewMainForm frm,View currentview)
 {
     mainForm = frm;
     if (currentview != null)
     currentview.MustRefreshFieldCollection = true;
     view = currentview;
     Construct();
     BuildComboBox();
     string Identifier;
     if (page.Name.Trim().IndexOf(' ') > -1)
     {
         Identifier = "[" + page.Name + "]";
     }
     else
     {
         Identifier = page.Name;
     }
     this.GotoLine("page", "", Identifier);
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="view"><see cref="Epi.View"/></param>
 public InputFieldWithSeparatePrompt(View view)
     : base(view)
 {
     Construct();
 }