Exemplo n.º 1
0
        public string ProcessSkin(string SkinSource, XmlDocument SkinAttributes, SkinParser ParseOption)
        {
            // create a skin file object to aid in processing
            SkinFile objSkinFile = new SkinFile(SkinSource, SkinAttributes);

            string skinFileContents = objSkinFile.Contents;

            // process control tokens and convert html to ascx format
            this.Message += this.ControlFactory.Parse(ref skinFileContents, objSkinFile.Attributes);
            this.Message += objSkinFile.PrependASCXDirectives(this.ControlFactory.Registrations);

            return(objSkinFile.Contents);
        }
Exemplo n.º 2
0
        public string ProcessList(ArrayList FileList, SkinParser ParseOption)
        {
            string FileName;

            // process each file in the list
            foreach (string tempLoopVar_FileName in FileList)
            {
                FileName = tempLoopVar_FileName;

                this.Message += SkinController.FormatMessage(FILE_BEGIN, Path.GetFileName(FileName), 0, false);

                // create a skin file object to aid in processing
                //TODO: Uncomment this:
                SkinFile objSkinFile = new SkinFile(this.SkinRoot, FileName, this.SkinAttributes);

                // choose processing based on type of file
                if (objSkinFile.FileExtension == ".htm")
                {
                    string    skinFileContents = objSkinFile.Contents;
                    ArrayList pathList         = this.PathFactory.HTMLList;
                    // replace paths, process control tokens and convert html to ascx format
                    this.Message += this.PathFactory.Parse(ref skinFileContents, ref pathList, objSkinFile.SkinRootPath, ParseOption);
                    this.Message += this.ControlFactory.Parse(ref skinFileContents, objSkinFile.Attributes);
                    this.Message += objSkinFile.PrependASCXDirectives(this.ControlFactory.Registrations);
                }
                else if (objSkinFile.FileExtension == ".html")
                {
                    string    skinFileContents = objSkinFile.Contents;
                    ArrayList pathList         = this.PathFactory.HTMLList;
                    // replace paths, process control tokens and convert html to ascx format
                    this.Message += this.PathFactory.Parse(ref skinFileContents, ref pathList, objSkinFile.SkinRootPath, ParseOption);
                    this.Message += this.ControlFactory.Parse(ref skinFileContents, objSkinFile.Attributes);
                    this.Message += objSkinFile.PrependASCXDirectives(this.ControlFactory.Registrations);
                }

                objSkinFile.Write();
                this.Message += objSkinFile.Messages;

                this.Message += SkinController.FormatMessage(FILE_END, Path.GetFileName(FileName), 1, false);
            }

            this.Message += SkinController.FormatMessage(FILES_END, this.SkinRoot + " :: " + this.SkinName, 0, false);

            return(this.Message);
        }
Exemplo n.º 3
0
 public string ProcessSkin(string SkinSource, XmlDocument SkinAttributes, SkinParser ParseOption)
 {
     var objSkinFile = new SkinFile(SkinSource, SkinAttributes);
     string contents = objSkinFile.Contents;
     Message += ControlFactory.Parse(ref contents, objSkinFile.Attributes);
     Message += objSkinFile.PrependASCXDirectives(ControlFactory.Registrations);
     return contents;
 }
Exemplo n.º 4
0
 public string ProcessList(ArrayList FileList, SkinParser ParseOption)
 {
     foreach (string FileName in FileList)
     {
         Message += ProcessFile(FileName, ParseOption);
     }
     Message += SkinController.FormatMessage(FILES_END, SkinRoot + " :: " + SkinName, 0, false);
     return Message;
 }
Exemplo n.º 5
0
 public string ProcessFile(string FileName, SkinParser ParseOption)
 {
     string strMessage = SkinController.FormatMessage(FILE_BEGIN, Path.GetFileName(FileName), 0, false);
     var objSkinFile = new SkinFile(SkinRoot, FileName, SkinAttributes);
     switch (objSkinFile.FileExtension)
     {
         case ".htm":
         case ".html":
             string contents = objSkinFile.Contents;
             strMessage += ObjectFactory.Parse(ref contents);
             strMessage += PathFactory.Parse(ref contents, PathFactory.HTMLList, objSkinFile.SkinRootPath, ParseOption);
             strMessage += ControlFactory.Parse(ref contents, objSkinFile.Attributes);
             objSkinFile.Contents = contents;
             var Registrations = new ArrayList();
             Registrations.AddRange(ControlFactory.Registrations);
             Registrations.AddRange(ObjectFactory.Registrations);
             strMessage += objSkinFile.PrependASCXDirectives(Registrations);
             break;
     }
     objSkinFile.Write();
     strMessage += objSkinFile.Messages;
     strMessage += SkinController.FormatMessage(FILE_END, Path.GetFileName(FileName), 1, false);
     return strMessage;
 }
