private void DecompileDefaultProperties(TextBuilder result) { result.Append("defaultproperties\n{\n").PushIndent(); var defaultsExport = _defaults.Resolve(); UnPropertyList propertyList = Package.ReadPropertyList(defaultsExport, this); foreach (UnProperty prop in propertyList.Properties) { var name = prop.Name; if (name.StartsWith("__") && name.EndsWith("__Delegate")) { name = name.Substring(2, name.Length - 2 - 10); } if (prop.Value is UnPropertyArray) { var array = (UnPropertyArray)prop.Value; for (int i = 0; i < array.Count; i++) { result.Indent().Append(name).Append("(").Append(i).Append(")=") .Append(ValueToString(array [i], array.ElementType)).NewLine(); } } else { result.Indent().Append(name).Append("=").Append(ValueToString(prop.Value, prop.Type)).NewLine(); } } foreach (UnExport export in defaultsExport.Children) { result.Indent().Append("// child object " + export.ObjectName + " of type " + export.ClassName).NewLine(); } result.Append("}").NewLine().PopIndent(); }
internal UnExport FindMemberExport(string name) { var export = _self.Children.SingleOrDefault(e => e.ObjectName == name); if (export != null) { return(export); } var superExport = _super.Resolve(); if (superExport != null) { var superClass = superExport.ReadInstance() as UnContainer; if (superClass != null) { return(superClass.FindMemberExport(name)); } } return(null); }