public Method(Operation method, Context context, Element element, Class cls) { _context = context; Name = _context.CTSKeyWord[method.Name]; Notes = method.Notes ?? ""; Id = method.Id; IsAbstract = method.Abstract == "1"; IsLocking = !(method.IsQuery); Class = cls; if (Name.StartsWith("operator")) { char[] c = new char[] { ' ' }; string[] str = Name.Split(c); if (str.Length == 2) { CTSType t = context.GetCTSType(str[1], element); Name = str[0] + " " + t.Value; ReturnType = t; } } else { ReturnType = context.GetCTSType(method.Type, element); } int i = 0; foreach (var parameter in method.Params) { Parameter p = new Parameter(parameter, element, context); Parameters.Add(parameter.Pos ?? i, p); ++i; } }
public Parameter(OperationParam parameter, Element element, Context context) { Name = context.CTSKeyWord[parameter.Name]; Notes = parameter.Notes; Default = parameter.Default ?? ""; ParameterType = context.GetCTSType(parameter.Type, element); }