Exemplo n.º 1
0
 private void SectionName_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (SectionName.GetLineLength(SectionName.GetLastVisibleLineIndex()) == 2)
     {
         Keyboard.Focus(ShelfNumber);
     }
 }
        private string GetReportMenuHtml()
        {
            var stringWriter = new StringWriter();

            using (var writer = new HtmlTextWriter(stringWriter))
            {
                var menuName = new SectionName("Main menu");
                writer
                .WriteString(menuName.HtmlCode)
                .Class("border border-0 p-3 mb-3")
                .H2("Report sections: ")
                .Class("menu")
                .RenderBeginTag("nav");
                foreach (var element in Elements)
                {
                    writer
                    .Class("menu-item")
                    .Href(element.Href)
                    .OpenTag(HtmlTextWriterTag.A)
                    .Class(element.Octicon)
                    .Tag(HtmlTextWriterTag.Span)
                    .Text(element.Title)
                    .CloseTag();   //A
                }
                writer.CloseTag(); //NAV
            }
            return(stringWriter.ToString());
        }
Exemplo n.º 3
0
        public bool FlagChangesFromSection(Section verSec)
        {
            SubjectVer          = Subject.Equals(verSec.Subject);
            CatalogNbrVer       = CatalogNbr.Equals(verSec.CatalogNbr);
            ClassDescrVer       = ClassDescr.Equals(verSec.ClassDescr);
            SectionVer          = SectionName.Equals(verSec.SectionName);
            ConsentVer          = Consent.Equals(verSec.Consent);
            EnrlCapVer          = EnrlCap.Equals(verSec.EnrlCap);
            TopicDescrVer       = TopicDescr.Equals(verSec.TopicDescr);
            MeetingStartDtVer   = MeetingStartDt.Equals(verSec.MeetingStartDt);
            MeetingEndDtVer     = MeetingEndDt.Equals(verSec.MeetingEndDt);
            FacilityIdVer       = FacilityId.Equals(verSec.FacilityId);
            MeetingTimeStartVer = MeetingTimeStart.Equals(verSec.MeetingTimeStart);
            MeetingTimeEndVer   = MeetingTimeEnd.Equals(verSec.MeetingTimeEnd);
            MonVer                = Mon.Equals(verSec.Mon);
            TuesVer               = Tues.Equals(verSec.Tues);
            WedVer                = Wed.Equals(verSec.Wed);
            ThursVer              = Thurs.Equals(verSec.Thurs);
            FriVer                = Fri.Equals(verSec.Fri);
            SatVer                = Sat.Equals(verSec.Sat);
            SunVer                = Sun.Equals(verSec.Sun);
            InstructorVer         = Instructor.Equals(verSec.Instructor);
            UnitsMinVer           = UnitsMin.Equals(verSec.UnitsMin);
            UnitsMaxVer           = UnitsMax.Equals(verSec.UnitsMax);
            ClassAssnComponentVer = ClassAssnComponent.Equals(verSec.ClassAssnComponent);

            HasNotBeenChanged = SubjectVer && CatalogNbrVer && ClassDescrVer && SectionVer && ConsentVer && EnrlCapVer && TopicDescrVer &&
                                MeetingStartDtVer && MeetingEndDtVer && FacilityIdVer && MeetingTimeStartVer && MeetingTimeEndVer && MonVer && TuesVer &&
                                WedVer && ThursVer && FriVer && SatVer && SunVer && InstructorVer && UnitsMinVer && UnitsMaxVer && ClassAssnComponentVer;

            return(HasNotBeenChanged);
        }
        private object DeserializeSection(ConfigSectionInfo sectionInfo)
        {
            var elems = _serializer.GetSectionContent(SectionName.Create(sectionInfo));

            if (elems.Length <= 0)
            {
                return(sectionInfo.Serializer.CreateDefaultSection());
            }
            var elem = elems[0];

            if (elems.Length > 1)
            {
                if (!sectionInfo.AllowMerge)
                {
                    throw new ApplicationException($"Section '{sectionInfo.Name}' does not allow merge");
                }
                else
                {
                    for (var i = 1; i < elems.Length; i++)
                    {
                        foreach (var sibChild in elems[i].Nodes())
                        {
                            elem.Add(sibChild, true);
                        }
                    }
                }
            }
            return(sectionInfo.Serializer.Deserialize(elem.CreateReader()));
        }
