Ejemplo n.º 1
0
        public static void AddToolkitReferenceIfNeeded(ITypeResolver typeResolver, ViewUpdateManager viewUpdateManager)
        {
            if (typeResolver == null || !typeResolver.IsCapabilitySet(PlatformCapability.VsmInToolkit) || !typeResolver.IsCapabilitySet(PlatformCapability.SupportsVisualStateManager))
            {
                return;
            }
            string toolkitPath = ToolkitHelper.GetToolkitPath();

            if (string.IsNullOrEmpty(toolkitPath))
            {
                return;
            }
            typeResolver.EnsureAssemblyReferenced(toolkitPath);
            viewUpdateManager.RebuildPostponedViews();
        }
Ejemplo n.º 2
0
 public static bool EnsureExtendedAssemblyReferences(ITypeResolver typeResolver, IAssemblyService assemblyService, ViewUpdateManager viewUpdateManager)
 {
     ToolkitHelper.AddToolkitReferenceIfNeeded(typeResolver, viewUpdateManager);
     if (assemblyService != null)
     {
         string   assemblyFullName1 = ((PlatformTypes)typeResolver.PlatformMetadata).InteractivityAssemblyFullName;
         string   assemblyFullName2 = ((PlatformTypes)typeResolver.PlatformMetadata).InteractionsAssemblyFullName;
         Assembly assembly1         = assemblyService.ResolveLibraryAssembly(new AssemblyName(assemblyFullName1));
         if (assembly1 != (Assembly)null)
         {
             Assembly assembly2 = assemblyService.ResolveLibraryAssembly(new AssemblyName(assemblyFullName2));
             if (assembly2 != (Assembly)null)
             {
                 bool flag = typeResolver.EnsureAssemblyReferenced(assembly1.Location) && typeResolver.EnsureAssemblyReferenced(assembly2.Location);
                 if (flag)
                 {
                     viewUpdateManager.RebuildPostponedViews();
                 }
                 return(flag);
             }
         }
     }
     return(false);
 }