private void ProcessModelDeployment(object modelHost, ModelNode modelNode) { CurrentModelNodeIndex = 0; CurrentModelHost = modelHost; CurrentModelNode = modelNode; using (new TraceActivityScope(TraceService, (int)LogEventId.ModelProcessing, string.Format("ProcessModelDeployment for model:[{0}]", modelNode.Value.GetType()))) { ModelTraverseService.Traverse(modelHost, modelNode); } }
public override void DeployModel(ModelHostBase modelHost, ModelNode model) { Exceptions.Clear(); //var defaultTraserveService = ServiceContainer.Instance.GetService<ModelTreeTraverseServiceBase>(); //defaultTraserveService.OnModelHandlerResolve += ResolveDefaultModelHandler; //defaultTraserveService.Traverse(modelHost, model); ModelTraverseService.OnModelHandlerResolve += ResolveDefaultModelHandler; ModelTraverseService.Traverse(modelHost, model); if (Exceptions.Count > 0) { throw new SPMeta2ModelDeploymentException("Errors while validating the model", new SPMeta2AggregateException(Exceptions.OfType <Exception>())); } }
private void ProcessModelDeployment(object modelHost, ModelNode modelNode) { using (new TraceActivityScope(TraceService, (int)LogEventId.ModelProcessing, string.Format("ProcessModelDeployment for model:[{0}]", modelNode.Value.GetType()))) { ModelTraverseService.OnModelHandlerResolve += ResolveModelHandlerForNode; // these are hack due event propagation mis-disign ModelTraverseService.OnModelProcessing += (node) => { _activeModelNode = node; }; ModelTraverseService.OnModelProcessed += (node) => { _activeModelNode = null; }; // on model fully-partially processed events ModelTraverseService.OnModelFullyProcessing += (node) => { }; ModelTraverseService.OnModelFullyProcessed += (node) => { }; ModelTraverseService.OnChildModelsProcessing += (node, type, childNodels) => { }; ModelTraverseService.OnChildModelsProcessed += (node, type, childNodels) => { }; ModelTraverseService.Traverse(modelHost, modelNode); } }