<%@ Property Name="ClassNames" Type="System.String[]" Category="Context" Description="The names of the classes to be generated." %> <% string version = "3"; %> <% string nm = ""; %> <% string id = ""; %> <% string[] splt = null; %> #region ParseTags private void ParseTags() { SwfActionId id = ((SwfActionId)r.GetByte()); while(id != SwfActionId.End) { switch(id) { <% for(int i = 0; i < ClassNames.Length; i++) %> <% { string ln = ClassNames[i]; %> <% if(ln == "") %> <% { %> <% continue;}else if(ln.StartsWith(@"//")) %> <% { %> <% version = ln.Substring(2,1); %> // Version <%= version %> Tags <% continue;}else if(ln.IndexOf(",") != -1) %> <% { %> <% splt = ln.Split(new Char[]{','}); %> <% nm = splt[1]; %> <% id = splt[0]; %> <% string tabLine = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; %> <% string tbs = tabLine.Substring(0, 6-((int)(nm.Length/4))); %> <% if(splt.Length < 3){ %> case SwfActionId.<%= nm %> : { actions.Add(new <%= nm %>Action()); break; } <% } else { %> case SwfActionId.<%= nm %> : { Parse<%= nm %>(); break; } <% } %> <% } %> <% } %> default : { throw(new InvalidCastException( "Invalid swf action tag: 0x" + ((byte)id).ToString("X2") )); } } id = ((SwfActionId)r.GetByte()); } } #endregion // temp private object todo = new object(); <% for(int i = 0; i < ClassNames.Length; i++) %> <% { string ln = ClassNames[i]; %> <% if(ln == "" || ln.StartsWith(@"//")) %> <% { continue; %> <% } %> <% else if(ln.IndexOf(",") != -1) %> <% { %> <% splt = ln.Split(new Char[]{','}); %> <% if(splt.Length > 2) %> <% { nm = splt[1]; %> <% id = splt[0]; %> #region Parse<%= nm %> private void Parse<%= nm %>() { <%= nm %>Action tag = new <%= nm %>Action(); <% for(int j = 2; j < splt.Length; j+=2) %> <% { %> <% string propName = splt[j]; %> <% string propType = splt[j+1]; %> <% if(propType == "bool") %> <% { %> tag.<%= propName %> = r.GetBit(); <% } %> <% else if(propType == "uint") %> <% { %> tag.<%= propName %> = r.GetUI16(); <% } %> <% else if(propType == "double") %> <% { %> //tag.<%= propName %> = r.GetUI32(); <% } %> <% else if(propType == "float") %> <% { %> //tag.<%= propName %> = r.GetFixedBits(bits); <% } %> <% else if(propType == "byte") %> <% { %> tag.<%= propName %> = r.GetByte(); <% } %> <% else if(propType == "string") %> <% { %> tag.<%= propName %> = r.GetString(); <% } %> <% else if(propType == "string[]") %> <% { %> while(false) { //tag.<%= propName %> = r.GetString(); } <% } %> <% else %> <% { %> //tag.<%= propName %> = r.GetBytes(); <% } %> <% } %> actions.Add(tag); } #endregion <% } %> <% } %> <% } %>