Ejemplo n.º 1
0
        public static IEnumerable <string> GetExtensionDirectories(FrameworkName frameworkName)
        {
            IEnumerable <string> strs = Enumerable.Empty <string>();

            foreach (IBlendSdkInfo sdkInfoCompatibleWithFramework in BlendSdkHelper.GetSdkInfoCompatibleWithFramework(frameworkName))
            {
                strs = strs.Concat <string>(sdkInfoCompatibleWithFramework.GetExtensionDirectories(frameworkName));
            }
            return(strs);
        }
Ejemplo n.º 2
0
        internal static bool IsPathFromSDK(string path, FrameworkName frameworkName)
        {
            string templatePath = BlendSdkHelper.GetTemplatePath(frameworkName);

            if (string.IsNullOrWhiteSpace(templatePath))
            {
                return(false);
            }
            return(path.StartsWith(templatePath, StringComparison.OrdinalIgnoreCase));
        }
Ejemplo n.º 3
0
        public BlendSdkAssemblyResolver()
        {
            HashSet <string> strs = new HashSet <string>();

            strs.Add("System.Windows.Interactivity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Interactions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Controls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Effects, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("System.Windows.Interactivity, Version=2.0.5.0, Culture=neutral, PublicKeyToken=null");
            strs.Add("System.Windows.Interactivity, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Interactions, Version=2.0.5.0, Culture=neutral, PublicKeyToken=null");
            strs.Add("Microsoft.Expression.Interactions, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("System.Windows.Interactivity, Version=4.0.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("System.Windows.Interactivity, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Interactions, Version=4.0.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("Microsoft.Expression.Interactions, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Drawing, Version=4.0.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("Microsoft.Expression.Drawing, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Controls, Version=4.0.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("Microsoft.Expression.Controls, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Effects, Version=4.0.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("Microsoft.Expression.Effects, Version=4.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("System.Windows.Interactivity, Version=3.7.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("System.Windows.Interactivity, Version=3.7.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            strs.Add("Microsoft.Expression.Interactions, Version=3.7.5.0, Culture=neutral, PublicKeyToken=1a2c496f4b3bbc64");
            strs.Add("Microsoft.Expression.Interactions, Version=3.7.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
            this.librarySignatures = strs;
            this.PushPathIfExists(BlendSdkHelper.GetInteractivityPath(BlendSdkHelper.Silverlight3));
            this.PushPathIfExists(BlendSdkHelper.GetInteractivityPath(BlendSdkHelper.Wpf35));
            this.PushPathIfExists(BlendSdkHelper.GetInteractivityPath(BlendSdkHelper.Silverlight4));
            this.PushPathIfExists(BlendSdkHelper.GetInteractivityPath(BlendSdkHelper.Wpf4));
            this.PushPathIfExists(BlendSdkHelper.GetInteractivityPath(BlendSdkHelper.WindowsPhone7));
        }
Ejemplo n.º 4
0
        private bool ValidateProjectOrSampleTemplate(string vsTemplatePath, Microsoft.Expression.Project.Templates.VSTemplate vsTemplate)
        {
            bool flag;

            object[]    objArray;
            CultureInfo currentCulture;
            string      invalidTemplateElement;

            if (vsTemplate.TemplateData != null && vsTemplate.TemplateData.ExpressionBlendPrototypingEnabled && (!this.IsPrototypingEnabled || vsTemplate.TemplateData.ProjectSubType == "Silverlight" && !BlendSdkHelper.IsSdkInstalled(BlendSdkHelper.CurrentSilverlightVersion) || vsTemplate.TemplateData.ProjectSubType == "WPF" && !BlendSdkHelper.IsSdkInstalled(BlendSdkHelper.CurrentWpfVersion)))
            {
                return(false);
            }
            if (!this.ValidateTemplateType(vsTemplatePath, vsTemplate, "Project"))
            {
                return(false);
            }
            if (!this.ValidateAnyTemplate(vsTemplatePath, vsTemplate))
            {
                return(false);
            }
            bool flag1 = false;

            if (vsTemplate.TemplateContent.Items != null)
            {
                object[] items = vsTemplate.TemplateContent.Items;
                int      num   = 0;
                while (true)
                {
                    if (num >= (int)items.Length)
                    {
                        if (flag1)
                        {
                            return(true);
                        }
                        currentCulture         = CultureInfo.CurrentCulture;
                        invalidTemplateElement = StringTable.InvalidTemplateElement;
                        objArray = new object[] { "TemplateContent" };
                        this.LogTemplateLoadError(vsTemplatePath, string.Format(currentCulture, invalidTemplateElement, objArray));
                        return(false);
                    }
                    object obj = items[num];
                    VSTemplateTemplateContentProject vSTemplateTemplateContentProject = obj as VSTemplateTemplateContentProject;
                    if (vSTemplateTemplateContentProject != null)
                    {
                        if (vSTemplateTemplateContentProject.File == null)
                        {
                            CultureInfo cultureInfo = CultureInfo.CurrentCulture;
                            string      missingTemplateAttribute = StringTable.MissingTemplateAttribute;
                            object[]    objArray1 = new object[] { "Project", "File" };
                            this.LogTemplateLoadError(vsTemplatePath, string.Format(cultureInfo, missingTemplateAttribute, objArray1));
                            flag = false;
                            break;
                        }
                        else if (Microsoft.Expression.Framework.Documents.PathHelper.ValidatePath(vSTemplateTemplateContentProject.File) == null)
                        {
                            flag1 = true;
                        }
                        else
                        {
                            CultureInfo currentCulture1      = CultureInfo.CurrentCulture;
                            string      invalidTemplateValue = StringTable.InvalidTemplateValue;
                            object[]    file = new object[] { "File", vSTemplateTemplateContentProject.File };
                            this.LogTemplateLoadError(vsTemplatePath, string.Format(currentCulture1, invalidTemplateValue, file));
                            flag = false;
                            break;
                        }
                    }
                    if (obj is VSTemplateTemplateContentProjectItem)
                    {
                        CultureInfo cultureInfo1 = CultureInfo.CurrentCulture;
                        string      unsupportedTemplateElement = StringTable.UnsupportedTemplateElement;
                        object[]    objArray2 = new object[] { "ProjectItem" };
                        this.LogTemplateLoadError(vsTemplatePath, string.Format(cultureInfo1, unsupportedTemplateElement, objArray2));
                        flag = false;
                        break;
                    }
                    else if (!(obj is VSTemplateTemplateContentReferences))
                    {
                        num++;
                    }
                    else
                    {
                        CultureInfo currentCulture2 = CultureInfo.CurrentCulture;
                        string      str             = StringTable.UnsupportedTemplateElement;
                        object[]    objArray3       = new object[] { "References" };
                        this.LogTemplateLoadError(vsTemplatePath, string.Format(currentCulture2, str, objArray3));
                        flag = false;
                        break;
                    }
                }
                return(flag);
            }
            if (flag1)
            {
                return(true);
            }
            currentCulture         = CultureInfo.CurrentCulture;
            invalidTemplateElement = StringTable.InvalidTemplateElement;
            objArray = new object[] { "TemplateContent" };
            this.LogTemplateLoadError(vsTemplatePath, string.Format(currentCulture, invalidTemplateElement, objArray));
            return(false);
        }
Ejemplo n.º 5
0
        public static void PromptUserForMissingSdk(IServices services)
        {
            IConfigurationObject item = services.GetService <IConfigurationService>()["BlendSDK"];
            var variable = new < > f__AnonymousType2 <int, FrameworkName[], string, string, string, string> [3];

            FrameworkName[] wpf35 = new FrameworkName[] { BlendSdkHelper.Wpf35, BlendSdkHelper.Silverlight3 };
            variable[0] = new { SDKVersion = 3, SupportedPlatforms = wpf35, HyperlinkUri = "http://go.microsoft.com/fwlink/?LinkId=139656", SupressDialogPropertyName = "HideInstallSDKDialog", Message = StringTable.Blend3SdkUnavailable, HyperlinkMessage = StringTable.InstallBlend3SdkLink };
            FrameworkName[] wpf4 = new FrameworkName[] { BlendSdkHelper.Wpf4 };
            variable[1] = new { SDKVersion = 4, SupportedPlatforms = wpf4, HyperlinkUri = "http://go.microsoft.com/fwlink/?LinkId=183399", SupressDialogPropertyName = "HideInstall.NETFrameworkSDK4Dialog", Message = StringTable.Blend4SdkUnavailable, HyperlinkMessage = StringTable.InstallBlend4SdkLink };
            FrameworkName[] silverlight4 = new FrameworkName[] { BlendSdkHelper.Silverlight4 };
            variable[2] = new { SDKVersion = 4, SupportedPlatforms = silverlight4, HyperlinkUri = "http://go.microsoft.com/fwlink/?LinkId=183400", SupressDialogPropertyName = "HideInstallSilverlightSDK4Dialog", Message = StringTable.Blend4SdkUnavailable, HyperlinkMessage = StringTable.InstallBlend4SdkLink };
            var variable1 = variable;

            for (int i = 0; i < (int)variable1.Length; i++)
            {
                var             variable2          = variable1[i];
                bool            flag               = true;
                FrameworkName[] supportedPlatforms = variable2.SupportedPlatforms;
                int             num = 0;
                while (num < (int)supportedPlatforms.Length)
                {
                    if (BlendSdkHelper.IsSdkInstalled(supportedPlatforms[num]))
                    {
                        num++;
                    }
                    else
                    {
                        flag = false;
                        break;
                    }
                }
                if (flag)
                {
                    item.SetProperty(variable2.SupressDialogPropertyName, false);
                }
                else if (!BlendSdkHelper.ShouldDialogBeHidden(services, variable2.SupressDialogPropertyName))
                {
                    bool           flag1 = false;
                    string         friendlyFrameworkName = BlendSdkHelper.GetFriendlyFrameworkName(variable2.SupportedPlatforms[0]);
                    CultureInfo    currentCulture        = CultureInfo.CurrentCulture;
                    string         message          = variable2.Message;
                    object[]       sDKVersion       = new object[] { variable2.SDKVersion, friendlyFrameworkName };
                    string         str              = string.Format(currentCulture, message, sDKVersion);
                    CultureInfo    cultureInfo      = CultureInfo.CurrentCulture;
                    string         hyperlinkMessage = variable2.HyperlinkMessage;
                    object[]       objArray         = new object[] { variable2.SDKVersion, friendlyFrameworkName };
                    string         str1             = string.Format(cultureInfo, hyperlinkMessage, objArray);
                    MessageBoxArgs messageBoxArg    = new MessageBoxArgs()
                    {
                        Message          = str,
                        Button           = MessageBoxButton.OK,
                        Image            = MessageBoxImage.Exclamation,
                        AutomationId     = "BlendSdkDialog",
                        HyperlinkMessage = str1,
                        HyperlinkUri     = new Uri(variable2.HyperlinkUri)
                    };
                    if (services.GetService <IMessageDisplayService>().ShowMessage(messageBoxArg, out flag1) == MessageBoxResult.OK)
                    {
                        item.SetProperty(variable2.SupressDialogPropertyName, flag1);
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public static string GetTemplatePath(FrameworkName frameworkName)
 {
     return(BlendSdkHelper.GetPath(frameworkName, (FrameworkName framework, IBlendSdkInfo sdkInfo) => sdkInfo.GetTemplatePath(frameworkName)));
 }
Ejemplo n.º 7
0
 public static string GetInteractivityPath(FrameworkName frameworkName)
 {
     return(BlendSdkHelper.GetPath(frameworkName, (FrameworkName framework, IBlendSdkInfo sdkInfo) => sdkInfo.GetInteractivityPath(frameworkName)));
 }
Ejemplo n.º 8
0
 public static string GetFontTargetsFile(FrameworkName frameworkName)
 {
     return(BlendSdkHelper.GetPath(frameworkName, (FrameworkName framework, IBlendSdkInfo sdkInfo) => sdkInfo.GetFontTargetsFile(frameworkName)));
 }