예제 #1
0
        /// <summary> Default constructor: sets up the Velocity
        /// Runtime, creates the visitor for traversing
        /// the node structure and then produces the
        /// visual representation by the visitation.
        /// </summary>
        public TemplateNodeView(System.String template)
        {
            try {
                RuntimeSingleton.init("velocity.properties");

                System.IO.StreamReader isr = new InputStreamReader(new System.IO.FileStream(template, System.IO.FileMode.Open, System.IO.FileAccess.Read), RuntimeSingleton.getString(RuntimeSingleton.INPUT_ENCODING))
                ;

                //UPGRADE_ISSUE: The equivalent of constructor 'java.io.BufferedReader.BufferedReader' is incompatible with the expected type in C#. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1109"'
                System.IO.StreamReader br = new System.IO.StreamReader(isr.BaseStream);

                document = RuntimeSingleton.parse(br, template)
                ;

                visitor         = new NodeViewMode();
                visitor.Context = null;
                //UPGRADE_ISSUE: The equivalent of parameter java.lang.System.out is incompatible with the expected type in C#. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1109"'
                visitor.Writer = new System.IO.StreamWriter(System.Console.Out);
                document.jjtAccept(visitor, null);
            } catch (System.Exception e) {
                System.Console.Out.WriteLine(e);
                SupportClass.WriteStackTrace(e, Console.Error);
            }
        }
예제 #2
0
 /// <summary>
 /// initialize the Velocity runtime engine, using default properties
 /// plus the properties in the passed in java.util.Properties object
 /// </summary>
 /// <param name="p">
 /// Proprties object containing initialization properties
 /// </param>
 public static void Init(ExtendedProperties p)
 {
     RuntimeSingleton.init(p);
 }
예제 #3
0
 /// <summary>
 /// initialize the Velocity runtime engine, using default properties
 /// plus the properties in the properties file passed in as the arg
 /// </summary>
 /// <param name="propsFilename">
 /// file containing properties to use to initialize
 /// the Velocity runtime
 /// </param>
 public static void Init(String propsFilename)
 {
     RuntimeSingleton.init(propsFilename);
 }
예제 #4
0
 /// <summary>
 /// initialize the NVelocity runtime engine, using the default
 /// properties of the NVelocity distribution
 /// </summary>
 public static void Init()
 {
     RuntimeSingleton.init();
 }