public static void Assign(CreateCustomModelSynchronizerEventArgs e, IModelSynchronizable modelSynchronizer) { var modelSynchronizerList = e.ModelSynchronizer as ModelSynchronizerList; if (modelSynchronizerList == null) { e.ModelSynchronizer = new ModelSynchronizerList(); } var synchronizerList = ((ModelSynchronizerList)e.ModelSynchronizer); synchronizerList.Add(modelSynchronizer); }
public static void Assign <TModelAdaptorRule, TModelModelAdaptorRule>(CreateCustomModelSynchronizerEventArgs e, IModelSynchronizable modelSynchronizer, Frame frame, Func <TModelModelAdaptorRule, IModelSynchronizable> func) where TModelAdaptorRule : IModelAdaptorRule where TModelModelAdaptorRule : IModelNode { var modelAdaptorRuleController = frame.Controllers.ToList <Controller>().OfType <IModelAdaptorRuleController>().FirstOrDefault(); if (modelAdaptorRuleController != null) { modelAdaptorRuleController.ExecuteLogic(typeof(TModelAdaptorRule), typeof(TModelModelAdaptorRule), rule => Assign(e, func.Invoke((TModelModelAdaptorRule)rule))); } Assign(e, modelSynchronizer); }