Exemplo n.º 5
0
        public void New_SomePropertyPath_IsSetAsPropertyPath()
        {
            // Arrange + Act
            var sectionName = new SectionName("somePath");

            // Assert
            Assert.Equal("somePath", sectionName.PropertyPath);
        }
Exemplo n.º 6
0
    private bool FillSubSection()
    {
        try
        {
            if (!string.IsNullOrEmpty(txtSubSection.Text))
            {
                txtSubSection.Text          = "";
                lblSubSectionNameHindi.Text = "";
            }
            string ReplaceSectionName = string.Empty;

            if (lstSection.SelectedValue == "")
            {
                SectionName = (txtSectionName.Text).ToUpper().Trim();
            }
            else
            {
                SectionName = (lstSection.SelectedValue).ToUpper().Trim();
            }
            ReplaceSectionName = SectionName.Replace("%", "_");//replacing string by another character
            //txtSectionName.Text = SectionName;
            DataTable dtGRD = VSSection;
            if (dtGRD.Rows.Count > 0)
            {
                DataView dv31 = new DataView(dtGRD);

                for (int i = 0; i <= dtGRD.Rows.Count - 1; i++)
                {
                    dtGRD.Rows[i]["SectionName"] = dtGRD.Rows[i]["SectionName"].ToString().Replace("%", "_").Trim();
                }

                DataView ReplaceSectionTable = dv31;

                ReplaceSectionTable.RowFilter = "SectionName LIKE '" + ReplaceSectionName + "%'";
                lblSectionNameHindi.Text      = ReplaceSectionTable.ToTable().Rows[0]["SectionNameHindi"].ToString();
                SectionID           = CommonCls.ConvertIntZero(ReplaceSectionTable.ToTable().Rows[0]["SectionId"].ToString());
                txtSectionName.Text = ReplaceSectionTable.ToTable().Rows[0]["SectionName"].ToString();
            }
            txtSubSection.Focus();


            //divListSubSection.Style.Add("display", "");
            //divListBudgetHead.Style.Add("display", "none");
            //divListSection.Style.Add("display", "none");

            divListSection.Visible    = false;
            divListBudgetHead.Visible = false;
            divListSubSection.Visible = true;
            return(true);
        }
        catch (Exception ex)
        {
            ShowMessage("This Section name is incorrect", false);
            return(false);
        }
    }
Exemplo n.º 7
0
 private void UpdateForm()
 {
     AisleNumber.Clear();
     SectionName.Clear();
     PositionNumber.Clear();
     ShelfNumber.Clear();
     LocationMax.Clear();
     Keyboard.Focus(AisleNumber);
     OutputViewer.Items.Refresh();
 }
Exemplo n.º 8
0
 public void DrawData(SectionName v)
 {
     if (!skipdata && Enabled)
     {
         foreach (var i in Data.Where(a => a.Value != null && a.Key.Equals(v)))
         {
             i.Value.Draw();
         }
     }
 }
Exemplo n.º 9
0
 public void DrawData(SectionName v)
 {
     if (!skipdata && Enabled)
     {
         foreach (KeyValuePair <Enum, Menu_Base> i in Data.Where(a => a.Key.Equals(v)))
         {
             i.Value.Draw();
         }
     }
 }
 public override void IsValid()
 {
     if (SectionName == "Course [Section]")
     {
         throw new Exception("Please insert section name");
     }
     if (!SectionName.Contains('[') && !SectionName.Contains(']'))
     {
         throw new Exception("Section name format is invalid. Be sure to use this format: Course [Section]");
     }
 }
