Ejemplo n.º 1
0
        void GenerateAll(ModelNode node, IModelMergedDifferenceStrategyIncludedNodePaths modelMergedDifferenceStrategyNodePaths)
        {
            var modelApplicationCreator = ((ModelNode)node.Application.Views).CreatorInstance;
            var modelNodeInfo           = modelApplicationCreator.GetNodeInfo(typeof(IModelDetailView));

            GenerateNodePath(modelNodeInfo, modelMergedDifferenceStrategyNodePaths, ViewType.DetailView);
            modelNodeInfo = modelApplicationCreator.GetNodeInfo(typeof(IModelListView));
            GenerateNodePath(modelNodeInfo, modelMergedDifferenceStrategyNodePaths, ViewType.ListView);
        }
Ejemplo n.º 2
0
 void RemoveNodes(IModelMergedDifferenceStrategyIncludedNodePaths nodePaths, Func <HashSet <string>, string, bool> func)
 {
     for (int i = nodePaths.NodeCount - 1; i >= 0; i--)
     {
         var modelNode = nodePaths.GetNode(i);
         var value     = modelNode.Id();
         if (func.Invoke(LayoutNodeNames, value))
         {
             modelNode.Remove();
         }
     }
 }
Ejemplo n.º 3
0
        void GenerateNodePath(ModelNodeInfo modelNodeInfo, IModelMergedDifferenceStrategyIncludedNodePaths modelMergedDifferenceStrategyNodePaths, ViewType viewType)
        {
            var names = ((IEnumerable <object>)modelNodeInfo.GetPropertyValue("ChildrenInfo")).Select(o => o.GetPropertyValue("Name")).Cast <string>();

            foreach (var name in names)
            {
                var path = modelMergedDifferenceStrategyNodePaths[name];
                if (path == null)
                {
                    var nodePath = modelMergedDifferenceStrategyNodePaths.AddNode <IModelMergedDifferenceStrategyIncludedNodePath>(name);
                    nodePath.NodePath = name;
                    nodePath.ViewType = viewType;
                }
                else
                {
                    path.ViewType = ViewType.Any;
                }
            }
        }