Example #1
0
        private Document CreateAndPublishDocument(string name, string contentTypeAlias, User author, int parentId, int templateId)
        {
            Document document = Document.MakeNew(name, DocumentType.GetByAlias(contentTypeAlias), author, parentId);

            UmbracoUtilities.SaveAndPublish(document);

            return(document);
        }
Example #2
0
        public Document UpdateDiablo3Hero(Document hero, dynamic heroprofile)
        {
            //generel
            SetDocumentPropertyOrDefault(hero, Hero.isCreatedFirstTime, false);
            SetDocumentPropertyOrDefault(hero, Hero.heroGender, heroprofile.gender);
            SetDocumentPropertyOrDefault(hero, Hero.heroKillsElites, heroprofile.kills.elites);

            //skills

            UmbracoUtilities.SaveAndPublish(hero);
            return(hero);
        }
Example #3
0
        private static void StartUmbraco(ConsoleArgs consoleArgs)
        {
            if (_setupRun)
            {
                return;
            }
            _setupRun = true;

            Console.WriteLine("START UMBRACO");
            _consoleApp = new ConsoleApplication(consoleArgs.UmbracoFolder);
            _consoleApp.StartApplication();
            UmbracoUtilities.SetupDb(_consoleApp.ApplicationContext);
        }
Example #4
0
        public Document CreateDiablo3Hero(Document profile, dynamic heroprofile, User author)
        {
            string   heroId = Convert.ToString(heroprofile.id);
            Document hero   = CreateAndPublishDocument(heroId, Hero.documentTypeAlias, author, profile.Id);

            SetDocumentPropertyOrDefault(hero, Hero.heroClass, Impromptu.InvokeGet(heroprofile, "class"));
            SetDocumentPropertyOrDefault(hero, Hero.heroHardcore, heroprofile.hardcore);
            SetDocumentPropertyOrDefault(hero, Hero.heroId, heroId);
            SetDocumentPropertyOrDefault(hero, Hero.heroLevel, heroprofile.level);
            SetDocumentPropertyOrDefault(hero, Hero.heroName, heroprofile.name);
            SetDocumentPropertyOrDefault(hero, Hero.isCreatedFirstTime, true);
            SetDocumentPropertyOrDefault(hero, Hero.dead, heroprofile.dead);
            SetDocumentPropertyOrDefault(hero, Hero.lastUpdated, Convert.ToString(Impromptu.InvokeGet(heroprofile, "last-updated")));
            SetDocumentPropertyOrDefault(hero, Hero.paragonLevel, heroprofile.paragonLevel);
            SetDocumentPropertyOrDefault(hero, Hero.heroGender, heroprofile.gender);
            SetDocumentPropertyOrDefault(hero, Hero.heroKillsElites, heroprofile.kills.elites);
            UmbracoUtilities.SaveAndPublish(hero);
            return(hero);
        }
Example #5
0
        public Document CreateDiablo3Profile(Document profiles, dynamic careerprofile, User author)
        {
            string   battleTag = careerprofile.battleTag;
            Document profile   = CreateAndPublishDocument(battleTag, BattleTagProfile.documentTypeAlias, author, profiles.Id);

            SetDocumentPropertyOrDefault(profile, BattleTagProfile.lastUpdated, careerprofile.lastUpdated);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.lastPlayedHero, careerprofile.lastHeroPlayed);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.monsters, careerprofile.kills.monsters);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.elites, careerprofile.kills.elites);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.hardcoreMonsters, careerprofile.kills.hardcoreMonsters);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.timePlayedBarbarian, careerprofile.timePlayed.barbarian);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.timePlayedDemonHunter, Convert.ToString(Impromptu.InvokeGet(careerprofile.timePlayed, "demon-hunter")));
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.timePlayedMonk, careerprofile.timePlayed.monk);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.timePlayedWicthDoctor, Convert.ToString(Impromptu.InvokeGet(careerprofile.timePlayed, "witch-doctor")));
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.timePlayedWizard, careerprofile.timePlayed.wizard);
            SetDocumentPropertyOrDefault(profile, BattleTagProfile.numberOfHeroes, Convert.ToString(careerprofile.heroes.Count));
            UmbracoUtilities.SaveAndPublish(profile);
            return(profile);
        }
 public ConsoleBootManager(UmbracoApplicationBase umbracoApplication, DirectoryInfo umbracoFolder)
     : base(umbracoApplication, umbracoFolder)
 {
     UmbracoUtilities.SetIOHelperRoot(umbracoFolder.FullName);
 }