private string GetPropertyName(SectionNames section) { switch (section) { case SectionNames.PersonalDetail: return(nameof(_personalDetailService)); case SectionNames.Study: return(nameof(_studyService)); case SectionNames.WorkExperience: return(nameof(_workExperience)); case SectionNames.Certificate: return(nameof(_certificateService)); case SectionNames.Language: return(nameof(_languageService)); case SectionNames.Skill: return(nameof(_skillService)); case SectionNames.Interest: return(nameof(_interestService)); case SectionNames.PersonalReference: return(nameof(_personalReferenceService)); case SectionNames.CustomSection: return(nameof(_customSectionService)); default: throw new ArgumentException("La sección indicada no es válida."); } }
public void DeleteSectionBlock(SectionNames section, int id) { var sectionService = this.GetCurrentSectionService(section); object[] parameters = { id }; sectionService.GetType().GetMethod("Delete").Invoke(sectionService, parameters); }
public SummaryBlockDTO GetSectionBlock(SectionNames section, int id) { var sectionService = this.GetCurrentSectionService(section); object[] parameters = { id }; var summaryBlock = sectionService.GetType().GetMethod("GetSummaryBlock").Invoke(sectionService, parameters); return((SummaryBlockDTO)summaryBlock); }
public void ToggleSectionVisibility(SectionNames name, string email) { var userId = _UnitOfWork.User.GetUserIdByEmail(email); var curriculumId = _UnitOfWork.Curriculum.GetIdByUserId(userId); var sectionService = this.GetCurrentSectionService(name); object[] parameters = { curriculumId }; sectionService.GetType().GetMethod("ToggleVisibility").Invoke(sectionService, parameters); }
private void SaveSection(StreamWriter iniOut, SectionNames sect) { iniOut.WriteLine("[" + sect.ToString().Replace("_", " ") + "]"); iniOut.WriteLine("{"); foreach (string t in sectionTags[sect]) { iniOut.WriteLine(t + "=" + GetValue(t)); } iniOut.WriteLine("}"); iniOut.WriteLine(); }
/// <summary> /// Necessary for files to be copied /// </summary> /// <param name="sourceDirectoryPath"> /// In the form: 'SCSIDRV' or 'SCSIDRV\AMDAHCI' /// </param> public void AddOptionalSourceDirectory(string sourceDirectoryPath) { if (!SectionNames.Contains("OptionalSrcDirs")) { AddSection("OptionalSrcDirs"); } if (GetLineIndex("OptionalSrcDirs", sourceDirectoryPath) == -1) { AppendLineToSection("OptionalSrcDirs", sourceDirectoryPath); } }
public async Task FillVatAndSectiontNames() { foreach (var item in EditItems.Select(x => x.VatName).Distinct()) { VatNames.Add(item); } foreach (var item in Sekces.Select(x => x.name).Distinct()) { SectionNames.Add(item); } }
public IActionResult SectionFormData(SectionNames name, int id) { try { dynamic sectionFormData = _curriculumService.GetSectionFormData(name, id); return(Ok(sectionFormData)); } catch (Exception ex) { return(BadRequest(new { message = ex.Message })); } }
public SectionContent GetSectionContent(SectionNames section, int sectionId) { var item = new SectionContent(); using (var repo = new CodeSlingers2012Entities()) { item = (from r in repo.SectionContents where r.Section == (int)section && r.SectionId == sectionId select r).FirstOrDefault(); } return item; }
public List<SectionContent> GetSectionContentItems(SectionNames section) { var items = new List<SectionContent>(); using (var repo = new CodeSlingers2012Entities()) { items = (from r in repo.SectionContents where r.Section == (int)section orderby r.SortOrder select r).ToList(); } return items; }
public void AddOrUpdateSectionBlock <T>(T dto, FormMode mode, SectionNames section) { var sectionService = this.GetCurrentSectionService(section); object[] parameters = { dto }; switch (mode) { case FormMode.ADD: sectionService.GetType().GetMethod("Create").Invoke(sectionService, parameters); break; case FormMode.EDIT: sectionService.GetType().GetMethod("Update").Invoke(sectionService, parameters); break; default: throw new ArgumentException("Ocurrió un problema al agregar/actualizar la sección."); } }
public static void ChangeSectionName(string currentSectionName, string newSectionName) { if (currentSectionName == newSectionName) { return; } if (SectionNames.Contains(newSectionName)) { MergeSections(currentSectionName, newSectionName); } else { RenameSection(currentSectionName, newSectionName); } }
/// <summary> /// The section will be created if it does not exist /// </summary> public void AddFileToFilesSection(string sectionName, string fileName, int winntDirectoryID) { if (!SectionNames.Contains(sectionName)) { AddSection(sectionName); } // Note: the key here is a combination of filename and directory, // so the same file could be copied to two directories. string entry = String.Format("{0},{1}", fileName, winntDirectoryID); int lineIndex = GetLineIndexByKey(sectionName, entry); if (lineIndex == -1) { AppendLineToSection(sectionName, entry); } }
public string GetSectionText(string sectionName) { LoadSections(); if (!SectionNames.Contains(sectionName)) { throw new Exception("No section called '" + sectionName + "'"); } if (string.IsNullOrWhiteSpace(sectionText[sectionName])) { return(""); } XDocument xdoc = XDocument.Parse(sectionText[sectionName]); if (xdoc.Declaration == null) { return(xdoc.ToString()); } else { return(xdoc.Declaration.ToString() + "\r\n" + xdoc.ToString()); } }
public bool SetSectionText(string sectionName, string text) { LoadSections(); if (!SectionNames.Contains(sectionName)) { throw new Exception("No section called '" + sectionName + "'"); } if (text != sectionText[sectionName]) { IsChanged = true; } sectionText[sectionName] = text; bytesInSync = false; if (string.IsNullOrWhiteSpace(text)) { deleteSection(sectionName); } else { setSectionBytes(sectionName); } return(true); }
public dynamic GetSectionFormData(SectionNames section, int id) { switch (section) { case SectionNames.Study: return(this._studyService.GetById(id)); case SectionNames.WorkExperience: return(this._workExperience.GetById(id)); case SectionNames.Certificate: return(this._certificateService.GetById(id)); case SectionNames.Language: return(this._languageService.GetById(id)); case SectionNames.Skill: return(this._skillService.GetById(id)); case SectionNames.Interest: return(this._interestService.GetById(id)); case SectionNames.PersonalReference: return(this._personalReferenceService.GetById(id)); case SectionNames.CustomSection: return(this._customSectionService.GetById(id)); default: throw new ArgumentException("La sección proporcionada no existe."); } }
private object GetCurrentSectionService(SectionNames section) { return(GetType().GetField(this.GetPropertyName(section), BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this)); }
public void ParseData() { string lineIterator; StreamReader Reader = new StreamReader(this.FullPath); Exception exception = new Exception("Неизвестное количество параметров."); while (!Reader.EndOfStream) { lineIterator = Reader.ReadLine(); List <string> paramsBuf; if (ExcludedSynbols.IndexOf(lineIterator) >= 0 || lineIterator.IndexOf('#') > -1) { continue; } if (SectionNames.IndexOf(lineIterator) >= 0) { ConfigSections.Add(new ConfigSection(lineIterator)); continue; } paramsBuf = new List <string>(lineIterator.Split(',')); if (paramsBuf.Count < 2) { continue; } paramsBuf = CleanParams(paramsBuf); var configRows = ConfigSections.Last().ConfigRows; switch (ConfigSections.Last().Name) { case PATH.SectionName: lineIterator = Reader.ReadLine(); List <PATHNode> parsedNodes = new List <PATHNode>(); List <string> nodesParamsBuf = new List <string>(lineIterator.Split(',')); nodesParamsBuf = CleanParams(nodesParamsBuf); switch (paramsBuf.Count) { case 3: while (nodesParamsBuf.Count == 9) { parsedNodes.Add(new PATHNode( Int32.Parse(nodesParamsBuf[0]), Int32.Parse(nodesParamsBuf[1]), Int32.Parse(nodesParamsBuf[2]), double.Parse(nodesParamsBuf[3]), double.Parse(nodesParamsBuf[4]), double.Parse(nodesParamsBuf[5]), double.Parse(nodesParamsBuf[6]), Int32.Parse(nodesParamsBuf[7]), Int32.Parse(nodesParamsBuf[8]) )); if (parsedNodes.Count == 12) { break; } lineIterator = Reader.ReadLine(); nodesParamsBuf = new List <string>(lineIterator.Split(',')); } ConfigSections.Last().ConfigRows.Add(new PATHType1( paramsBuf[0], Int32.Parse(paramsBuf[1]), paramsBuf[2], parsedNodes.ToArray() )); break; case 2: while (nodesParamsBuf.Count == 12) { parsedNodes.Add(new PATHNode( Int32.Parse(nodesParamsBuf[0]), Int32.Parse(nodesParamsBuf[1]), Int32.Parse(nodesParamsBuf[2]), double.Parse(nodesParamsBuf[3]), double.Parse(nodesParamsBuf[4]), double.Parse(nodesParamsBuf[5]), Int32.Parse(nodesParamsBuf[7]), Int32.Parse(nodesParamsBuf[8]), double.Parse(nodesParamsBuf[6]) )); if (parsedNodes.Count == 12) { break; } lineIterator = Reader.ReadLine(); nodesParamsBuf = new List <string>(lineIterator.Split(',')); } ConfigSections.Last().ConfigRows.Add(new PATHType2( paramsBuf[0], Int32.Parse(paramsBuf[1]), parsedNodes.ToArray() )); break; default: throw exception; } break; case INST.SectionName: switch (paramsBuf.Count) { case 11: configRows.Add(new INSTType3().Parse(paramsBuf)); break; case 12: configRows.Add(new INSTType1().Parse(paramsBuf)); break; case 13: configRows.Add(new INSTType2().Parse(paramsBuf)); break; } break; case AUZO.SectionName: switch (paramsBuf.Count) { case 7: configRows.Add(new AUZOType2().Parse(paramsBuf)); break; case 9: configRows.Add(new AUZOType1().Parse(paramsBuf)); break; } break; case CARS.SectionName: switch (paramsBuf.Count) { case 12: configRows.Add(new CARSType1().Parse(paramsBuf)); break; } break; case CULL.SectionName: switch (paramsBuf.Count) { case 11: if (Int32.TryParse(paramsBuf[3], out int _)) { configRows.Add(new CULLType2().Parse(paramsBuf)); } else { configRows.Add(new CULLType1().Parse(paramsBuf)); } break; case 13: configRows.Add(new CULLType3().Parse(paramsBuf)); break; } break; case ENEX.SectionName: switch (paramsBuf.Count) { case 18: configRows.Add(new ENEXType1().Parse(paramsBuf)); break; } break; case GRGE.SectionName: switch (paramsBuf.Count) { case 11: configRows.Add(new GRGEType1().Parse(paramsBuf)); break; } break; case JUMP.SectionName: switch (paramsBuf.Count) { case 16: configRows.Add(new JUMPType1().Parse(paramsBuf)); break; } break; case OCCL.SectionName: switch (paramsBuf.Count) { case 7: configRows.Add(new OCCLType1().Parse(paramsBuf)); break; case 9: configRows.Add(new OCCLType2().Parse(paramsBuf)); break; } break; case PICK.SectionName: switch (paramsBuf.Count) { case 4: configRows.Add(new PICKType1().Parse(paramsBuf)); break; } break; case TCYC.SectionName: switch (paramsBuf.Count) { case 11: configRows.Add(new TCYCType1().Parse(paramsBuf)); break; } break; case ZONE.SectionName: switch (paramsBuf.Count) { case 10: configRows.Add(new ZONEType1().Parse(paramsBuf)); break; } break; } } Reader.Close(); }
public INIEditor() { InitializeComponent(); Text = title; openFileDialog1.InitialDirectory = Directory.GetCurrentDirectory(); openFileDialog1.Filter = "INI Files (*.ini)|*.ini|All Files (*.*)|*.*"; openFileDialog1.FileName = "uox.ini"; saveFileDialog1.Filter = "INI Files (*.ini)|*.ini|All Files (*.*)|*.*"; iniControls = new Dictionary <string, ControlData>(); sectionTags = new Dictionary <SectionNames, ArrayList>(); for (SectionNames s = SectionNames.system; s != SectionNames.COUNT; ++s) { sectionTags.Add(s, new ArrayList()); } #region CheckBoxes AddTag("ADVANCEDPATHFINDING", SectionNames.settings, "chkAdvPathfind"); AddTag("AMBIENTFOOTSTEPS", SectionNames.settings, "chkAmbientFootsteps"); AddTag("ANIMALSGUARDED", SectionNames.combat, "chkAnimalsGuarded"); AddTag("ANNOUNCEWORLDSAVES", SectionNames.system, "chkAnnSave"); AddTag("ARMORAFFECTMANAREGEN", SectionNames.skills, "chkArmorAffectRegen"); AddTag("BACKUPSENABLED", SectionNames.system, "chkBackup"); AddTag("CONSOLELOG", SectionNames.system, "chkLogConsole"); AddTag("CRASHPROTECTION", SectionNames.system, "chkCrashProtect"); AddTag("CUTSCROLLREQUIREMENTS", SectionNames.skills, "chkScrollSkill"); AddTag("DEATHANIMATION", SectionNames.settings, "chkDeathAnim"); AddTag("DISPLAYHITMSG", SectionNames.combat, "chkHitMessage"); AddTag("ESCORTENABLED", SectionNames.escorts, "chkEscorts"); AddTag("GUARDSACTIVE", SectionNames.settings, "chkGuards"); AddTag("HIDEWILEMOUNTED", SectionNames.settings, "chkHideWhileMounted"); AddTag("INTERNALACCOUNTCREATION", SectionNames.settings, "chkAutoAccount"); AddTag("JOINPARTMSGS", SectionNames.system, "chkAnnLog"); AddTag("LOOTDECAYSWITHCORPSE", SectionNames.settings, "chkLootDecay"); AddTag("LOOTINGISCRIME", SectionNames.settings, "chkLootIsCrime"); AddTag("MONSTERSVSANIMALS", SectionNames.combat, "chkMonsterVsAnimals"); AddTag("NPCTRAININGENABLED", SectionNames.settings, "chkNPCTrain"); AddTag("OVERLOADPACKETS", SectionNames.settings, "chkOverloadPackets"); AddTag("PETHUNGEROFFLINE", SectionNames.hunger, "chkPetHungerOffline"); AddTag("PLAYERPERSECUTION", SectionNames.settings, "chkPersecute"); AddTag("RANKSYSTEM", SectionNames.settings, "chkAdvCrafting"); AddTag("SELLBYNAME", SectionNames.settings, "chkSellByName"); AddTag("SHOOTONANIMALBACK", SectionNames.combat, "chkArcheryOnMount"); AddTag("SHOWOFFLINEPCS", SectionNames.settings, "chkShowOfflinePCs"); AddTag("SNOOPISCRIME", SectionNames.skills, "chkSnoopIsCrime"); AddTag("TRADESYSTEM", SectionNames.settings, "chkAdvTrade"); #endregion #region ComboBoxes AddTag("AMBIENTSOUNDS", SectionNames.settings, "comboAmbientSound"); AddTag("MINECHECK", SectionNames.resources, "comboMineCheck"); AddTag("SKILLLEVEL", SectionNames.skills, "comboCraftDiff"); #endregion #region TextBoxes AddTag("ANIMALATTACKCHANCE", SectionNames.combat, "mtxtAnimalAttChance"); AddTag("ARCHERRANGE", SectionNames.combat, "mtxtArcheryRange"); AddTag("ATTACKSTAMINA", SectionNames.combat, "mtxtStamPerHit"); AddTag("BACKUPSAVERATIO", SectionNames.system, "mtxtBackupRatio"); AddTag("BASERANGE", SectionNames.tracking, "mtxtTrackBaseRange"); AddTag("BRIGHTLEVEL", SectionNames.worldlight, "mtxtBrightLight"); AddTag("COMMANDPREFIX", SectionNames.system, "txtPrefix"); AddTag("DARKLEVEL", SectionNames.worldlight, "mtxtDarkLight"); AddTag("DUNGEONLEVEL", SectionNames.worldlight, "mtxtDungeonLight"); AddTag("HUNGERDMGVAL", SectionNames.hunger, "mtxtHungerDmg"); AddTag("LOGSPERAREA", SectionNames.resources, "mtxtMaxLogs"); AddTag("LOGSRESPAWNAREA", SectionNames.resources, "mtxtLogArea"); AddTag("MAXSTAMINAMOVEMENTS", SectionNames.skills, "mtxtMaxStaminaMove"); AddTag("MAXSTEALTHMOVEMENTS", SectionNames.skills, "mtxtMaxStealthMove"); AddTag("MAXKILLS", SectionNames.reputation, "mtxtMaxKills"); AddTag("MAXRANGE", SectionNames.combat, "mtxtCombatRange"); AddTag("MAXTARGETS", SectionNames.tracking, "mtxtTrackMaxTarg"); AddTag("NPCBASEFLEEAT", SectionNames.combat, "mtxtFleeAt"); AddTag("NPCBASEREATTACKAT", SectionNames.combat, "mtxtReAttackAt"); AddTag("NPCDAMAGERATE", SectionNames.combat, "mtxtNPCDmgRate"); AddTag("OREPERAREA", SectionNames.resources, "mtxtMaxOre"); AddTag("ORERESPAWNAREA", SectionNames.resources, "mtxtOreArea"); AddTag("PETOFFLINETIMEOUT", SectionNames.hunger, "mtxtPetOfflineTimeout"); AddTag("PORT", SectionNames.system, "mtxtLSPort"); AddTag("SECONDSPERUOMINUTE", SectionNames.worldlight, "mtxtSecondsPerUOMin"); AddTag("SELLMAXITEMS", SectionNames.settings, "mtxtMaxSellItems"); AddTag("SKILLCAP", SectionNames.skills, "mtxtSkillCap"); AddTag("SPELLMAXRANGE", SectionNames.combat, "mtxtMagicRange"); AddTag("STATCAP", SectionNames.skills, "mtxtStatCap"); AddTag("WEIGHTPERSTR", SectionNames.settings, "mtxtWeightPerSTR"); #endregion #region DataGrids AddTag("ACCOUNTFLUSH", SectionNames.settings, "dataGridSpeed", "Online Accounts"); AddTag("BASEFISHINGTIMER", SectionNames.timers, "dataGridTimers", "Base Fishing Delay"); AddTag("BASETIMER", SectionNames.tracking, "dataGridTimers", "Min Tracking Duration"); AddTag("CHECKBOATS", SectionNames.speedup, "dataGridSpeed", "Boats"); AddTag("CHECKITEMS", SectionNames.speedup, "dataGridSpeed", "Items"); AddTag("CHECKNPCAI", SectionNames.speedup, "dataGridSpeed", "NPC AI"); AddTag("CHECKSPAWNREGIONS", SectionNames.speedup, "dataGridSpeed", "Spawn Regions"); AddTag("CORPSEDECAYTIMER", SectionNames.timers, "dataGridTimers", "Corpse Decay"); AddTag("CRIMINALTIMER", SectionNames.reputation, "dataGridTimers", "Criminal Duration"); AddTag("DECAYTIMER", SectionNames.timers, "dataGridTimers", "Item Decay"); AddTag("ESCORTACTIVEEXPIRE", SectionNames.escorts, "dataGridTimers", "Escort Time Limit"); AddTag("ESCORTDONEEXPIRE", SectionNames.escorts, "dataGridTimers", "Completed Escort Decay"); AddTag("ESCORTINITEXPIRE", SectionNames.escorts, "dataGridTimers", "New Escort Decay"); AddTag("GATETIMER", SectionNames.timers, "dataGridTimers", "Moongate Duration"); AddTag("GUARDSPAID", SectionNames.towns, "dataGridTimers", "Town Guard Pay Interval"); AddTag("HITPOINTREGENTIMER", SectionNames.timers, "dataGridTimers", "Hitpoint Regen Interval"); AddTag("HUNGERRATE", SectionNames.hunger, "dataGridTimers", "Hunger Interval"); AddTag("INVISIBILITYTIMER", SectionNames.timers, "dataGridTimers", "Invisibility Duration"); AddTag("LOGINTIMEOUT", SectionNames.timers, "dataGridTimers", "Idle Timeout"); AddTag("LOGSRESPAWNTIMER", SectionNames.resources, "dataGridTimers", "Log Respawn"); AddTag("MANAREGENTIMER", SectionNames.timers, "dataGridTimers", "Mana Regen Interval"); AddTag("MAYORTIME", SectionNames.towns, "dataGridTimers", "Town Mayor Term"); AddTag("MSGREDISPLAYTIME", SectionNames.tracking, "dataGridTimers", "Tracking Message"); AddTag("MURDERDECAYTIMER", SectionNames.reputation, "dataGridTimers", "Murder Decay"); AddTag("NPCMOVEMENTSPEED", SectionNames.speedup, "dataGridSpeed", "NPC Movement"); AddTag("OBJECTUSETIMER", SectionNames.timers, "dataGridTimers", "Object Delay"); AddTag("ORERESPAWNTIMER", SectionNames.resources, "dataGridTimers", "Ore Respawn"); AddTag("PETOFFLINECHECKTIMER", SectionNames.timers, "dataGridSpeed", "Offline Player's Pets"); AddTag("POISONTIMER", SectionNames.timers, "dataGridTimers", "Poison Duration"); AddTag("POLLTIME", SectionNames.towns, "dataGridTimers", "Town Poll Duration"); AddTag("POLYDURATION", SectionNames.settings, "dataGridTimers", "Polymorph Duration"); AddTag("RANDOMFISHINGTIMER", SectionNames.timers, "dataGridTimers", "Random Fishing Delay"); AddTag("SAVESTIMER", SectionNames.system, "dataGridTimers", "Auto Worldsave Interval"); AddTag("SHOPSPAWNTIMER", SectionNames.timers, "dataGridTimers", "Shop Restock Interval"); AddTag("SKILLDELAY", SectionNames.skills, "dataGridTimers", "Skill Delay"); AddTag("SPIRITSPEAKTIMER", SectionNames.timers, "dataGridTimers", "Spirit Speak Duration"); AddTag("STAMINAREGENTIMER", SectionNames.timers, "dataGridTimers", "Stamina Regen Interval"); AddTag("TAXPERIOD", SectionNames.towns, "dataGridTimers", "Town Tax Interval"); AddTag("WEATHERTIMER", SectionNames.timers, "dataGridSpeed", "Weather"); #endregion txtINIFile.Select(); }
public void AddTag(string mTag, SectionNames mSectType, string mCont) { iniControls.Add(mTag, new ControlData(mCont)); sectionTags[mSectType].Add(mTag); }
private void DoSave(string path) { txtINIFile.Text = path; StreamWriter iniOut = new StreamWriter(path); SaveSection(iniOut, "play server list", dataGridServers, "SERVERLIST"); iniOut.WriteLine("[directories]"); iniOut.WriteLine("{"); foreach (DataGridViewRow dgRow in dataGridDirectories.Rows) { if (dgRow.Cells.Count > 1) { string tag = GetDirectoryTag(dgRow.Cells[0].Value.ToString()); iniOut.WriteLine(tag + "=" + dgRow.Cells[1].Value.ToString()); } } iniOut.WriteLine("}"); iniOut.WriteLine(); for (SectionNames s = SectionNames.system; s != SectionNames.COUNT; ++s) { SaveSection(iniOut, s); } SaveSection(iniOut, "start locations", dataGridLocations, "LOCATION"); BitVector32 sCFeat = new BitVector32(0); int cmask = BitVector32.CreateMask(); foreach (DataGridViewRow dgcRow in dataGridClientFeatures.Rows) { sCFeat[cmask] = (bool)dgcRow.Cells[1].Value; cmask = BitVector32.CreateMask(cmask); } BitVector32 sSFeat = new BitVector32(0); int smask = BitVector32.CreateMask(); foreach (DataGridViewRow dgsRow in dataGridServerFeatures.Rows) { sSFeat[smask] = (bool)dgsRow.Cells[1].Value; smask = BitVector32.CreateMask(smask); } BitVector32 sPriv = new BitVector32(0); int pmask = BitVector32.CreateMask(); foreach (DataGridViewRow dgpRow in dataGridPrivs.Rows) { sPriv[pmask] = (bool)dgpRow.Cells[1].Value; pmask = BitVector32.CreateMask(pmask); } iniOut.WriteLine("[startup]"); iniOut.WriteLine("{"); iniOut.WriteLine("STARTGOLD=" + mtxtStartGold.Text); iniOut.WriteLine("STARTPRIVS=" + UOXData.Conversion.ToHexString((ushort)sPriv.Data)); iniOut.WriteLine("CLIENTFEATURES=" + UOXData.Conversion.ToHexString((ushort)sCFeat.Data)); iniOut.WriteLine("SERVERFEATURES=" + UOXData.Conversion.ToHexString((uint)sSFeat.Data)); iniOut.WriteLine("}"); iniOut.WriteLine(); iniOut.WriteLine("[gumps]"); iniOut.WriteLine("{"); iniOut.WriteLine("BACKGROUNDPIC=" + mtxtGumpBackground.Text); iniOut.WriteLine("BUTTONCANCEL=" + gumpButtons[0].ToString()); iniOut.WriteLine("BUTTONLEFT=" + gumpButtons[1].ToString()); iniOut.WriteLine("BUTTONRIGHT=" + gumpButtons[2].ToString()); iniOut.WriteLine("LEFTTEXTCOLOUR=" + gumpText[1].ToString()); iniOut.WriteLine("RIGHTTEXTCOLOUR=" + gumpText[2].ToString()); iniOut.WriteLine("TITLECOLOUR=" + gumpText[0].ToString()); iniOut.WriteLine("}"); iniOut.WriteLine(); iniOut.WriteLine("[other]"); iniOut.WriteLine("{"); foreach (DataGridViewRow dgRow in dataGridUncategorized.Rows) { if (dgRow.Cells.Count > 1) { iniOut.WriteLine(dgRow.Cells[0].Value.ToString() + "=" + dgRow.Cells[1].Value.ToString()); } } iniOut.WriteLine("}"); iniOut.WriteLine(); iniOut.WriteLine(); iniOut.Flush(); iniOut.Close(); }
public IActionResult DeleteSectionBlock(SectionNames sectionName, int id) { _curriculumService.DeleteSectionBlock(sectionName, id); return(Ok(new { message = "Bloque de sección eliminado." })); }
public IActionResult GetSectionBlock(SectionNames sectionName, int id) { SummaryBlockDTO dto = _curriculumService.GetSectionBlock(sectionName, id); return(Ok(dto)); }
public void ToggleSectionVisibility(SectionNames sectionName) { _curriculumService.ToggleSectionVisibility(sectionName, User.Identity.Name); }
public MockInventorySection() { SectionNames.AddRange(new [] { "Heating System", "Floor Finish", "Energy Supply" }); SectionName = SectionNames[0]; EquipmentCategories.AddRange(new[] { "D302001 BOILERS", "D301002 GAS SUPPLY SYSTEM - General", "NORTH BAY - C302001 TILE FLOOR FINISHES - General", "WEST BAY - C302001 TILE FLOOR FINISHES - General" }); EquipmentCategory = EquipmentCategories[0]; // TODO: Change this into an enumeration ComponentTypes.AddRange(new[] { "Permanent", "Temporary" }); ComponentType = ComponentTypes[0]; Quantity = "2.00"; YearPc = "2007"; SectionComments.Add(new CommentBase { EntryUser = new Person { FirstName = "Jane", LastName = "Doe" }, EntryTime = new DateTime(2018, 1, 18, 18, 19, 55), CommentText = "This unit was in a locked room and not visible.\n" + "(Text box large enough for STAMP on line 1 and at least 3 lines of actual comment.)\n" + "(Line 3)" }); Date = DateTime.Now.ToShortDateString(); foreach (EnumRatingType rating in Enum.GetValues(typeof(EnumRatingType))) { switch (rating) { case EnumRatingType.GPlus: case EnumRatingType.G: case EnumRatingType.GMinus: case EnumRatingType.APlus: case EnumRatingType.A: case EnumRatingType.AMinus: case EnumRatingType.RPlus: case EnumRatingType.R: case EnumRatingType.RMinus: Dcrs.Add(rating.Description()); PcRatings.Add(rating.Description()); break; case EnumRatingType.None: break; // 4/19: G:IS51 - Change DCR and P/C Rating amber colors to Yellow. Text becomes Y+, Y, Y-. // 4/30: G:IS51 - Nope. Ditch the Yellow. Keep the Amber. case EnumRatingType.YPlus: case EnumRatingType.Y: case EnumRatingType.YMinus: break; #if DEBUG default: throw new ArgumentOutOfRangeException(); #endif } } Dcr = Dcrs [1]; PcRating = PcRatings[1]; Images.AddRange(new[] { new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/th5.jpg")), new BitmapImage(new Uri(@"pack://application:,,,/Images/th6.jpg")) }); YearInstalledRenewed = "2007"; }