Microsoft.Practices.Prism.MefExtensions.Modularity.MefFileModuleTypeLoader.CanLoadModuleType C# (CSharp) Method

CanLoadModuleType() public method

Evaluates the ModuleInfo.Ref property to see if the current typeloader will be able to retrieve the moduleInfo. Returns true if the ModuleInfo.Ref property starts with "file://", because this indicates that the file is a local file.
public CanLoadModuleType ( ModuleInfo moduleInfo ) : bool
moduleInfo Microsoft.Practices.Prism.Modularity.ModuleInfo Module that should have it's type loaded.
return bool
        public virtual bool CanLoadModuleType(ModuleInfo moduleInfo)
        {
            if (moduleInfo == null)
            {
                throw new System.ArgumentNullException("moduleInfo");
            }

            return moduleInfo.Ref != null && moduleInfo.Ref.StartsWith(RefFilePrefix, StringComparison.Ordinal);
        }

Usage Example

        public void CanLoadModulesWithUrlThatHaveFilePrefix()
        {
            MefFileModuleTypeLoader loader = new MefFileModuleTypeLoader();
            ModuleInfo info = this.CreateModuleInfo();

            bool canLoad = loader.CanLoadModuleType(info);

            Assert.IsTrue(canLoad);
        }
All Usage Examples Of Microsoft.Practices.Prism.MefExtensions.Modularity.MefFileModuleTypeLoader::CanLoadModuleType