Exemplo n.º 11
0
        public void WithProperty_PropertyNameAndStringIndex_OriginalSectionNameIsNotChanged()
        {
            // Arrange
            var sectionName = new SectionName("somePath");

            // Act
            sectionName.WithProperty("someProperty", "20");

            // Assert
            Assert.Equal("somePath", sectionName.PropertyPath);
        }
Exemplo n.º 12
0
        public void WithProperty_PropertyNameSet_MergesBasePathWithPropertyName()
        {
            // Arrange
            var sectionName = new SectionName("somePath");

            // Act
            var newSectionName = sectionName.WithProperty("someProperty");

            // Assert
            Assert.Equal("somePath.someProperty", newSectionName.PropertyPath);
        }
Exemplo n.º 13
0
 /// <summary>
 /// Gets the hash code for the tag
 /// </summary>
 /// <returns>The hashcode</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ StartPosition;
         hashCode = (hashCode * 397) ^ EndPosition;
         hashCode = (hashCode * 397) ^ (SectionName?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Exemplo n.º 14
0
        public static void WriteFloat(string Key, SectionName section = SectionName.config, float defaultValue = 0)
        {
            string             sectionName = section.ToString();
            Action <IniParser> action      =
                (ini) =>
            {
                ini.WriteValue(sectionName, Key, defaultValue);
            };

            OpenAndReadINI(mINIFileName, action);
        }
Exemplo n.º 15
0
        public void WithProperty_PropertyNameAndIntegerIndex_MergesBasePathWithPropertyNameAndIndex()
        {
            // Arrange
            var sectionName = new SectionName("somePath");

            // Act
            var newSectionName = sectionName.WithProperty("someProperty", 20);

            // Assert
            Assert.Equal("somePath.someProperty[20]", newSectionName.PropertyPath);
        }
Exemplo n.º 16
0
        private void button8_Click(object sender, EventArgs e)
        {
            AddSection.Visible    = true;
            DeleteSection.Visible = true;
            button4.Visible       = false;
            CancelSection.Visible = false;
            SectionName.Clear();

            //to generate code and refresh sections
            refreshAdvisorsCmb();
            refreshSections();
        }
Exemplo n.º 17
0
 private void CreateMainToggle()
 {
     _mainToggle = new ModSetting <Toggles>(SectionName, nameof(_mainToggle), Toggles.None)
     {
         SectionOverride    = SectionOverride,
         DisplayResetButton = false,
         Description        = Description,
     };
     _mainToggle.Format(ModName ?? SectionName.SplitCamelCase());
     _mainToggle.AddEvent(OnTogglesChanged);
     _previousMainToggle = _mainToggle;
 }
Exemplo n.º 18
0
        public void ToString_PropertyNameAndStringIndex_ReturnsFullPath()
        {
            // Arrange
            var sectionName    = new SectionName("somePath");
            var newSectionName = sectionName.WithProperty("someProperty", "20");

            // Act
            var toString = newSectionName.ToString();

            // Assert
            Assert.Equal("somePath.someProperty[20]", toString);
        }
        public Page ChooseSection(RulesEnum rule)
        {
            //find link among presented in RulesEnum
            IWebElement contacts = driver
                                   .FindElements(By.TagName(AviaRulesPageSelectors.ContactsSelector))
                                   .Where(el => el.Text == SectionName.Get(rule))
                                   .First();

            contacts.Click();

            SECTION = $"#{rule}";
            return(this);
        }
Exemplo n.º 20
0
        public void WithProperty_NullPropertyName_ThrowsException()
        {
            // Arrange
            var sectionName = new SectionName("somePath");

            // Act
            var exception = Assert.Throws <ArgumentNullException>(() =>
            {
                sectionName.WithProperty(null);
            });

            // Assert
            Assert.Equal("Value cannot be null. (Parameter 'propertyName')", exception.Message);
        }
Exemplo n.º 21
0
 private void SavebtnMouseOver()
 {
     if ((SectionName == EmptyField || SectionName.Trim().ToString() == string.Empty) || (DisplayName == EmptyField || DisplayName.Trim().ToString() == string.Empty) || (StatisticsName == EmptyField || StatisticsName.Trim().ToString() == string.Empty) ||
         (TooltipValue == EmptyField || TooltipValue.Trim().ToString() == string.Empty) || (Threshold1 == EmptyField || Threshold1.Trim().ToString() == string.Empty) || (Threshold2 == EmptyField || Threshold2.Trim().ToString() == string.Empty) || (Threshold1 == DecimalFormat || Threshold1.Trim().ToString() == string.Empty) ||
         (Threshold2 == DecimalFormat || Threshold2.Trim().ToString() == string.Empty) || (Threshold1 == TimeFormat || Threshold1.Trim().ToString() == string.Empty) || (Threshold2 == TimeFormat || Threshold2.Trim().ToString() == string.Empty) ||
         (Threshold1 == ThresholdMessage1 || Threshold1.Trim().ToString() == string.Empty) || (Threshold2 == ThresholdMessage2 || Threshold2.Trim().ToString() == string.Empty))
     {
         IsSavebtnEnable = false;
     }
     else
     {
         IsSavebtnEnable = true;
     }
 }
Exemplo n.º 22
0
        private void LoadIniFile()
        {
            string key;
            string value;

            foreach (string line in GetSection().Split(Environment.NewLine))
            {
                foreach (KeyValuePair <string, string> kvp in line.ToKeyValuePairs())
                {
                    if (!kvp.Key.IsNullOrWhiteSpace())
                    {
                        key   = kvp.Key.Trim();
                        value = kvp.Value.Trim();

                        if (!_keyValues.ContainsKey(key))
                        {
                            _keyValues.Add(key, CleanValue(value));
                        }
                        else
                        {
                            if (!SectionName.IsNullOrWhiteSpace())
                            {
                                throw new ApplicationException("Duplicate '{0}' ini key found in '{1}' section.".FormatString(key, SectionName));
                            }
                            else
                            {
                                throw new ApplicationException("Duplicate '{0}' ini key found in root section.".FormatString(key, SectionName));
                            }
                        }
                    }
                    break;
                }

                //string[] keyValue = line.SplitNTrim("=", ChoStringSplitOptions.None);
                //if (keyValue.Length != 2
                //    || keyValue[0].IsNullOrWhiteSpace()) continue;

                //if (!_keyValues.ContainsKey(keyValue[0]))
                //    _keyValues.Add(keyValue[0], CleanValue(keyValue[1]));
                //else
                //{
                //    if (!SectionName.IsNullOrWhiteSpace())
                //        throw new ApplicationException("Duplicate '{0}' ini key found in '{1}' section.".FormatString(keyValue[0], SectionName));
                //    else
                //        throw new ApplicationException("Duplicate '{0}' ini key found in root section.".FormatString(keyValue[0], SectionName));
                //}
                //_keyValues[keyValue[0]] = CleanValue(keyValue[1]);
            }
        }
Exemplo n.º 23
0
        public static List <string> GetColorSchemes(string SkinName)
        {
            List <string> functionReturnValue = default(List <string>);
            IniFile       SkinIni             = GetSkinIni(SkinName);

            functionReturnValue = new List <string>();
            foreach (string SectionName in SkinIni.SectionsNames)
            {
                if (SectionName.Contains(SkinIDs.ColorSchemes))
                {
                    functionReturnValue.Add(SectionName.Replace(SkinIDs.ColorSchemes, ""));
                }
            }
            return(functionReturnValue);
        }
Exemplo n.º 24
0
        private void AddSection_Click(object sender, EventArgs e)
        {
            string txtSectionCode = SectionCode.Text;
            string txtSectionName = SectionName.Text;

            if (SectionName.Text != "")
            {
                try
                {
                    string txtSectionAdviser = getAdvisorCodeFromList(cmbAdvisorName.SelectedItem.ToString());
                    //search if existing
                    if (!isExisting(txtSectionName, SectionList))
                    {
                        dbConnect.Insert("insert into tblSection values('" + txtSectionCode + "','" + txtSectionName + "','" + txtSectionAdviser + "',false);");
                        this.SectionCode.Text = codeGenerator.generateCodeChild("tblSection", "strSectCode", getAdvisorCodeFromList(cmbAdvisorName.SelectedItem.ToString()), "Sec");
                    }
                    SectionName.Clear();
                }
                catch (Exception)
                {
                    MessageBox.Show("No selected adviser");
                }
            }
            else
            {
                MessageBox.Show("Input a Section name");
            }


            //refresh Sections
            refreshSections();
            AddSection.Visible    = true;
            DeleteSection.Visible = true;
            button4.Visible       = false;
            CancelSection.Visible = false;

            //-----Reseting data
            //clear cmb and code
            //for trying if there are advisers
            try
            {
                this.cmbAdvisorName.SelectedIndex = 0;
            }
            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("No Registered Adviser, Please register faculties first");
            }
        }
