private void DrawTypeListItem(ReferencedType t) { var labelContent = new GUIContent(); EditorGUILayout.BeginVertical("Box"); EditorGUILayout.BeginHorizontal(SharedStyles.BuiltIn.listItemHeader); labelContent.text = t.fullName; EditorGUILayout.LabelField(labelContent); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical("Box"); labelContent.text = "Referenced by"; EditorGUILayout.LabelField(labelContent, SharedStyles.BuiltIn.centeredWrappedText); t.expanded = EditorGUI.Foldout(GUILayoutUtility.GetLastRect(), t.expanded, GUIContent.none, true); if (t.expanded) { foreach (var aiRef in t.referencingAIs) { labelContent.text = aiRef.name; EditorGUILayout.LabelField(labelContent); } } EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); }
private T CreateCyclicInstance <T> (IPipeline pipeline) where T : ReferencingSerializableType { var instance = pipeline.Create <T> (); var referenceObject = new ReferencedType(); instance.ReferencedObject = referenceObject; referenceObject.ReferencingObject = instance; return(instance); }
public void TestMethod() { var a = new ReferencedType(); a.ReferencedMethod(); var b = a.ReferencedProperty; a.ReferencedProperty2 = b; }
private void Investigate(AIStorage[] ais) { var availableTypes = from t in ApexReflection.GetRelevantTypes() where !t.IsAbstract && (!_excludeApexTypes || t.Namespace == null || !t.Namespace.StartsWith("Apex.AI")) && (t.IsDefined <ApexSerializedTypeAttribute>(true) || SerializationMaster.GetSerializedProperties(t).Any() || SerializationMaster.GetSerializedFields(t).Any()) orderby t.FullName select new TypeNameTokens(t.AssemblyQualifiedName); var aiLookup = new Dictionary <string, ReferencingAI>(StringComparer.Ordinal); foreach (var ai in ais) { aiLookup.Add(ai.aiId, new ReferencingAI(ai.name)); } _referencedTypes.Clear(); _unreferencedTypes.Clear(); foreach (var t in availableTypes) { var refType = new ReferencedType(t.fullTypeName); foreach (var ai in ais) { if (ai.configuration.Contains(t.completeTypeName)) { var refAI = aiLookup[ai.aiId]; refAI.referencedTypes.Add(refType); refType.referencingAIs.Add(refAI); } } if (refType.referencingAIs.Count > 0) { _referencedTypes.Add(refType); } else { _unreferencedTypes.Add(t); } } _referencingAIs = (from ai in aiLookup.Values where ai.referencedTypes.Count > 0 orderby ai.name select ai).ToArray(); _step = Step.Result; _owner.Repaint(); }
private Schema CreateReferenceSchema(Type type) { var referencedType = _referencedTypes.FirstOrDefault(rt => rt.Type == type); if (referencedType == null) { referencedType = new ReferencedType { Type = type, SchemaId = GetSchemaIdFor(type) }; _referencedTypes.Add(referencedType); } return(new Schema { Ref = "#/definitions/" + referencedType.SchemaId }); }
public override string ToString() { if (TypeName != null) { return(TypeName); } if (ReferencedType != null) { return("{" + ReferencedType.ToString() + "}"); } if (Raw != null) { return(Raw.ToString()); } return("<TypeRef>"); }
public ReferencedType GetAType() { referencedType = new ReferencedType(); return(referencedType); }
public override void ClearValue() { ValueModel.Value = DataContext.CreateCompoundObject(DataContext.GetInterfaceType(ReferencedType.GetDataType())); }
internal T GetAttribute <T>() where T : Attribute => Type.GetAttribute <T>() ?? ReferencedType.GetAttribute <T>();
public ReferencedType GetAType () { referencedType = new ReferencedType (); return referencedType; }