Exemplo n.º 6
0
            /// -----------------------------------------------------------------------------
            /// <summary>
            ///     Perform parsing on the specified source file.
            /// </summary>
            /// <param name="Source">Pointer to Source string to be parsed.</param>
            /// <param name="RegexList">ArrayList of properly formatted regular expression objects.</param>
            /// <param name="SkinPath">Path to use in replacement operation.</param>
            /// <param name="ParseOption">Parse Opition.</param>
            /// <remarks>
            ///     This procedure iterates through the list of regular expression objects
            ///     and invokes a handler for each match which uses the specified path.
            /// </remarks>
            /// <history>
            /// 	[willhsc]	3/3/2004	Created
            /// </history>
            /// -----------------------------------------------------------------------------
            public string Parse(ref string Source, ArrayList RegexList, string SkinPath, SkinParser ParseOption)
            {
                m_Messages = "";

                //set path propery which is file specific
                this.SkinPath = SkinPath;
                //set parse option
                this.ParseOption = ParseOption;

                //process each regular expression
                for (int i = 0; i <= RegexList.Count - 1; i++)
                {
                    Source = ((Regex)RegexList[i]).Replace(Source, Handler);
                }
                return m_Messages;
            }
Exemplo n.º 7
0
        public string ProcessSkin( string SkinSource, XmlDocument SkinAttributes, SkinParser ParseOption )
        {
            // create a skin file object to aid in processing
            SkinFile objSkinFile = new SkinFile( SkinSource, SkinAttributes );

            string skinFileContents = objSkinFile.Contents;
            // process control tokens and convert html to ascx format
            this.Message += this.ControlFactory.Parse( ref skinFileContents, objSkinFile.Attributes );
            this.Message += objSkinFile.PrependASCXDirectives( this.ControlFactory.Registrations );

            return objSkinFile.Contents;
        }
Exemplo n.º 8
0
        public string ProcessList( ArrayList FileList, SkinParser ParseOption )
        {
            string FileName;

            // process each file in the list
            foreach( string tempLoopVar_FileName in FileList )
            {
                FileName = tempLoopVar_FileName;

                this.Message += SkinController.FormatMessage( FILE_BEGIN, Path.GetFileName( FileName ), 0, false );

                // create a skin file object to aid in processing
                //TODO: Uncomment this:
                SkinFile objSkinFile = new SkinFile( this.SkinRoot, FileName, this.SkinAttributes );

                // choose processing based on type of file
                if( objSkinFile.FileExtension == ".htm" )
                {
                    string skinFileContents = objSkinFile.Contents;
                    ArrayList pathList = this.PathFactory.HTMLList;
                    // replace paths, process control tokens and convert html to ascx format
                    this.Message += this.PathFactory.Parse( ref skinFileContents, ref pathList, objSkinFile.SkinRootPath, ParseOption );
                    this.Message += this.ControlFactory.Parse( ref skinFileContents, objSkinFile.Attributes );
                    this.Message += objSkinFile.PrependASCXDirectives( this.ControlFactory.Registrations );
                }
                else if( objSkinFile.FileExtension == ".html" )
                {
                    string skinFileContents = objSkinFile.Contents;
                    ArrayList pathList = this.PathFactory.HTMLList;
                    // replace paths, process control tokens and convert html to ascx format
                    this.Message += this.PathFactory.Parse( ref skinFileContents, ref pathList, objSkinFile.SkinRootPath, ParseOption );
                    this.Message += this.ControlFactory.Parse( ref skinFileContents, objSkinFile.Attributes );
                    this.Message += objSkinFile.PrependASCXDirectives( this.ControlFactory.Registrations );
                }

                objSkinFile.Write();
                this.Message += objSkinFile.Messages;

                this.Message += SkinController.FormatMessage( FILE_END, Path.GetFileName( FileName ), 1, false );
            }

            this.Message += SkinController.FormatMessage( FILES_END, this.SkinRoot + " :: " + this.SkinName, 0, false );

            return this.Message;
        }
