Пример #1
0
 public void GenerateCSharpReader(string namespaceName, string path)
 {
     using (var stream = new LrpStream(path))
     {
         stream.WriteLine("using System;");
         stream.WriteLine("using SoftFX.Lrp;");
         stream.WriteLine("using System.Collections.Generic;");
         stream.WriteLine();
         this.types.GenerateCSharpReader(namespaceName, stream);
         this.Components.GenerateCSharpReader(namespaceName, stream);
     }
 }
Пример #2
0
 public void GenerateCppSourceWriter(DataTypes types, LrpStream stream)
 {
     stream.WriteLine("LrpWrite{0}(\"{1}\", {1}, _stream);", this.Type.Suffix, this.Name);
 }
Пример #3
0
 public void GenerateCppLocalServerResponse(LrpStream stream)
 {
     if (this.Direction == ParameterDirection.InOut || this.Direction == ParameterDirection.Out)
         stream.WriteLine("Write{0}(arg{1}, buffer);", this.Type.Suffix, this.Id);
 }
Пример #4
0
 public void GenerateCppResponse(LrpStream stream)
 {
     if (this.Direction == ParameterDirection.InOut || this.Direction == ParameterDirection.Out)
     {
         stream.WriteLine("{0} = Read{1}(buffer);", this.Name, this.Type.Suffix);
     }
 }
Пример #5
0
 public void GenerateCppRequest(LrpStream stream)
 {
     if (this.Direction == ParameterDirection.In || this.Direction == ParameterDirection.InOut)
         stream.WriteLine("Write{0}({1}, buffer);", this.Type.Suffix, this.Name);
 }
Пример #6
0
 public void GenerateCSharpMemberReader(LrpStream stream)
 {
     var defaultValue = this.Default;
     if (defaultValue == null)
         stream.WriteLine("var {0} = stream.Read{1}(\"{0}\");", this.Name, this.Type.Suffix);
     else
         stream.WriteLine("var {0} = stream.Read{1}(\"{0}\", {2});", this.Name, this.Type.Suffix, defaultValue);
 }