/// <summary> /// Registers a given <see cref="IDataStoreModel"/> and generates a <see cref="IEditorDrawable"/> /// view for the model. /// </summary> /// <param name="model">Model to register.</param> /// <returns>A new view setup to push messages back to the model.</returns> public IEditorDrawable RegisterModel(IDataStoreModel model) { if (model is DataStoreModel<CollectionComponentDataStore>) return RegisterModel(model as DataStoreModel<CollectionComponentDataStore>); else return RegisterModel(model as DataStoreModel<SingleComponentDataStore>); }
/// <summary> /// Registers a given <see cref="IDataStoreModel"/> and generates a <see cref="IEditorDrawable"/> /// view for the model. /// </summary> /// <param name="model">Model to register.</param> /// <returns>A new view setup to push messages back to the model.</returns> public IEditorDrawable RegisterModel(IDataStoreModel model) { if (model is DataStoreModel <CollectionComponentDataStore> ) { return(RegisterModel(model as DataStoreModel <CollectionComponentDataStore>)); } else { return(RegisterModel(model as DataStoreModel <SingleComponentDataStore>)); } }
/// <summary> /// Registers a given <see cref="IDataStoreModel"/> and generates a <see cref="IEditorDrawable"/> /// view for the model. /// </summary> /// <param name="model">Model to register.</param> /// <returns>A new view setup to push messages back to the model.</returns> public IEditorDrawable RegisterModel(IDataStoreModel model) { try { if (model is DataStoreModel <CollectionComponentDataStore> ) { return(RegisterModel(model as DataStoreModel <CollectionComponentDataStore>)); } else { return(RegisterModel(model as DataStoreModel <SingleComponentDataStore>)); } } catch (TypeLoadException e) { //This can happen if we're storing information that is no longer in the component //We'll add error view handling if we can't handle it with user interaction. throw; } }