示例#1
0
 public PyEventClassBuilder(string baseClass, Type classType = null)
 {
     this._itw          = new IndentedTextWriter(this._sw);
     this.BaseClassName = baseClass;
     this.ClassName     = PyVariableManager.GetFreeVariableName() + baseClass.Replace(".", string.Empty);;
     if (classType != null)
     {
         this.EventDest = classType.FullName;
     }
 }
示例#2
0
        public PyFunctionBuilder(string functionName)
        {
            if (functionName == null)
            {
                functionName = "_f" + PyVariableManager.GetFreeVariableName();
            }
            this.Name   = functionName;
            this.Writer = new IndentedTextWriter(this._sw);

            // TODO: arguments (when and if they will be needed)
            Writer.WriteLine(string.Format("def {0}():", this.Name));
            Writer.Indent++;
        }