public override void UpdateNode(ModelNode node) { if (((IModelClass)node.Parent).TypeInfo.Type == typeof(FDSSCustomer)) { IModelNode modelNode = node.GetNode("SkinFilterProvider"); modelNode.Remove(); } }
protected override void UpdateCachedNodes(ModelNode node) { if (node.GetNode(ModelAdapterContextsNodeGenerator.Default) == null) { GenerateDefaultNode(node); GenerateAttributeNodes(node); } }
protected override void GenerateNodesCore(ModelNode node) { Type[] typelist = GetTypesInNamespace(assembly, nameSpace); for (int i = 0; i < typelist.Length; i++) { string childNodeName = typelist[i].Name; node.AddNode<IModelCustomDataSource>(childNodeName); ((IModelCustomDataSource)node.GetNode(childNodeName)).Description = typelist[i].Name; //((IModelCustomDataSource)node.GetNode(childNodeName)).CustomDataSourceTypeName = typelist[i].ToString(); ((IModelCustomDataSource)node.GetNode(childNodeName)).CustomDataSourceType = typelist[i]; // Выходной тип linq-запроса Type baseType = typelist[i].BaseType; Type[] paramTypes = baseType.GetGenericArguments(); foreach (Type type in paramTypes) { ((IModelCustomDataSource)node.GetNode(childNodeName)).ObjectType = type; break; } } }
public static void GenerateNodesCoreSub(ModelNode node) { IList<Type> typelist = CustomCollectionSourceManager.CollectionTypes; //IList<Type> typelist = AutoGetTypes(); foreach (Type type in typelist) { string childNodeName = type.Name; node.AddNode<IModelCustomDataSource>(childNodeName); ((IModelCustomDataSource)node.GetNode(childNodeName)).Description = type.Name; ((IModelCustomDataSource)node.GetNode(childNodeName)).CustomDataSourceType = type; // Паша!!! Переписать правильно для определения типа результата Type baseType = type.BaseType; if (baseType != null) { Type[] paramTypes = baseType.GetGenericArguments(); foreach (Type typepar in paramTypes) { ((IModelCustomDataSource)node.GetNode(childNodeName)).ObjectType = typepar; break; } } } }
static bool CanBeRemoved(ModelNode modelNode1) { if (modelNode1.IsRemovedNode) { for (int i = modelNode1.NodeCount - 1; i >= 0; i--) { if (!CanBeRemoved(modelNode1.GetNode(i))) { return(false); } } return(!modelNode1.IsNewNode); } return(false); }