Esempio n. 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page this field belongs to</param>
 /// <param name="viewElement">Xml view element</param>
 public MultilineTextField(Page page, XmlElement viewElement)
     : base(page)
 {
     this.viewElement = viewElement;
     this.Page = page;
     Construct();
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page the field belongs to</param>
 /// <param name="viewElement"></param>
 public CheckBoxField(Page page, XmlElement viewElement)
     : base(page)
 {
     this.viewElement = viewElement;
     this.Page = page;
     Construct();
 }
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="frm">The parent form</param>
 /// <param name="page">The current page</param>
 public CommandButtonFieldDefinition(MainForm frm, Page page)
     : base(frm)
 {
     InitializeComponent();
     this.mode = FormMode.Create;
     this.page = page;
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">Page</param>
 /// <param name="viewElement">Xml view element</param>
 public DateTimeField(Page page, XmlElement viewElement)
     : base(page)
 {
     construct();
     this.viewElement = viewElement;
     this.Page = page;
 }
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="frm">The parent form</param>
 /// <param name="page">Page the field will belong to</param>
 public UpperCaseTextFieldDefinition(MainForm frm, Page page)
     : base(frm)
 {
     InitializeComponent();
     this.mode = FormMode.Create;
     this.page = page;
 }
Esempio n. 6
0
 /// <summary>
 /// Constructor for the Comment Legal dialog
 /// </summary>
 /// <param name="column">The column associated with this comment legal grid column</param>
 /// <param name="frm">The main form</param>
 /// <param name="name">The name of the column</param>
 /// <param name="currentPage">The current page</param>
 public CommentLegalDialog(TableBasedDropDownColumn column, MainForm frm, string name, Page currentPage)
     : base(column, frm, name, currentPage)
 {
     InitializeComponent();
     fieldName = name;
     page = currentPage;
     //dgCodes.CaptionText = "Comment Legal values for: " + name;
 }
 /// <summary>
 /// Constructor for the Relate Field Definition
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="page">The page</param>
 public RelateFieldDefinition(Epi.Windows.MakeView.Forms.MakeViewMainForm frm, Page page)
     : base(frm)
 {
     InitializeComponent();
     this.memoryRegion = frm.EpiInterpreter;
     this.mode = FormMode.Create;
     this.page = page;
 }
 /// <summary>
 /// Constructor for the class
 /// </summary>
 /// <param name="frm">The parent form</param>
 /// <param name="page">The current page</param>
 public DateTimeFieldDefinition(MainForm frm, Page page)
     : base(frm)
 {
     InitializeComponent();
     this.mode = FormMode.Create;
     this.page = page;
     PopulatePatterns();
     cbxPattern.SelectedIndex = -1;
 }
Esempio n. 9
0
 /// <summary>
 /// Constructor for Grid Columns Dialog
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="fieldPage">The page containing the field</param>
 /// <param name="gridField">The grid's field</param>
 /// <param name="patternsDataView">The data view</param>
 /// <param name="formMode">The form mode</param>
 /// <param name="tempColumns">Temporary Columns</param>
 public GridColumnsDialog(MainForm frm, Page fieldPage, Epi.Fields.GridField gridField, DataView patternsDataView, FormMode formMode, List<GridColumnBase> tempColumns)
     : base(frm)
 {
     InitializeComponent();
     page = fieldPage;
     grid = gridField;
     patterns = patternsDataView;
     mode = formMode;
     form = frm;
     gridColumns = tempColumns;
 }
Esempio n. 10
0
 /// <summary>
 /// Constructor of the Codes dialog
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="name">The field's name</param>
 /// <param name="currentPage">The current page</param>
 public ListDialog(MainForm frm, string name, Page currentPage)
     : base(frm, name, currentPage)
 {
     InitializeComponent();
     fieldName = name;
     page = currentPage;
     ddlField = new DDListField(page);
     ddlField.Name = fieldName;
     selectedFields = new NamedObjectCollection<Field>();
     SetDataSource(ddlField);
     SetDgCodes(dgCodes, fieldName);
 }
Esempio n. 11
0
 /// <summary>
 /// Constructor of the Codes dialog
 /// </summary>
 /// <param name="frm">The main form</param>
 /// <param name="field">The field</param>
 /// <param name="currentPage">The current page</param>
 public ListDialog(MainForm frm, RenderableField field, Page currentPage)
     : base(frm, field, currentPage)
 {
     InitializeComponent();
     page = currentPage;
     ddlField = (DDListField)field;
     codeTable = ddlField.GetSourceData();
     this.Text = "List Field";
     //cbxSort.Checked = ddlField.ShouldSort;
     fieldName = ddlField.Name;
     SetDataSource(ddlField);
     SetDgCodes(dgCodes, fieldName);
 }
Esempio n. 12
0
 /// <summary>
 /// Contructor of the CodesDialog
 /// </summary>
 /// <param name="field">The field</param>
 /// <param name="frm">The main form</param>
 /// <param name="name">The field name</param>
 /// <param name="currentPage">The current page</param>
 /// <param name="selectedItems">The names of the fields from the Code Field Definition dialog</param>
 public CodesDialog(TableBasedDropDownField field, MainForm frm, string name, Page currentPage, NamedObjectCollection<Field> selectedItems)
     : base(field, frm, name, currentPage)
 {
     InitializeComponent();
     fieldName = name;
     page = currentPage;
     ddlField = (DDLFieldOfCodes)field;
     selectedFields = selectedItems;
     SetDataSource(ddlField);
     SetDgCodes(dgCodes, fieldName);
     dgCodes.Visible = true;
     relateCondition = ddlField.RelateConditionString;
 }
Esempio n. 13
0
        public LegalValuesDialog(MainForm frm, string name, Page currentPage)
            : base(frm)
        {
            InitializeComponent();
            InitContextMenu();
            fieldName = name;
            page = currentPage;
            ddlField = new DDLFieldOfLegalValues(page);
            ddlField.Name = name;
            //dgCodes.CaptionText += "  " + name;
            //dgCodes.PreferredColumnWidth = Convert.ToInt32(dgCodes.Width * COLUMN_WIDTH_MULTIPLE);

            if (!string.IsNullOrEmpty(ddlField.SourceTableName))
            {
                codeTable = ddlField.GetSourceData();
                sourceTableName = ddlField.SourceTableName;
                textColumnName = ddlField.TextColumnName;
            }
        }
Esempio n. 14
0
 /// <summary>
 /// Inserts a page node for a given page
 /// </summary>
 /// <param name="page">Page in which node is to be inserted</param>
 /// <param name="index">Index of insertion</param>
 /// <returns></returns>
 public PageNode InsertPageNode(Page page, int index)
 {
     PageNode node = new PageNode(page);
     if (View.Pages.Count == 0)
     {
         Nodes.Add(node);
     }
     else
     {
         if (index == View.Pages.Count)
         {
             Nodes.Add(node);
         }
         else
         {
             Nodes.Insert(index, node);
         }
     }
     return node;
 }
Esempio n. 15
0
        /// <summary>
        /// Constructor for the Comment Legal dialog
        /// </summary>
        /// <param name="field">The comment legal field</param>
        /// <param name="currentPage">The current page</param>
        public CommentLegalDialog(RenderableField field, Page currentPage)
            : base(field, currentPage)
        {
            InitializeComponent();
            page = currentPage;
            DDLFieldOfCommentLegal ddlField = (DDLFieldOfCommentLegal)field;
            codeTable = ddlField.GetSourceData();
            //if (dgCodes.AllowSorting)
            //{
            //    ddlField.ShouldSort = true;
            //}
            //else
            //{
            //    ddlField.ShouldSort = false;
            //}

            dgCodes.DataSource = codeTable;
            sourceTableName = codeTable.TableName;
            textColumnName = fieldName;
            //dgCodes.AllowSorting = true;
        }
Esempio n. 16
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page</param>
 public DDLFieldOfLegalValues(Page page)
     : base(page)
 {
 }
Esempio n. 17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page this field belongs to.</param>
 /// <param name="viewElement">The Xml view element of the GridField.</param>
 public GridField(Page page, XmlElement viewElement)
     : base(page)
 {
     this.viewElement = viewElement;
     this.Page = page;
 }
Esempio n. 18
0
 /// <summary>
 /// Constructor for the class. Receives Page object.
 /// </summary>
 /// <param name="page">The page this field belongs to.</param>
 public GridField(Page page)
     : base(page)
 {
 }
Esempio n. 19
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="page"><see cref="Epi.Page"/></param>
 public InputFieldWithSeparatePrompt(Page page)
     : base(page)
 {
     Construct();
 }
Esempio n. 21
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page</param>
 /// <param name="viewElement">XML View element</param>
 public DDListField(Page page, XmlElement viewElement)
     : base(page)
 {
     this.viewElement = viewElement;
 }
Esempio n. 22
0
 /// <summary>
 /// Assign Tab Index of the field
 /// </summary>
 /// <param name="field">The field whose tab index is to be assigned</param>
 /// <param name="page">The page the field belongs to</param>
 private void AssignTabIndex(Field field, Page page)
 {
     ((RenderableField)field).TabIndex = field.GetMetadata().GetFieldTabIndex(field.Id, field.GetView().Id, page.Id);
 }
Esempio n. 23
0
        /// <summary>
        /// Creates a new page and adds it to the page collection
        /// </summary>
        /// <param name="name">Name of the page</param>
        /// <param name="position">Position of the page</param>
        /// <returns>The new page object</returns>
        public Page CreatePage(string name, int position)
        {
            #region Input Validation
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (position < 0)
            {
                throw new ArgumentOutOfRangeException("Position");
            }
            #endregion Input Validation

            Page page = null;
            this.pages = null;
            this.project.Save();

            page = new Page(this, 0);
            page.Name = name;
            page.Position = position;
            page.Id = 0;
            page.SaveToDb();

            return page;
        }
Esempio n. 24
0
 /// <summary>
 /// Gets a collection of renderable <see cref="Epi.Fields"/> on an <see cref="Epi.Page"/>
 /// </summary>
 /// <param name="page"><see cref="Epi.Page"/></param>
 /// <returns>A named object collection of renderable <see cref="Epi.Fields"/>.</returns>
 public NamedObjectCollection<Field> GetFieldsOnPage(Page page)
 {
     NamedObjectCollection<Field> pageFields = new NamedObjectCollection<Field>();
     foreach (Field field in page.Fields)
     {
         if (field is RenderableField)
         {
             RenderableField renderableField = field as RenderableField;
             if (renderableField.Page.Id == page.Id)
             {
                 pageFields.Add(renderableField);
             }
         }
     }
     return pageFields;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page</param>
 /// <param name="viewElement">XML view element</param>
 public DDLFieldOfCommentLegal(Page page, XmlElement viewElement)
     : base(page)
 {
     this.viewElement = viewElement;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page</param>
 public DDLFieldOfCommentLegal(Page page)
     : base(page)
 {
 }
Esempio n. 27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page</param>
 /// <param name="viewElement">Xml view element</param>
 public DDLFieldOfLegalValues(Page page, XmlElement viewElement)
     : base(page)
 {
     this.viewElement = viewElement;
 }
Esempio n. 28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="page">The page</param>
 public DDListField(Page page)
     : base(page)
 {
 }
Esempio n. 29
0
 /// <summary>
 /// Delete a page from a view
 /// </summary>
 public void DeletePage(Page page)
 {
     page.DeleteFields();
     GetMetadata().DeletePage(page);
     //GetMetadata().SynchronizePageNumbersOnDelete(this, page.Position + 1);		//incremented position by 1 since the index is 0
     GetMetadata().SynchronizePageNumbersOnDelete(this, page.Position);
     page = null;	//explicit dispose
     pages = null;
     fields = GetMetadata().GetFields(this);
 }
Esempio n. 30
0
        public List<Control> GetPageControls(Page page, Size canvasSize)
        {
            List<Control> controls = new List<Control>();

            foreach (Field field in page.Fields)
            {
                List<Control> fields = GetFieldControls(field, canvasSize);
                controls.AddRange(fields);
            }

            return controls;
        }