コード例 #1
0
ファイル: LicensingHelper.cs プロジェクト: radtek/Shopdrawing
        public static ProjectLicenseGroup GetLicenseGroup(IProjectStore projectStore)
        {
            if (ProjectStoreHelper.IsSketchFlowProject(projectStore))
            {
                return(ProjectLicenseGroup.SketchFlow);
            }
            FrameworkName targetFrameworkName = ProjectStoreHelper.GetTargetFrameworkName(projectStore);

            if (targetFrameworkName != null && !string.IsNullOrEmpty(targetFrameworkName.Profile) && targetFrameworkName.Profile.Equals("WindowsPhone", StringComparison.OrdinalIgnoreCase))
            {
                return(ProjectLicenseGroup.SilverlightMobile);
            }
            return(ProjectLicenseGroup.WpfSilverlight);
        }
コード例 #2
0
        public override ConversionType GetVersion(ConversionTarget project)
        {
            ConversionType conversionType;

            this.silverlightSolution = false;
            this.sketchFlowSolution  = false;
            this.frameworkSolution   = false;
            if (!project.IsSolution)
            {
                return(ConversionType.Unknown);
            }
            using (IEnumerator <IProjectStore> enumerator = this.contextProjectStores.GetEnumerator())
            {
                do
                {
                    if (!enumerator.MoveNext())
                    {
                        break;
                    }
                    IProjectStore current             = enumerator.Current;
                    FrameworkName targetFrameworkName = ProjectStoreHelper.GetTargetFrameworkName(current);
                    if (targetFrameworkName == null)
                    {
                        continue;
                    }
                    if (!this.frameworkSolution && targetFrameworkName.Identifier == ".NETFramework")
                    {
                        this.frameworkSolution = true;
                    }
                    if (!this.silverlightSolution && targetFrameworkName.Identifier == "Silverlight")
                    {
                        this.silverlightSolution = true;
                    }
                    if (this.sketchFlowSolution || !ProjectStoreHelper.IsSketchFlowProject(current))
                    {
                        continue;
                    }
                    this.sketchFlowSolution = true;
                }while (!this.silverlightSolution || !this.sketchFlowSolution || !this.frameworkSolution);
            }
            if (!this.silverlightSolution && !this.frameworkSolution)
            {
                return(ConversionType.Unknown);
            }
            ILicenseService service = base.Services.GetService <ILicenseService>();

            if (this.sketchFlowSolution && service != null && !LicensingHelper.IsSketchFlowLicensed(service))
            {
                return(ConversionType.Unknown);
            }
            using (IEnumerator <ConversionTarget> enumerator1 = this.GetConversionTargets().GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    ConversionTarget conversionTarget = enumerator1.Current;
                    if (!ConversionHelper.CheckAndAddFile(conversionTarget, this.Converters, this.VersionMapping, true).Any <UpgradeAction>())
                    {
                        continue;
                    }
                    conversionType = ConversionType.SolutionBlendV3;
                    return(conversionType);
                }
                return(ConversionType.SolutionBlendV4);
            }
            return(conversionType);
        }