Example #1
0
        public String exportScript(IScriptExporter exporter)
        {
            String script = "";
            KeyValuePair<String,String>[] values = new KeyValuePair<String,String>[m_parameters.Count];
            int i = 0;
            foreach (Parameter p in m_parameters)
            {
                values[i] = new KeyValuePair<String,String>(p.Name,p.Values);
                ++i;
            }
            script += exporter.callMacro(m_macro.RegisteredName,values);
            script += exporter.endCallMacro();

            return script;
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     m_exporter = m_exporterCombobox.SelectedItem as IScriptExporter;
     App app = Application.Current as App;
     FolderOption path = app.Config.getOption("Export Path") as FolderOption;
     m_save.InitialDirectory = path.Value;
     bool? result =  m_save.ShowDialog();
     if (result.HasValue && result.Value)
     {
         String filename = m_save.FileName;
         if (!filename.EndsWith(m_exporter.Extension))
         {
             filename += m_exporter.Extension;
         }
         this.SaveFile.Text = filename;
     }
 }
Example #3
0
        public String exportScript(IScriptExporter exporter)
        {
            StringBuilder script = new StringBuilder();
            if (m_type == ParameterType.COMPOUNDPARAMETER || m_type == ParameterType.SEQUENCEPARAMETER)
            {
                script.Append(exporter.beginParameter(m_name));
            }
            else
            {
                script.Append(exporter.setParameterValue(m_name, m_values, Type == ParameterType.ID || Type == ParameterType.STRING));
            }

            //script += exporter.beginParameter(m_subParamName);
            foreach (Parameter p in m_subParams)
            {
                script.Append(p.exportScript(exporter));
            }

            if (m_type == ParameterType.COMPOUNDPARAMETER || m_type == ParameterType.SEQUENCEPARAMETER)
            {
                script.Append(exporter.endParameter());
            }
            //script += exporter.endParameter();
            return script.ToString();
        }
Example #4
0
        public String exportScript(IScriptExporter exporter)
        {
            StringBuilder script = new StringBuilder();
            if (m_autoId)
            {
                script.Append(exporter.beginGameObject());
            }
            else
            {
                script.Append(exporter.beginGameObject(m_name));
            }

            foreach (Element c in m_elements)
            {
                if (c.Export)
                {
                    script.Append(c.exportScript(exporter));
                }
            }

            script.Append(exporter.endGameObject());
            return script.ToString();
        }
Example #5
0
 private String exportAsMacro(IScriptExporter exporter)
 {
     String macro = "";
     macro += exporter.beginMacroRegistration();
     foreach (Parameter p in Parameters)
     {
         macro += exporter.registerMacroParameter(p.Name, p.Type, p.Values.ToString(CultureInfo.GetCultureInfo("en-US")));
     }
     macro += exporter.endRegisterMacro();
     macro += exporter.beginMacroBody();
     foreach (GameObject g in m_scriptObjects)
     {
         macro += g.exportScript(exporter);
     }
     macro += exporter.endMacroBody();
     return macro;
 }
Example #6
0
 public String exportScript(IScriptExporter exporter)
 {
     StringBuilder script = new StringBuilder();
     if (IsMacro)
     {
         script.Append( exporter.beginMacroRegistration());
         foreach (Parameter p in this.Parameters)
         {
             script.Append(exporter.registerMacroParameter(p.Name, p.Type, p.Values.ToString(CultureInfo.GetCultureInfo("en-US"))));
         }
         script.Append(exporter.endMacroRegistration());
         script.Append(exporter.beginMacroBody());
     }
     else
     {
         script.Append(exporter.EntryPoint());
     }
     foreach (GameObject g in m_scriptObjects)
     {
         script.Append(g.exportScript(exporter));
     }
     if (IsMacro)
     {
         script.Append(exporter.endMacroBody());
     }
     else
     {
         script.Append(exporter.End());
     }
     return script.ToString();
 }
Example #7
0
        public String exportScript(IScriptExporter exporter)
        {
            StringBuilder script = new StringBuilder();

            script.Append(exporter.beginComponent(m_name));

            foreach (Parameter p in m_parameter)
            {
                script.Append(p.exportScript(exporter));
            }

            script.Append(exporter.endComponent());

            return script.ToString();
        }