public CustomerListViewModel() { m_modelLoader = IsInDesignMode ? (IModelLoader) new DesignDataModelService() : new SampleModelLoaderService(); Customers = m_modelLoader.LoadCustomers(); }
/// <summary> /// Loads a skin file from the specified <paramref name="reader"/> and returns the root UIElement. /// </summary> /// <param name="reader">The reader containing the XAML contents of the skin file.</param> /// <param name="actualResourceBundle">Resource bundle which contains the skin file with the given path.</param> /// <param name="loader">Loader callback for GUI models.</param> /// <returns><see cref="UIElement"/> descendant corresponding to the root element in the /// specified skin file.</returns> protected static object Load(TextReader reader, ISkinResourceBundle actualResourceBundle, IModelLoader loader) { try { Parser parser = new Parser(reader, parser_ImportNamespace, parser_GetEventHandler); parser.SetCustomTypeConverter(MPF.ConvertType); parser.SetContextVariable(typeof(IModelLoader), loader); parser.SetContextVariable(typeof(ISkinResourceBundle), actualResourceBundle); return parser.Parse(); } catch (Exception e) { throw new XamlLoadException("XAML loader: Error reading XAML file from text reader", e); } }
/// <summary> /// Loads the specified skin file and returns the root UIElement. /// </summary> /// <param name="skinFilePath">The path to the XAML skin file.</param> /// <param name="actualResourceBundle">Resource bundle which contains the skin file with the given path.</param> /// <param name="loader">Loader callback for GUI models.</param> /// <returns><see cref="UIElement"/> descendant corresponding to the root element in the /// specified skin file.</returns> public static object Load(string skinFilePath, ISkinResourceBundle actualResourceBundle, IModelLoader loader) { try { using (TextReader reader = new StreamReader(skinFilePath)) return Load(reader, actualResourceBundle, loader); } catch (XamlLoadException e) { // Unwrap the exception thrown by Load(TextReader) throw new XamlLoadException("XAML loader: Error parsing file '{0}'", e.InnerException, skinFilePath); } catch (Exception e) { throw new XamlLoadException("XAML loader: Error parsing file '{0}'", e, skinFilePath); } }
public MainViewModel() { m_modelLoader = IsInDesignMode ? (IModelLoader)new DesignDataModelService() : new SampleModelLoaderService(); Customers = m_modelLoader.LoadCustomers(); CustomerDetailsCommand = new OpenCustomerDetaisCommand(); CustomerDetailsCommand.AfterExecuted += a_customer => { if (a_customer == null || Customers.Contains(a_customer)) { return; } Customers.Add(a_customer); }; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="loader">The model loader</param> public SinglePageModel(IApi api, IModelLoader loader) : base(api, loader) { }
/// <summary> Accepts IModelLoader (Visitor pattern). </summary> /// <param name="tile">Tile.</param> /// <param name="loader">IModelLoader instance.</param> public abstract void Accept(Tile tile, IModelLoader loader);
public ElementVisitor(Tile tile, IModelLoader modelLoader, IObjectPool objectPool) { Tile = tile; ModelLoader = modelLoader; ObjectPool = objectPool; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="loader">The model loader</param> public SinglePageWithComments(IApi api, IModelLoader loader) : base(api, loader) { }
/// <summary> /// Loads a skin file from the specified <paramref name="reader"/> and returns the root UIElement. /// </summary> /// <param name="reader">The reader containing the XAML contents of the skin file.</param> /// <param name="actualResourceBundle">Resource bundle which contains the skin file with the given path.</param> /// <param name="loader">Loader callback for GUI models.</param> /// <returns><see cref="UIElement"/> descendant corresponding to the root element in the /// specified skin file.</returns> protected static object Load(TextReader reader, ISkinResourceBundle actualResourceBundle, IModelLoader loader) { try { Parser parser = new Parser(reader, parser_ImportNamespace, parser_GetEventHandler); parser.SetCustomTypeConverter(MPF.ConvertType); parser.SetContextVariable(typeof(IModelLoader), loader); parser.SetContextVariable(typeof(ISkinResourceBundle), actualResourceBundle); return(parser.Parse()); } catch (Exception e) { throw new XamlLoadException("XAML loader: Error reading XAML file from text reader", e); } }
public MeshSceneObjectComponent(IModelLoader modelLoader, string modelSource) { ModelLoader = modelLoader; MdlSource = modelSource; }
public override void Load(XmlElement xmlNode) { base.Load(xmlNode); if (xmlNode.HasAttribute("Occluder")) { isOccluder = bool.Parse(xmlNode.GetAttribute("Occluder")); } if (xmlNode.HasAttribute("IgnoreDepth")) { ignoreDepth = bool.Parse(xmlNode.GetAttribute("IgnoreDepth")); } if (xmlNode.HasAttribute("AddToPhysicsEngine")) { AddToPhysicsEngine = bool.Parse(xmlNode.GetAttribute("AddToPhysicsEngine")); } int i = 0; if (xmlNode.ChildNodes[i].Name.Equals("ModelCreationInfo")) { XmlElement modelInfo = (XmlElement)xmlNode.ChildNodes[i]; if (modelInfo.HasAttribute("ResourceName")) { if (!modelInfo.HasAttribute("ModelLoaderName")) { throw new GoblinException("ModelLoaderName attribute is required if " + "ResourceName attribute is specified"); } String assetName = Path.ChangeExtension(modelInfo.GetAttribute("ResourceName"), null); IModelLoader loader = (IModelLoader)Activator.CreateInstance(Type.GetType( modelInfo.GetAttribute("ModelLoaderName"))); model = (IModel)loader.Load("", assetName); } else { if (!modelInfo.HasAttribute("CustomShapeParameters")) { throw new GoblinException("CustomShapeParameters attribute must be " + "specified if ResourceName is not specified"); } String[] primShapeParams = modelInfo.GetAttribute("CustomShapeParameters").Split(','); model = (IModel)Activator.CreateInstance(Type.GetType(xmlNode.ChildNodes[i + 1].Name), primShapeParams); } model.Load((XmlElement)xmlNode.ChildNodes[i + 1]); i += 2; } material = (Material)Activator.CreateInstance(Type.GetType(xmlNode.ChildNodes[i].Name)); material.Load((XmlElement)xmlNode.ChildNodes[i]); physicsProperties = (IPhysicsObject)Activator.CreateInstance(Type.GetType( xmlNode.ChildNodes[i + 1].Name)); physicsProperties.Load((XmlElement)xmlNode.ChildNodes[i + 1]); physicsProperties.Container = this; if (model is IPhysicsMeshProvider) { physicsProperties.MeshProvider = (IPhysicsMeshProvider)model; } physicsProperties.Model = model; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="loader">The model loader</param> public SinglePost(IApi api, IModelLoader loader) { _api = api; _loader = loader; }
/// <inheritdoc /> public override void Accept(Tile tile, IModelLoader loader) { loader.CompleteTile(tile); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> /// <param name="loader">The model loader</param> public ArchivePage(IApi api, IModelLoader loader) : base(api, loader) { }
public BlogOverviewController(IApi api, IModelLoader loader, IApplicationService service) { _api = api; _loader = loader; _service = service; }
public ContactPageModel(Services.IMailService mailService, IApi api, IModelLoader loader, ILogger <ContactPageModel> logger) : base(api, loader) { _mailService = mailService; _logger = logger; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api"></param> /// <param name="loader"></param> public ArchiveModel(IApi api, IModelLoader loader) : base() { _api = api; _loader = loader;; }
/// <inheritdoc /> public WayVisitor(Tile tile, IModelLoader modelLoader, IObjectPool objectPool) : base(tile, modelLoader, objectPool) { }
public CmsController(IApi api, IModelLoader loader) { _api = api; _loader = loader; }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> public StartPageController(IApi api, IModelLoader loader) { _api = api; _loader = loader; }
/// <inheritdoc /> public override void Accept(Tile tile, IModelLoader loader) { loader.LoadNode(tile, this); }
/// <summary> /// Default constructor. /// </summary> /// <param name="api">The current api</param> public CmsController(IApi api, IModelLoader loader, IAdapterEngine adapterEngine) { _api = api; _loader = loader; _adapterEngine = adapterEngine; }
internal AddressParser(ITagger tagger, IModelLoader modelLoader, IFormatter <Address> formatter) { Tagger = tagger; HMM = modelLoader.LoadHMM(); Formatter = formatter; }
public ApiController(IApi api, IDb db, IModelLoader loader) { _api = api; _db = db; _loader = loader; }
public ModelCollectionLoader(IDirectoryLocator directoryLocator, IModelLoader modelLoader, ILogger logger) { _directoryLocator = directoryLocator; _logger = logger; _modelLoader = modelLoader; }
/// <summary> /// Loads the specified skin file and returns the root UIElement. /// </summary> /// <param name="skinFilePath">The path to the XAML skin file.</param> /// <param name="actualResourceBundle">Resource bundle which contains the skin file with the given path.</param> /// <param name="loader">Loader callback for GUI models.</param> /// <returns><see cref="UIElement"/> descendant corresponding to the root element in the /// specified skin file.</returns> public static object Load(string skinFilePath, ISkinResourceBundle actualResourceBundle, IModelLoader loader) { try { using (TextReader reader = new StreamReader(skinFilePath)) return(Load(reader, actualResourceBundle, loader)); } catch (XamlLoadException e) { // Unwrap the exception thrown by Load(TextReader) throw new XamlLoadException("XAML loader: Error parsing file '{0}'", e.InnerException, skinFilePath); } catch (Exception e) { throw new XamlLoadException("XAML loader: Error parsing file '{0}'", e, skinFilePath); } }
public TeaserPageModel(IApi api, IModelLoader loader, IDb db) : base(api, loader) { _db = db; }