Exemplo n.º 25
0
        protected override void Execute(CodeActivityContext context)
        {
            var source      = Source.Get(context);
            var destination = Destination.Get(context);
            var name        = SectionName.Get(context);

            if (!string.IsNullOrWhiteSpace(name) && !destination.HasSection(name))
            {
                var section = new ConfigSection();
                destination[name] = section;
                section.Merge(source, Override);
                return;
            }

            destination.Merge(source, Override);
        }
Exemplo n.º 26
0
 private void TextChangedEvent()
 {
     if ((SectionName == EmptyField || SectionName.Trim().ToString() == string.Empty) || (DisplayName == EmptyField || DisplayName.Trim().ToString() == string.Empty) || (StatisticsName == EmptyField || StatisticsName.Trim().ToString() == string.Empty) ||
         (TooltipValue == EmptyField || TooltipValue.Trim().ToString() == string.Empty) || (Threshold1 == EmptyField || Threshold1.Trim().ToString() == string.Empty) || (Threshold2 == EmptyField || Threshold2.Trim().ToString() == string.Empty) || (Threshold1 == DecimalFormat || Threshold1.Trim().ToString() == string.Empty) ||
         (Threshold2 == DecimalFormat || Threshold2.Trim().ToString() == string.Empty) || (Threshold1 == TimeFormat || Threshold1.Trim().ToString() == string.Empty) || (Threshold2 == TimeFormat || Threshold2.Trim().ToString() == string.Empty) ||
         (Threshold1 == ThresholdMessage1 || Threshold1.Trim().ToString() == string.Empty) || (Threshold2 == ThresholdMessage2 || Threshold2.Trim().ToString() == string.Empty))
     {
         IsSavebtnEnable = false;
     }
     else
     {
         IsSavebtnEnable = true;
     }
     Settings.GetInstance().TValue1 = Threshold1;
     Settings.GetInstance().TValue2 = Threshold2;
 }
