コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        public static WPFLibrary Generate(WPFLibraryParams wpfLibraryParams)
        {
            WPFXamlGenerator.ValidateDefaultFiles();

            List <string> list = new List <string>();

            if (wpfLibraryParams.ResourceFiles != null)
            {
                list.AddRange(wpfLibraryParams.ResourceFiles);
            }
            if (wpfLibraryParams.XamlPages != null)
            {
                list.AddRange(wpfLibraryParams.XamlPages);
            }
            if (wpfLibraryParams.References != null)
            {
                list.AddRange(wpfLibraryParams.References);
            }

            ThrowIfNoAbsolutePath(list);

            WPFLibraryGenerator g = new WPFLibraryGenerator(wpfLibraryParams);

            return(new WPFLibrary(g));
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="amountXamls"></param>
        /// <param name="resourceFiles"></param>
        /// <param name="xamlPages"></param>
        /// <param name="references"></param>
        /// <returns></returns>
        public static WPFLibrary Generate(
            int amountXamls,
            string[] resourceFiles,
            string[] xamlPages,
            string[] references)
        {
            WPFLibraryParams wpfLibraryParams = new WPFLibraryParams();

            wpfLibraryParams.AmountXamls   = amountXamls;
            wpfLibraryParams.References    = references;
            wpfLibraryParams.ResourceFiles = resourceFiles;
            wpfLibraryParams.XamlPages     = xamlPages;

            return(Generate(wpfLibraryParams));
        }
コード例 #3
0
        /// <summary>
        /// </summary>
        private WPFLibraryGenerator(WPFLibraryParams wpfLibraryParams)
        {
            _wpfLibraryParams           = wpfLibraryParams;
            _amountResourceDictionaries = wpfLibraryParams.AmountResourceDictionaries;
            _amountXaml = wpfLibraryParams.AmountXamls;

            Guid directorySuffix = Guid.NewGuid();

            _directorySuffix = directorySuffix;
            _buildPath       = Path.Combine(wpfLibraryParams.RootBuildPath, _buildPathPrefix + directorySuffix.ToString("N"));

            _assemblyName += directorySuffix.ToString("N");


            _resourceFiles = wpfLibraryParams.ResourceFiles;
            _xamlPages     = wpfLibraryParams.XamlPages;
            _references    = wpfLibraryParams.References;

            _finalDLLPath = Path.Combine(wpfLibraryParams.LibraryBinPlacePath, _assemblyName + ".dll");
        }