Esempio n. 1
0
 /// <summary>
 /// Displays details of selected row in GridViewControl.
 /// </summary>
 /// <param name="sender"> Object GridView.</param>
 /// <param name="e">Data Grid View Cell Event Args.</param>
 private void GridViewControl_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex > -1)
     {
         DataGridViewRow row = GridViewControl.Rows[e.RowIndex];
         if (row.Cells["Select"].Selected.Equals(true))
         {
             Scanner.ASPXControlProperties aspxControlProperties = new Scanner.ASPXControlProperties();
             aspxControlProperties.ControlMessages = new List <string>();
             aspxControlProperties = Scanner.AspxControlsSorted[row.Cells["DictionaryKey"].Value.ToString()];
             ASPXServerSideControl aspxDetails = new ASPXServerSideControl();
             aspxDetails.FillForm(aspxControlProperties);
             aspxDetails.ShowDialog();
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Validate ASPX pages for Culture, Autopost, Tabindex.
        /// </summary>
        /// <param name="aspxControlsSorted">Sorted dictionary of individual asp net controls.</param>
        public static void ValidatePageAttributes(SortedDictionary <string, Scanner.ASPXControlProperties> aspxControlsSorted)
        {
            bool          pageErrorAutoPost = false;
            bool          pageErrorIndexTab = false;
            List <string> headerTags        = new List <string>();

            if (aspxControlsSorted.Count > 0)
            {
                Scanner.ASPXPageProperties page = new Scanner.ASPXPageProperties();
                if (page.PageMessages == null)
                {
                    page.PageMessages = new List <string>();
                }

                page.FileName = string.Empty;
                Scanner.ASPXControlProperties aspxControlProperties = new Scanner.ASPXControlProperties();
                foreach (KeyValuePair <string, Scanner.ASPXControlProperties> kvp in aspxControlsSorted.ToArray())
                {
                    aspxControlProperties = kvp.Value;
                    if (page.FileName.Equals(string.Empty))
                    {
                        page.FileName         = aspxControlProperties.FileName;
                        page.Path             = aspxControlProperties.Path;
                        page.NumberOfControls = 0;
                    }

                    if (!page.FileName.Equals(aspxControlProperties.FileName))
                    {
                        Rules.HeaderTags(ref page, headerTags);
                        Scanner.AspxPages.Add(page.FileName, page);
                        headerTags.Clear();
                        page.FileName         = aspxControlProperties.FileName;
                        page.Path             = aspxControlProperties.Path;
                        page.NumberOfControls = 0;
                        pageErrorAutoPost     = false;
                        pageErrorIndexTab     = false;
                        page.PageMessages.Clear();
                    }

                    if (aspxControlProperties.ControlType.Equals("HeaderTags"))
                    {
                        Rules.HeaderTags(ref page, headerTags);
                    }
                    else
                    {
                        page.NumberOfControls++;
                        if (Rules.Autopost(aspxControlProperties, ref page).Equals(true))
                        {
                            if (pageErrorAutoPost.Equals(false))
                            {
                                pageErrorAutoPost = true;
                                page.PageMessages.Add("AUT001");
                            }
                        }

                        if (Rules.TabIndex(aspxControlProperties, ref page).Equals(true))
                        {
                            if (pageErrorIndexTab.Equals(false))
                            {
                                pageErrorIndexTab = true;
                                page.PageMessages.Add("TAB001");
                            }
                        }
                    }
                }

                Scanner.AspxPages.Add(page.FileName, page);
            }
            ////todo: lanuage
            ////todo: display in new tab
        }