Exemplo n.º 27
0
        private void DeleteSection_Click(object sender, EventArgs e)
        {
            try
            {
                string c = this.SectionList.SelectedRows[0].Cells[0].Value.ToString();

                DialogResult dialogResult = MessageBox.Show("Are you you want to delete " + SectionName.Text + "?", "Delete?", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    foreach (DataGridViewRow row in this.SectionList.SelectedRows)
                    {
                        //Logical delete in database
                        dbConnect.Update("Update tblSection set boolSectIsDel = true where strSectCode = '" + row.Cells[0].Value.ToString() + "';");
                    }
                    AddSection.Visible    = true;
                    button4.Visible       = false;
                    CancelSection.Visible = false;
                    SectionName.Clear();
                    //to generate code and refresh sections
                    refreshAdvisorsCmb();
                    refreshSections();
                }
                else if (dialogResult == DialogResult.No)
                {
                }
            }

            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("No selected Section");
            }

            //refresh Sections
            refreshSections();

            //for trying if there are advisers
            try
            {
                this.cmbAdvisorName.SelectedIndex = 0;
            }
            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("No Registered Adviser, Please register faculties first");
            }
        }
        public SectionParser(CommandLineLogger logger, ExtractFileInfo fileInfo, bool isPreservation, string preservationPrefix, ParserVersionEnum version)
        {
            ContainsLocationData = false;
            Logger      = logger;
            FileInfo    = fileInfo;
            SourceFile  = FileInfo.OriginalFile_Path;
            SectionName = Path.GetFileNameWithoutExtension(FileInfo.File_Name);

            List <string> sectionStrings = new List <string>();

            if (SectionName.Contains("_"))
            {
                sectionStrings = SectionName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            else if (SectionName.Contains("_"))
            {
                sectionStrings = SectionName.Split(new string[] { "_" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            }
            if (!sectionStrings.Any())
            {
                sectionStrings.Add(SectionName);
            }

            List <string> sectionStringsUpper = new List <string>();
            string        temp = string.Empty;

            foreach (string s in sectionStrings)
            {
                sectionStringsUpper.Add(s.First().ToString().ToUpper() + s.Substring(1));
            }

            IsPreservation     = isPreservation;
            PreservationPrefix = preservationPrefix;
            ParserVersion      = version;

            MainTableName = string.Join("", sectionStringsUpper);
            if (isPreservation)
            {
                MainTableName = PreservationPrefix + "_" + MainTableName;
            }
            DisplaySectionName = string.Join(" ", sectionStringsUpper);

            LoadHtml();
            ProcessHTML();
        }
Exemplo n.º 29
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (!isExisting(SectionName.Text, SectionList))
            {
                dbConnect.Update("update tblSection set strSectName = '" + SectionName.Text + "', strSectFacuCode = '" + getAdvisorCodeFromList(cmbAdvisorName.SelectedItem.ToString()) + "' where strSectCode = '" + SectionCode.Text + "';");

                MessageBox.Show("Update Successful!");
                AddSection.Visible    = true;
                DeleteSection.Visible = true;
                button4.Visible       = false;
                CancelSection.Visible = false;
                SectionName.Clear();

                //to generate code and refresh data grid
                refreshAdvisorsCmb();
                refreshSections();
            }
        }
Exemplo n.º 30
0
        public static string GetString(string Key, SectionName section = SectionName.config, string defaultValue = "")
        {
            string value       = defaultValue;
            string sectionName = section.ToString();

            Action <IniParser> action =
                (ini) =>
            {
                if (!ini.IsKeyExists(sectionName, Key))
                {
                    ini.WriteValue(sectionName, Key, defaultValue);
                }
                value = ini.ReadValue(sectionName, Key, defaultValue);
            };

            OpenAndReadINI(mINIFileName, action);
            return(value);
        }
Exemplo n.º 31
0
 public InfSection(string section, string content)
 {
     Section = new SectionName(section);
     Content = content;
 }
Exemplo n.º 32
0
 private static List<XmlNode> GetNodesFromSection(SectionName sectionName)
 {
     var myXmlDocument = new XmlDocument();
     myXmlDocument.Load(Configuration.SettingsGeneral.AbsolutePath + "App_Data\\advantshop.config");
     var root = myXmlDocument.ChildNodes.OfType<XmlNode>().FirstOrDefault(p => p.Name.Equals("advantshop"));
     if (root != null)
     {
         foreach (XmlNode node in root.ChildNodes)
         {
             if (node.Name.Equals(sectionName.ToString()))
             {
                 return node.ChildNodes.OfType<XmlNode>().ToList();
             }
         }
     }
     return new List<XmlNode>();
 }