Exemplo n.º 9
0
        private async Task SaveProfileDataToCsv(FortniteProfileData data, FortniteAccount account)
        {
            // NOTE: Just in case, to prevent crash
            if (data.ProfileChanges.Count <= 0)
            {
                return;
            }

            var accountId = data.ProfileChanges[0].Profile.AccountId;

            var items = data.ProfileChanges[0].Profile.Item;

            var outfits    = SkinParser.GetOutfit(items);
            var backblings = SkinParser.GetBackBlings(items);
            var gliders    = SkinParser.GetGliders(items);
            var pickaxes   = SkinParser.GetPickaxes(items);

            var userProfileData = data.ProfileChanges[0].Profile;

            var createdAt       = userProfileData.Created;
            var lastUpdated     = userProfileData.Updated;
            var hasBattlePass   = userProfileData.Stats.Attributes.BookPurchased;
            var currentPassTier = userProfileData.Stats.Attributes.BookLevel;
            var lifetimeWins    = userProfileData.Stats.Attributes.LifetimeWins;
            var currentLevel    = userProfileData.Stats.Attributes.Level;
            var accountLevel    = userProfileData.Stats.Attributes.AccountLevel;

            var oldSeasons = new List <OldSeason>();

            foreach (var season in userProfileData.Stats.Attributes.PastSeasons)
            {
                oldSeasons.Add(new OldSeason
                {
                    SeasonNumber        = season.SeasonNumber,
                    PurchasedBattlePass = season.PurchasedVip,
                    BattlePassLevel     = season.BookLevel,
                    SeasonLevel         = season.SeasonLevel,
                    SeasonWins          = season.NumWins
                });
            }

            var fullProfile = new FortniteAccountFullData
            {
                AccountData            = account,
                AccountId              = accountId,
                CreatedAt              = createdAt,
                LastUpdate             = lastUpdated,
                HasBattlePassPurchased = hasBattlePass,
                CurrentBattlePassLevel = currentPassTier,
                LifetimeTotalWins      = lifetimeWins,
                CurrentSeasonalLevel   = currentLevel,
                AccountLevel           = accountLevel,
                //PastSeasons = oldSeasons,
                Outfits    = outfits,
                Backblings = backblings,
                Gliders    = gliders,
                Pickaxes   = pickaxes
            };

            _csvWriter.WriteRecord(fullProfile);

            // Write the fields for each previous season manually because CsvHelper doesn't support List<T>
            var seasonStats = new StringBuilder();

            foreach (var season in oldSeasons)
            {
                seasonStats.AppendLine("Season number: " + season.SeasonNumber);
                seasonStats.AppendLine("Season wins: " + season.SeasonWins);
                seasonStats.AppendLine("Season level: " + season.SeasonLevel);
                seasonStats.AppendLine("Season pass: "******"Season pass level: " + season.BattlePassLevel);

                _csvWriter.WriteField(seasonStats);

                seasonStats.Clear();
            }

            // Finish the row after writing the season data and go to next
            await _csvWriter.NextRecordAsync();

            _textWriter.Flush();
        }
Exemplo n.º 10
0
            /// <summary>
            /// Perform parsing on the specified source file.
            /// </summary>
            /// <param name="Source">Pointer to Source string to be parsed.</param>
            /// <param name="RegexList">ArrayList of properly formatted regular expression objects.</param>
            /// <param name="SkinPath">Path to use in replacement operation.</param>
            /// <remarks>
            /// This procedure iterates through the list of regular expression objects
            /// and invokes a handler for each match which uses the specified path.
            /// </remarks>
            public string Parse(ref string Source, ref ArrayList RegexList, string SkinPath, SkinParser ParseOption)
            {
                m_Messages = "";

                // set path propery which is file specific
                this.SkinPath = SkinPath;
                // set parse option
                this.ParseOption = ParseOption;

                // process each regular expression
                int i;

                for (i = 0; i <= RegexList.Count - 1; i++)
                {
                    Source = ((Regex)RegexList[i]).Replace(Source, this.Handler);
                }

                return(m_Messages);
            }