protected void WriteVariable(VariableDef vd)
 {
     WriteLine(string.Format("variable \"{0}\", \"{1}\":", vd.Name, vd.TypeName));
     Indent(() =>
     {
         if (!string.IsNullOrEmpty(vd.DefaultValueExpr)) WriteLine("default_value {0}", vd.DefaultValueExpr);
         WriteLine("options {0}", BooHash(new Dictionary<string, object> {
             {"array", vd.IsArray},
             {"required", vd.IsRequired},
             {"dir", "VariableDef.Dir." + vd.VariableDir.ToString()}
         }));
     });
 }
Exemple #2
0
 /// <summary>
 /// Get the definition of internal task data structure (all variables)
 /// Warning: there are no required fields in the internal data schema. So any variable, even the required ones, can be skipped
 /// in an xml document.
 /// </summary>
 /// <returns></returns>
 public virtual StructDef GetInternalDataSchema()
 {
     if (ParentProcess == null) throw new Exception();
     StructDef sd = new StructDef();
     sd.ParentTypeSet = ParentProcess.DataTypes;
     foreach (VariableDef vd in Variables)
     {
         VariableDef vd2 = new VariableDef(vd); vd2.IsRequired = false;
         sd.Members.Add(vd2);
     }
     return sd;
 }
Exemple #3
0
 public VariableDef(VariableDef rhs) : base(rhs)
 {
     VariableDir = rhs.VariableDir; DefaultValueExpr = rhs.DefaultValueExpr;
 }
Exemple #4
0
 public VariableDef(VariableDef rhs) : base(rhs)
 {
     VariableDir = rhs.VariableDir; DefaultValueExpr = rhs.DefaultValueExpr;
 }