public SpreadsheetDocumentManager(DocumentsApp app) : base(app) { FormatRegistry.Add(".xlsx", DevExpress.Spreadsheet.DocumentFormat.Xlsx); EditorUrl = "SpreadsheetEdit.aspx"; IconName = "Spreadsheet.png"; DefaultDocumentName = "Worksheet1.xlsx"; }
public TFormat GetFormat(Item fileItem) { string extension = Path.GetExtension(fileItem.Name); TFormat format; if (FormatRegistry.TryGetValue(extension, out format)) { return(format); } throw new Exception("Extension is not supported."); }
public RichEditDocumentManager(DocumentsApp app) : base(app) { FormatRegistry.Add(".rtf", DevExpress.XtraRichEdit.DocumentFormat.Rtf); FormatRegistry.Add(".doc", DevExpress.XtraRichEdit.DocumentFormat.Doc); FormatRegistry.Add(".docx", DevExpress.XtraRichEdit.DocumentFormat.OpenXml); FormatRegistry.Add(".txt", DevExpress.XtraRichEdit.DocumentFormat.PlainText); EditorUrl = "RichTextEdit.aspx"; IconName = "RTF.png"; DefaultDocumentName = "Document1.rtf"; }
public void Test() { var speciesBuilder = new SpeciesBuilder(1, "Test Species"); speciesBuilder.SetAllStats(10); speciesBuilder.Weight = 10; speciesBuilder.Height = 10; var type = new Type( "Test Type", "Test type description", new Dictionary <IType, decimal>(), new Dictionary <IType, decimal>()); speciesBuilder.Types = new IndexedSet <IType> { type }; var category = new MoveCategory("Test Category", PermanentStatType.Attack, PermanentStatType.Defense); var move = new Move("Test Move", category, 10, 100, 1, 10, "Test Move Description", type); speciesBuilder.Moves = new IndexedSet <IMove> { move }; speciesBuilder.Tier = new Tier("Test Tier", "Test Tier Description"); var species = speciesBuilder.Build(); var pokedex = new Pokedex(new HashSet <ISpecies> { species }); var formats = new FormatRegistry(new UniqueDictionary <string, IFormat> { ["TestFormat"] = new Format("TestFormat", "Test Format") }); var generation = new Generation("Test Generation", "TG", pokedex, formats); var pokemonBuilder = new BattlePokemonBuilder(generation.StatFormula, "Test Pokemon", 10); var pokemon = pokemonBuilder.WithSpecies(species).Build(species); var pokemons = new IndexedSet <IBattlePokemon> { pokemon }; var trainers = new IndexedSet <ITrainer> { new Trainer("Test Trainer", pokemons) }; var battle = new Battle(generation, trainers); var burn = new BurnStatus(pokemon, battle.EventBus); var normalAttack = battle.StatFormula.CalculateStat(pokemon.Attack); Assert.That(pokemon.Attack.ModifiedValue, Is.EqualTo(normalAttack / 2)); }
public override bool CanProcess(Item fileItem) { string extension = Path.GetExtension(fileItem.Name); return(FormatRegistry.ContainsKey(extension)); }