Beispiel #1
0
        public string GetTransform(BuildEngineType engineType)
        {
            //<transform file="%DXROOT%\Presentation\Vs2005\transforms\main_conceptual.xsl">
            //<transform file="%DXROOT%\Presentation\vs2005\Transforms\main_sandcastle.xsl">
            string path = _styleDir;

            if (String.IsNullOrEmpty(_styleDir) ||
                System.IO.Directory.Exists(_styleDir) == false)
            {
                path = "%DXROOT%";
            }
            path = Path.Combine(path, @"Presentation\");
            string transform = null;

            if (engineType == BuildEngineType.Conceptual)
            {
                transform = "main_conceptual.xsl";
            }
            else if (engineType == BuildEngineType.Reference)
            {
                transform = "main_sandcastle.xsl";
                //transform = "main_reference.xsl";
            }
            if (String.IsNullOrEmpty(transform))
            {
                return(null);
            }

            return(path + String.Format(@"{0}\Transforms\{1}",
                                        BuildStyle.StyleFolder(_styleType), transform));
        }
Beispiel #2
0
        public string GetSkeleton(BuildEngineType engineType)
        {
            //<data file="%DXROOT%\Presentation\Vs2005\transforms\skeleton_conceptual.xml" />
            //<data file="%DXROOT%\Presentation\vs2005\Transforms\skeleton.xml" />
            string path = _styleDir;

            if (String.IsNullOrEmpty(_styleDir) ||
                System.IO.Directory.Exists(_styleDir) == false)
            {
                path = "%DXROOT%";
            }
            path = Path.Combine(path, @"Presentation\");
            string skeleton = null;

            if (engineType == BuildEngineType.Conceptual)
            {
                skeleton = "skeleton_conceptual.xml";
            }
            else if (engineType == BuildEngineType.Reference)
            {
                skeleton = "skeleton.xml";
            }
            if (String.IsNullOrEmpty(skeleton))
            {
                return(null);
            }

            return(path + String.Format(@"{0}\Transforms\{1}",
                                        BuildStyle.StyleFolder(_styleType), skeleton));
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildComponentConfigurationList"/>
        /// class with the specified engine type.
        /// </summary>
        /// <param name="engineType">
        /// The build engine type, which is targeted by this set of configurations.
        /// </param>
        public BuildComponentConfigurationList(BuildEngineType engineType)
        {
            _engineType = engineType;
            _multiMap   = new BuildMultiSet <string, BuildComponentConfiguration>();

            this.Changed += new EventHandler <
                BuildListEventArgs <BuildComponentConfiguration> >(OnComponentConfigurationListChanged);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildEngineSettings"/> class
        /// with parameters copied from the specified instance of the
        /// <see cref="BuildEngineSettings"/> class, a copy constructor.
        /// </summary>
        /// <param name="source">
        /// An instance of the <see cref="BuildEngineSettings"/> class from which the
        /// initialization parameters or values will be copied.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the parameter <paramref name="source"/> is <see langword="null"/>.
        /// </exception>
        protected BuildEngineSettings(BuildEngineSettings source)
            : base(source)
        {
            _engineName = source._engineName;
            _engineType = source._engineType;
            _properties = source._properties;

            _sharedContent  = source._sharedContent;
            _includeContent = source._includeContent;

            _configurations                = source._configurations;
            _pluginConfigurations          = source._pluginConfigurations;
            _componentConfigurations       = source._componentConfigurations;
            _pluginComponentConfigurations = source._pluginComponentConfigurations;
        }
        /// <overloads>
        /// Initializes a new instance of the <see cref="BuildEngineSettings"/> class.
        /// </overloads>
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildEngineSettings"/> class
        /// with the default parameters.
        /// </summary>
        /// <param name="name">
        /// The name uniquely identifying this engine settings.
        /// </param>
        /// <param name="engineType">
        /// The engine type implementing this settings.
        /// </param>
        protected BuildEngineSettings(string name, BuildEngineType engineType)
        {
            BuildExceptions.NotNullNotEmpty(name, "name");

            _engineName     = name;
            _engineType     = engineType;
            _properties     = new BuildProperties();
            _sharedContent  = new SharedContent(_engineType.ToString());
            _includeContent = new IncludeContent(_engineType.ToString());

            _configurations                = new BuildConfigurationList(_engineType);
            _pluginConfigurations          = new BuildConfigurationList(_engineType);
            _componentConfigurations       = new BuildComponentConfigurationList(_engineType);
            _pluginComponentConfigurations = new BuildComponentConfigurationList(_engineType);
        }
        public BuildEngineSettings this[BuildEngineType engineType]
        {
            get
            {
                for (int i = 0; i < this.Count; i++)
                {
                    BuildEngineSettings engineSettings = this[i];

                    if (engineSettings.EngineType == engineType)
                    {
                        return(engineSettings);
                    }
                }

                return(null);
            }
        }
        public virtual void Initialize(BuildContext context,
                                       BuildEngineType engineType)
        {
            BuildExceptions.NotNull(context, "context");
            base.Initialize(context.Logger);

            BuildSettings settings = context.Settings;

            if (settings == null)
            {
                this.IsInitialized = false;
                return;
            }

            _nsmgr      = null;
            _context    = context;
            _settings   = settings;
            _style      = Settings.Style;
            _engineType = engineType;

            this.IsInitialized    = true;
            this.WarnIfNotFound   = true;
            this.DeleteIfNotFound = true;
        }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildComponentConfigurationList"/> class
 /// with parameters copied from the specified instance of the
 /// <see cref="BuildComponentConfigurationList"/> class, a copy constructor.
 /// </summary>
 /// <param name="source">
 /// An instance of the <see cref="BuildComponentConfigurationList"/> class from which the
 /// initialization parameters or values will be copied.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// If the parameter <paramref name="source"/> is <see langword="null"/>.
 /// </exception>
 public BuildComponentConfigurationList(BuildComponentConfigurationList source)
     : base(source)
 {
     _engineType = source._engineType;
 }
Beispiel #9
0
        public IList <string> GetSharedContents(BuildEngineType engineType)
        {
            List <string> sharedContents = new List <string>();
            string        path           = _styleDir;

            if (String.IsNullOrEmpty(_styleDir) ||
                System.IO.Directory.Exists(_styleDir) == false)
            {
                path = "%DXROOT%";
            }
            path = Path.Combine(path, @"Presentation\");

            if (engineType == BuildEngineType.Conceptual)
            {
                if (_styleType == BuildStyleType.ClassicWhite ||
                    _styleType == BuildStyleType.ClassicBlue)
                {
                    //<content file="%DXROOT%\Presentation\Vs2005\content\shared_content.xml" />
                    //<content file="%DXROOT%\Presentation\VS2005\content\feedBack_content.xml" />
                    //<content file="%DXROOT%\Presentation\Vs2005\content\conceptual_content.xml" />

                    sharedContents.Add(Path.Combine(path,
                                                    @"Vs2005\Content\shared_content.xml"));
                    sharedContents.Add(Path.Combine(path,
                                                    @"Vs2005\Content\feedBack_content.xml"));
                    sharedContents.Add(Path.Combine(path,
                                                    @"Vs2005\Content\conceptual_content.xml"));
                }
                else if (_styleType == BuildStyleType.Lightweight)
                {
                }
                else if (_styleType == BuildStyleType.ScriptFree)
                {
                }
            }
            else if (engineType == BuildEngineType.Reference)
            {
                if (_styleType == BuildStyleType.ClassicWhite ||
                    _styleType == BuildStyleType.ClassicBlue)
                {
                    //<content file="%DXROOT%\Presentation\vs2005\content\shared_content.xml" />
                    //<content file="%DXROOT%\Presentation\vs2005\content\reference_content.xml" />
                    //<content file="%DXROOT%\Presentation\shared\content\syntax_content.xml" />
                    //<content file="%DXROOT%\Presentation\vs2005\content\feedback_content.xml" />

                    sharedContents.Add(Path.Combine(path,
                                                    @"Vs2005\Content\shared_content.xml"));
                    sharedContents.Add(Path.Combine(path,
                                                    @"Vs2005\Content\reference_content.xml"));
                    sharedContents.Add(Path.Combine(path,
                                                    @"Shared\Content\syntax_content.xml"));
                    sharedContents.Add(Path.Combine(path,
                                                    @"Vs2005\Content\feedBack_content.xml"));
                }
                else if (_styleType == BuildStyleType.Lightweight)
                {
                }
                else if (_styleType == BuildStyleType.ScriptFree)
                {
                }
            }

            return(sharedContents);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="BuildConfigurationList"/>
 /// class with the specified engine type.
 /// </summary>
 /// <param name="engineType"></param>
 public BuildConfigurationList(BuildEngineType engineType)
 {
     _engineType = engineType;
 }
        /// <summary>
        /// This reads and sets its state or attributes stored in a <c>XML</c> format
        /// with the given reader.
        /// </summary>
        /// <param name="reader">
        /// The reader with which the <c>XML</c> attributes of this object are accessed.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void ReadXml(XmlReader reader)
        {
            BuildExceptions.NotNull(reader, "reader");

            Debug.Assert(reader.NodeType == XmlNodeType.Element);
            if (reader.NodeType != XmlNodeType.Element)
            {
                return;
            }

            if (!String.Equals(reader.Name, TagName,
                               StringComparison.OrdinalIgnoreCase))
            {
                Debug.Assert(false, "The processing of the engine settings ReadXml is not valid");
                return;
            }
            string tempText = reader.GetAttribute("name");

            if (!String.IsNullOrEmpty(tempText))
            {
                _engineName = tempText;
            }
            tempText = reader.GetAttribute("type");
            if (!String.IsNullOrEmpty(tempText))
            {
                _engineType = (BuildEngineType)Enum.Parse(
                    typeof(BuildEngineType), tempText, true);
            }

            if (reader.IsEmptyElement)
            {
                return;
            }

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    switch (reader.Name.ToLower())
                    {
                    case "propertygroup":
                        this.OnReadXml(reader);
                        break;

                    case "propertybag":
                        if (_properties == null)
                        {
                            _properties = new BuildProperties();
                        }
                        _properties.ReadXml(reader);
                        break;

                    case "contents":
                        this.ReadXmlContents(reader);
                        break;

                    case "configurations":
                        this.ReadXmlConfiguration(reader);
                        break;

                    case "componentconfigurations":
                        this.ReadXmlComponentConfiguration(reader);
                        break;
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, TagName,
                                      StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
        }