public override void Uninitialize()
        {
            _style   = null;
            _context = null;

            base.Uninitialize();
        }
        public override void Initialize(BuildContext context)
        {
            base.Initialize(context);

            if (!this.IsInitialized)
            {
                return;
            }

            _settings = context.Settings;
            if (_settings == null || _settings.Style == null)
            {
                this.IsInitialized = false;

                return;
            }
            _engineSettings = _settings.EngineSettings[
                BuildEngineType.Conceptual] as ConceptualEngineSettings;
            Debug.Assert(_engineSettings != null,
                         "The settings does not include the reference engine settings.");
            if (_engineSettings == null)
            {
                this.IsInitialized = false;

                return;
            }

            _componentConfigList = _engineSettings.ComponentConfigurations;
            if (_componentConfigList != null && _componentConfigList.Count != 0)
            {
                _componentConfigList.Initialize(context);
            }

            _style = _settings.Style;

            //Keyword: "$(SandcastleCopyComponent)";
            if (ContainsComponents("SandcastleCopyComponent") == false)
            {
                string sandcastlePath = context.SandcastleDirectory;

                if (String.IsNullOrEmpty(sandcastlePath) == false ||
                    Directory.Exists(sandcastlePath))
                {
                    string copyComponents = Path.Combine(sandcastlePath,
                                                         @"ProductionTools\CopyComponents.dll");
                    RegisterComponents("SandcastleCopyComponent", copyComponents);
                }
            }

            this.RegisterItemHandlers();
        }
    /// <summary>
    /// Generating All the Object to the Scene
    /// </summary>
    /// <param name="mapsArr">Textures 2D of the layout of the scene</param>
    /// <param name="colorMappingsArr">Dictionary of objects and colors</param>
    /// <param name="style">How to buid the scene</param>
    public static void GenerateLevel(Texture2D[] mapsArr, List <ColorToPrefab> colorMappingsArr, BuildStyle style, int layerhight)
    {
        //Set all the object to the script
        maps          = mapsArr;
        colorMappings = colorMappingsArr;
        buildStyle    = style;
        parent        = new GameObject();
        parent.name   = "Level";
        layerHight    = layerhight;

        //run on all the maps and generate objects to each map
        for (int m = 0; m < maps.Length; m++)
        {
            GenerateMap(maps[m], m);
        }
        SetMainCameraToPlayer();
    }
        public override void Initialize(BuildContext context)
        {
            base.Initialize(context);

            if (base.IsInitialized)
            {
                _context = context;

                BuildSettings settings = context.Settings;
                Debug.Assert(settings != null);
                if (settings == null || settings.Style == null)
                {
                    this.IsInitialized = false;
                    return;
                }
                _style = settings.Style;
                Debug.Assert(_style != null);
                if (_style == null)
                {
                    this.IsInitialized = false;
                    return;
                }
            }
        }
        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;
        }
示例#6
0
        /// <summary>
        /// The creates the configuration information or settings required by the
        /// target component for the build process.
        /// </summary>
        /// <param name="group">
        /// A build group, <see cref="BuildGroup"/>, representing the documentation
        /// target for configuration.
        /// </param>
        /// <param name="writer">
        /// An <see cref="XmlWriter"/> object used to create one or more new
        /// child nodes at the end of the list of child nodes of the current node.
        /// </param>
        /// <returns>
        /// Returns <see langword="true"/> for a successful configuration;
        /// otherwise, it returns <see langword="false"/>.
        /// </returns>
        /// <remarks>
        /// The <see cref="XmlWriter"/> writer passed to this configuration object
        /// may be passed on to other configuration objects, so do not close or
        /// dispose it.
        /// </remarks>
        public override bool Configure(BuildGroup group, XmlWriter writer)
        {
            BuildExceptions.NotNull(group, "group");
            BuildExceptions.NotNull(writer, "writer");

            if (!this.Enabled || !this.IsInitialized)
            {
                return(false);
            }

            Debug.Assert(_settings != null, "The settings object is required.");
            if (_settings == null || _context == null)
            {
                return(false);
            }

            BuildGroupContext groupContext = _context.GroupContexts[group.Id];

            if (groupContext == null)
            {
                throw new BuildException(
                          "The group context is not provided, and it is required by the build system.");
            }

            //<component type="Sandcastle.Components.ReferencePostTransComponent" assembly="$(SandAssistComponent)">
            //    <paths outputPath=".\Output\"/>
            //    <attributes>
            //        <attribute name="DocSet" value="NETFramework" />
            //        <attribute name="DocSet" value="NETCompactFramework"/>
            //    </attributes>
            //    <scripts>
            //        <IncludeItem item="assistScripts" />
            //    </scripts>
            //    <styles>
            //        <!-- Include the various styles used by the Sandcastle Assist -->
            //        <IncludeItem item="codeStyle" />
            //        <IncludeItem item="assistStyle" />
            //    </styles>
            //    <header>
            //        <!-- Include the logo image support -->
            //        <IncludeItem item="logoImage" />
            //        <!--<tables>
            //            <table name="" operation="" />
            //        </tables>-->
            //    </header>
            //</component>

            BuildFeedback feeback = _settings.Feedback;

            Debug.Assert(feeback != null, "Feedback object cannot be null (or Nothing).");
            if (feeback == null)
            {
                return(false);
            }
            BuildStyle buildStyle = _settings.Style;

            Debug.Assert(buildStyle != null, "The style object cannot be null (or Nothing).");
            if (buildStyle == null)
            {
                return(false);
            }

            writer.WriteStartElement("paths");  //start: paths
            writer.WriteAttributeString("outputPath", @".\Output\");
            writer.WriteEndElement();           //end: paths

            AttributeContent attributes = _settings.Attributes;

            if (attributes != null && attributes.Count != 0)
            {
                writer.WriteStartElement("attributes");  //start: attributes
                for (int i = 0; i < attributes.Count; i++)
                {
                    AttributeItem attribute = attributes[i];
                    if (attribute.IsEmpty)
                    {
                        continue;
                    }

                    writer.WriteStartElement("attribute");  //start: attribute
                    writer.WriteAttributeString("name", attribute.Name);
                    writer.WriteAttributeString("value", attribute.Value);
                    writer.WriteEndElement();            //end: attribute
                }
                writer.WriteEndElement();                //end: attributes
            }

            writer.WriteStartElement("scripts");  //start: scripts
            ScriptContent scriptContent = buildStyle.Scripts;

            if (scriptContent != null && !scriptContent.IsEmpty)
            {
                for (int i = 0; i < scriptContent.Count; i++)
                {
                    ScriptItem scriptItem = scriptContent[i];
                    // a. Empty item is no use.
                    // b. Overriding scripts are added to the documentation
                    //    by the transform.
                    if (scriptItem.IsEmpty || scriptItem.Overrides)
                    {
                        continue;
                    }

                    writer.WriteStartElement("script");  //start: script
                    writer.WriteAttributeString("file", scriptItem.ScriptFile);
                    writer.WriteAttributeString("condition", scriptItem.Condition);
                    writer.WriteEndElement();            //end: script
                }
            }
            writer.WriteEndElement();            //end: scripts

            writer.WriteStartElement("styles");  //start: styles
            StyleSheetContent styleContent = buildStyle.StyleSheets;

            if (styleContent != null && !styleContent.IsEmpty)
            {
                for (int i = 0; i < styleContent.Count; i++)
                {
                    StyleSheetItem styleItem = styleContent[i];
                    // a. Empty item is no use.
                    // b. Overriding styles are added to the documentation
                    //    by the transform.
                    if (styleItem.IsEmpty || styleItem.Overrides)
                    {
                        continue;
                    }

                    writer.WriteStartElement("style");  //start: style
                    writer.WriteAttributeString("file", styleItem.StyleFile);
                    writer.WriteAttributeString("condition", styleItem.Condition);
                    writer.WriteEndElement();           //end: style
                }
            }
            writer.WriteEndElement();            //end: styles

            // Let the Feedback option object configure itself...
            feeback.Configure(group, writer);

            // Write roots to namespaces conversion handler...
            writer.WriteStartElement("rootNamespaces"); // start: rootNamespaces
            writer.WriteAttributeString("id", group.Id);

            string rootNamespacesFile = Path.Combine(_context.WorkingDirectory,
                                                     groupContext["$RootNamespaces"]);

            if (File.Exists(rootNamespacesFile))
            {
                writer.WriteAttributeString("source", rootNamespacesFile);
            }
            writer.WriteEndElement();                   //end: rootNamespaces

            return(true);
        }
示例#7
0
        /// <summary>
        /// The creates the configuration information or settings required by the
        /// target component for the build process.
        /// </summary>
        /// <param name="group">
        /// A build group, <see cref="BuildGroup"/>, representing the documentation
        /// target for configuration.
        /// </param>
        /// <param name="writer">
        /// An <see cref="XmlWriter"/> object used to create one or more new
        /// child nodes at the end of the list of child nodes of the current node.
        /// </param>
        /// <returns>
        /// Returns <see langword="true"/> for a successful configuration;
        /// otherwise, it returns <see langword="false"/>.
        /// </returns>
        /// <remarks>
        /// The <see cref="XmlWriter"/> writer passed to this configuration object
        /// may be passed on to other configuration objects, so do not close or
        /// dispose it.
        /// </remarks>
        public override bool Configure(BuildGroup group, XmlWriter writer)
        {
            BuildExceptions.NotNull(group, "group");
            BuildExceptions.NotNull(writer, "writer");

            if (!this.Enabled || !this.IsInitialized)
            {
                return(false);
            }

            Debug.Assert(_settings != null, "The settings object is required.");
            if (_settings == null || _context == null)
            {
                return(false);
            }
            BuildStyle buildStyle = _settings.Style;

            Debug.Assert(buildStyle != null, "The style object cannot be null (or Nothing).");
            if (buildStyle == null)
            {
                return(false);
            }

            //<component type="Sandcastle.Components.ReferenceCodeComponent" assembly="$(SandAssistComponent)">
            //    <options mode="IndirectIris" tabSize="4" lineNumbers="true" outlining="false" storage="Sqlite" separator="..."/>
            //
            //    <!--The following options are for processing codeReference tags in the
            //    reference help.
            //    It is a replacement of the ExampleComponent, providing better coloring,
            //    minimum memory usage etc.
            //
            //    $codeSnippets
            //      @storage: * Indicates where the code snippets should be stored after loading
            //                * Possible values are
            //                     - Memory: the snippets are stored in memory similar to
            //                               the ExampleComponent.
            //                     - Database: the snippets are stored in Sqlite database.
            //                * Default: Database
            //      @separator: * For multi-parts snippets, this defines the separator...
            //                  * Default: ...-->
            //
            //    <!--<codeSnippets>
            //        <codeSnippet source=".\CodeSnippetSample.xml" format="Sandcastle" />
            //    </codeSnippets>-->
            //    <SandcastleItem name="%CodeSnippets%" />
            //</component>

            writer.WriteStartElement("options");  //start: options
            writer.WriteAttributeString("mode", _highlightMode);
            writer.WriteAttributeString("tabSize", _tabSize.ToString());
            writer.WriteAttributeString("lineNumbers", _showLineNumbers.ToString());
            writer.WriteAttributeString("outlining", _showOutlining.ToString());
            writer.WriteAttributeString("storage", _snippetStorage.ToString());
            writer.WriteAttributeString("separator", _snippetSeparator);
            writer.WriteEndElement();             //end: options

            IList <CodeSnippetContent> listSnippets = group.SnippetContents;

            if (listSnippets != null && listSnippets.Count != 0)
            {
                writer.WriteStartElement("codeSnippets");  // start - codeSnippets

                int contentCount = listSnippets.Count;
                for (int i = 0; i < contentCount; i++)
                {
                    CodeSnippetContent snippetContent = listSnippets[i];
                    if (snippetContent == null || snippetContent.IsEmpty)
                    {
                        continue;
                    }
                    writer.WriteStartElement("codeSnippet"); // start - codeSnippet
                    writer.WriteAttributeString("source", snippetContent.ContentFile);
                    writer.WriteAttributeString("format", "Sandcastle");
                    writer.WriteEndElement();                // end - codeSnippet
                }

                writer.WriteEndElement();                  // end - codeSnippets
            }

            SnippetContent snippets = buildStyle.Snippets;

            if (snippets != null && snippets.Count != 0)
            {
                writer.WriteStartElement("codeSources");  // start - codeSources

                for (int i = 0; i < snippets.Count; i++)
                {
                    SnippetItem snippetItem = snippets[i];
                    if (snippetItem == null || snippetItem.IsEmpty)
                    {
                        continue;
                    }
                    writer.WriteStartElement("codeSource"); // start - codeSource
                    writer.WriteAttributeString("source", snippetItem.Source);
                    writer.WriteAttributeString("format", "Sandcastle");
                    writer.WriteEndElement();                // end - codeSource
                }

                // The excludedUnits is required by the SnippetComponent,
                // we maintain that...
                writer.WriteStartElement("excludedUnits"); // start - excludedUnits
                IList <string> excludedUnits = snippets.ExcludedUnitFolders;
                if (excludedUnits != null && excludedUnits.Count != 0)
                {
                    for (int i = 0; i < excludedUnits.Count; i++)
                    {
                        string unitFolder = excludedUnits[i];
                        if (String.IsNullOrEmpty(unitFolder))
                        {
                            continue;
                        }
                        writer.WriteStartElement("unitFolder"); // start - unitFolder
                        writer.WriteAttributeString("name", unitFolder);
                        writer.WriteEndElement();               // end - unitFolder
                    }
                }
                writer.WriteEndElement();              // end - excludedUnits

                writer.WriteStartElement("languages"); // start - languages
                IList <SnippetLanguage> languages = snippets.Languages;
                if (languages != null && languages.Count != 0)
                {
                    for (int i = 0; i < languages.Count; i++)
                    {
                        SnippetLanguage language = languages[i];
                        if (!language.IsValid)
                        {
                            continue;
                        }
                        writer.WriteStartElement("language"); // start - language
                        writer.WriteAttributeString("unit", language.Unit);
                        writer.WriteAttributeString("languageId", language.LanguageId);
                        writer.WriteAttributeString("extension", language.Extension);
                        writer.WriteEndElement();               // end - language
                    }
                }
                writer.WriteEndElement();              // end - languages

                writer.WriteEndElement();              // end - codeSources
            }

            return(true);
        }
示例#8
0
        public override BuildStep CreateInitialSteps(BuildGroup group)
        {
            ReferenceGroup refGroup = group as ReferenceGroup;

            if (refGroup == null)
            {
                throw new BuildException("The build engine requires reference group.");
            }
            if (_listFormats == null || _listFormats.Count == 0)
            {
                return(null);
            }

            BuildMultiStep listSteps = new BuildMultiStep();

            listSteps.Message     = "References topics for the group: " + group.Name;
            listSteps.LogTitle    = String.Empty;
            listSteps.LogTimeSpan = true;

            BuildSettings settings      = this.Settings;
            string        sandcastleDir = this.Context.StylesDirectory;
            BuildStyle    outputStyle   = settings.Style;

            if (String.IsNullOrEmpty(sandcastleDir))
            {
                return(null);
            }

            // 1. Initialize the conceptual topics...
            StepReferenceInit stepInit = new StepReferenceInit(refGroup);

            stepInit.Message  = "Initializing and copying reference contents";
            stepInit.LogTitle = String.Empty;

            listSteps.Add(stepInit);

            string helpStyle = BuildStyle.StyleFolder(
                outputStyle.StyleType);
            string workingDir = this.Context.WorkingDirectory;

            // 2. Ensure that we have a valid list of folders...
            IList <string>             listFolders = new List <string>();
            IDictionary <string, bool> dicFolders  = this.GetOutputFolders(listFolders);

            // 3. Handle the resources...
            StepDirectoryCopy copyResources = new StepDirectoryCopy(
                workingDir);

            copyResources.LogTitle = String.Empty;
            copyResources.Message  = "Copying user-defined resources.";
            IList <ResourceContent> resourceContents = group.ResourceContents;

            if (resourceContents != null && resourceContents.Count != 0)
            {
                int contentCount = resourceContents.Count;
                for (int j = 0; j < contentCount; j++)
                {
                    ResourceContent resourceContent = resourceContents[j];
                    if (resourceContent == null || resourceContent.Count == 0)
                    {
                        continue;
                    }

                    int itemCount = resourceContent.Count;

                    for (int i = 0; i < itemCount; i++)
                    {
                        ResourceItem resource = resourceContent[i];
                        if (resource != null && !resource.IsEmpty)
                        {
                            string destFolder = resource.Destination;
                            copyResources.Add(resource.Source, destFolder);

                            // Add this to the output folders so that it is copied
                            // to the final output/build directories...
                            if (destFolder.StartsWith("Output",
                                                      StringComparison.OrdinalIgnoreCase))
                            {
                                DirectoryInfo info = new DirectoryInfo(destFolder);
                                destFolder = info.Name;
                                if (!String.IsNullOrEmpty(destFolder) &&
                                    !dicFolders.ContainsKey(destFolder))
                                {
                                    dicFolders.Add(destFolder, true);
                                    listFolders.Add(destFolder);
                                }
                            }
                        }
                    }
                }
            }

            if (copyResources.IsValid)
            {
                listSteps.Add(copyResources);
            }
            else
            {
                StepNone placeHolder = new StepNone();
                placeHolder.LogTitle = String.Empty;
                placeHolder.Message  = "Copying user-defined resources.";
                listSteps.Add(placeHolder);
            }

            _listFolders = listFolders;

            this.CreateReflectionSteps(listSteps, refGroup,
                                       sandcastleDir, helpStyle);

            if (listSteps.Count != 0)
            {
                return(listSteps);
            }

            return(null);
        }
示例#9
0
        /// <summary>
        /// The creates the configuration information or settings required by the
        /// target component for the build process.
        /// </summary>
        /// <param name="group">
        /// A build group, <see cref="BuildGroup"/>, representing the documentation
        /// target for configuration.
        /// </param>
        /// <param name="writer">
        /// An <see cref="XmlWriter"/> object used to create one or more new
        /// child nodes at the end of the list of child nodes of the current node.
        /// </param>
        /// <returns>
        /// Returns <see langword="true"/> for a successful configuration;
        /// otherwise, it returns <see langword="false"/>.
        /// </returns>
        /// <remarks>
        /// The <see cref="XmlWriter"/> writer passed to this configuration object
        /// may be passed on to other configuration objects, so do not close or
        /// dispose it.
        /// </remarks>
        public override bool Configure(BuildGroup group, XmlWriter writer)
        {
            BuildExceptions.NotNull(group, "group");
            BuildExceptions.NotNull(writer, "writer");

            BuildGroupContext groupContext = _context.GroupContexts[group.Id];

            if (groupContext == null)
            {
                throw new BuildException(
                          "The group context is not provided, and it is required by the build system.");
            }

            if (!this.Enabled || !this.IsInitialized)
            {
                return(false);
            }

            BuildStyle style = _settings.Style;

            IList <string> sharedContents = style.GetSharedContents(
                BuildEngineType.Reference);

            if (sharedContents == null || sharedContents.Count == 0)
            {
                throw new BuildException(
                          "A document shared content is required.");
            }
            string workingDir = _context.WorkingDirectory;

            if (String.IsNullOrEmpty(workingDir))
            {
                throw new BuildException(
                          "The working directory is required, it is not specified.");
            }

            writer.WriteComment(" Include the reference shared content files ");

            int itemCount = sharedContents.Count;

            for (int i = 0; i < itemCount; i++)
            {
                string sharedContent = sharedContents[i];
                if (String.IsNullOrEmpty(sharedContent) == false)
                {
                    writer.WriteStartElement("content");
                    writer.WriteAttributeString("file", sharedContent);
                    writer.WriteEndElement();
                }
            }

            //<!-- Overrides the contents to customize it -->
            //<content file=".\SharedContent.xml" />
            sharedContents = null;
            string path = _settings.ContentsDirectory;

            if (String.IsNullOrEmpty(path) == false &&
                System.IO.Directory.Exists(path) == true)
            {
                sharedContents = style.GetSharedContents();
            }

            if (sharedContents != null && sharedContents.Count != 0)
            {
                SharedContentConfigurator configurator =
                    new SharedContentConfigurator();

                // Initialize the configurator...
                configurator.Initialize(_context, BuildEngineType.Reference);

                // Create and add any shared contents...
                IList <SharedItem> formatShared = _format.PrepareShared(
                    _settings, group);
                if (formatShared != null && formatShared.Count > 0)
                {
                    configurator.Contents.Add(formatShared);
                }

                IList <SharedItem> groupShared = group.PrepareShared(_context);
                if (groupShared != null && groupShared.Count > 0)
                {
                    configurator.Contents.Add(groupShared);
                }

                // Create and add any shared content rule...
                IList <RuleItem> formatRules = _format.PrepareSharedRule(
                    _settings, group);
                if (formatRules != null && formatRules.Count != 0)
                {
                    configurator.Rules.Add(formatRules);
                }

                writer.WriteComment(" Overrides the contents to customize it... ");
                itemCount = sharedContents.Count;
                for (int i = 0; i < itemCount; i++)
                {
                    string sharedContent = sharedContents[i];
                    if (String.IsNullOrEmpty(sharedContent))
                    {
                        continue;
                    }

                    string sharedFile = Path.Combine(path, sharedContent);

                    if (!File.Exists(sharedFile))
                    {
                        continue;
                    }

                    string fileName   = groupContext["$SharedContentFile"];
                    string filePrefix = _format["SharedContentSuffix"];
                    if (!String.IsNullOrEmpty(filePrefix))
                    {
                        string groupIndex = groupContext["$GroupIndex"];
                        if (groupIndex == null)
                        {
                            groupIndex = String.Empty;
                        }
                        fileName = "ApiSharedContent-" + filePrefix + groupIndex + ".xml";
                    }
                    if (itemCount > 1)  // not yet the case....
                    {
                        fileName = fileName.Replace(".", i.ToString() + ".");
                    }
                    string finalSharedFile = Path.Combine(workingDir, fileName);

                    configurator.Configure(sharedFile, finalSharedFile);

                    writer.WriteStartElement("content");
                    writer.WriteAttributeString("file", fileName);
                    writer.WriteEndElement();
                }

                configurator.Uninitialize();
            }

            ReferenceGroup refGroup = (ReferenceGroup)group;

            if (!refGroup.IsSingleVersion)
            {
                writer.WriteComment(" Shared items from the version information. ");
                writer.WriteStartElement("content");
                writer.WriteAttributeString("file", Path.Combine(workingDir,
                                                                 groupContext["$ApiVersionsSharedContentFile"]));
                writer.WriteEndElement();
            }

            return(true);
        }
示例#10
0
        public void Create()
        {
            bool useCustomStyles = true;

            BuildStyleType styleType = BuildStyleType.ClassicWhite;

            _settings.WorkingDirectory  = new BuildDirectoryPath(_workingDir);
            _settings.CleanIntermediate = false;
            _settings.ShowPreliminary   = true;
            _settings.Style.StyleType   = styleType;
            //_settings.SyntaxType = BuildSyntaxType.None;

            _settings.HeaderText = "Header: This is the header text.";
            _settings.FooterText = "Footer: This is the footer text.";

            BuildFeedback feedBack = _settings.Feedback;

            feedBack.CompanyName   = "Sandcastle Assist";
            feedBack.ProductName   = "Sandcastle Helpers";
            feedBack.EmailAddress  = "*****@*****.**";
            feedBack.FeedbackType  = BuildFeedbackType.None;
            feedBack.CopyrightText =
                "Copyright &#169; 2007-2008 Sandcastle Assist. All Rights Reserved.";
            feedBack.CopyrightLink = "http://www.codeplex.com/SandAssist";

            // Configure the logo image information...
            feedBack.LogoEnabled   = true; // show it...
            feedBack.LogoImage     = new BuildFilePath(Path.Combine(_sandAssistDir, "AssistLogo.jpg"));
            feedBack.LogoWidth     = 64;
            feedBack.LogoHeight    = 64;
            feedBack.LogoPadding   = 3;
            feedBack.LogoText      = "Sandcastle Assist";
            feedBack.LogoLink      = "http://www.codeplex.com/SandAssist";
            feedBack.LogoAlignment = BuildLogoAlignment.Center;
            feedBack.LogoPlacement = BuildLogoPlacement.Right;

            // Configure the logging, we add some loggers by their names...
            BuildLogging logging = _settings.Logging;

            //logging.Verbosity = BuildLoggerVerbosity.Detailed;
            //logging.AddLogger(XmlLogger.LoggerName);
            //logging.AddLogger(HtmlLogger.LoggerName);
            ///logging.AddLogger(XamlLogger.LoggerName);
            logging.AddLogger(ConsoleLogger.LoggerName);

            BuildStyle style = _settings.Style;
            // Add direct code snippet root folder...
            SnippetContent snippets = style.Snippets;

            snippets.Add(new SnippetItem(
                             Path.Combine(_sampleDir, "SampleSnippets")));

            // Add some custom math packages and commands...
            MathPackageContent mathPackages = style.MathPackages;

            mathPackages.Add("picture", "calc");
            mathPackages.Add("xy", "all", "knot", "poly");

            MathCommandContent mathCommands = style.MathCommands;

            mathCommands.Add(@"\quot",
                             @"\dfrac{\varphi \cdot X_{n, #1}}{\varphi_{#2} \times \varepsilon_{#1}}", 2);
            mathCommands.Add(@"\exn", @"(x+\varepsilon_{#1})^{#1}", 1);

            if (useCustomStyles)
            {
                string stylesDir = @"Presentations";
                stylesDir = Path.GetFullPath(stylesDir);
                if (Directory.Exists(stylesDir))
                {
                    _settings.Style.Directory = new BuildDirectoryPath(stylesDir);
                }
            }

            FormatChm chmFormat =
                _settings.Formats[BuildFormatType.HtmlHelp1] as FormatChm;

            if (chmFormat != null)
            {
                chmFormat.Enabled      = true;
                chmFormat.UseBinaryToc = false;
                chmFormat.Indent       = true;
            }

            //FormatHxs hxsFormat =
            //  _settings.Formats[BuildFormatType.HtmlHelp2] as FormatHxs;
            //if (hxsFormat != null)
            //{
            //    //hxsFormat.SeparateIndexFile = true;
            //    hxsFormat.Enabled = true;
            //    hxsFormat.Indent = true;
            //}

            //FormatMhv mhvFormat =
            //    _settings.Formats[BuildFormatType.HtmlHelp3] as FormatMhv;
            //if (mhvFormat != null)
            //{
            //    mhvFormat.Enabled = true;
            //    mhvFormat.Indent = true;
            //}

            //FormatWeb webFormat =
            //    _settings.Formats[BuildFormatType.WebHelp] as FormatWeb;
            //if (webFormat != null)
            //{
            //    webFormat.Enabled = true;
            //    webFormat.Indent = true;
            //}

            //_settings.HelpName = "HelpRegister";
            //_settings.HelpTitle = "Sandcastle HelpRegister";
            _settings.HelpName  = "SandcastleHelpers";
            _settings.HelpTitle = "Sandcastle Helpers Test Sample";
        }
示例#11
0
        private bool CreateConfiguration(ReferenceGroup group)
        {
            BuildExceptions.NotNull(group, "group");

            BuildContext context = this.Context;

            BuildGroupContext groupContext = context.GroupContexts[group.Id];

            if (groupContext == null)
            {
                throw new BuildException(
                          "The group context is not provided, and it is required by the build system.");
            }

            BuildLogger    logger      = context.Logger;
            BuildSettings  settings    = context.Settings;
            BuildStyle     outputStyle = settings.Style;
            BuildStyleType styleType   = outputStyle.StyleType;

            string workingDir = context.WorkingDirectory;
            string configDir  = settings.ConfigurationDirectory;

            if (String.IsNullOrEmpty(workingDir))
            {
                if (logger != null)
                {
                    logger.WriteLine(
                        "The working directory is required, it is not specified.",
                        BuildLoggerLevel.Error);
                }

                return(false);
            }

            string configFile      = String.Empty;
            string finalConfigFile = String.Empty;

            if (!String.IsNullOrEmpty(configDir) && Directory.Exists(configDir))
            {
                configFile = Path.Combine(configDir,
                                          BuildStyle.StyleFolder(styleType) + ".config");
                finalConfigFile = Path.Combine(workingDir, groupContext["$ConfigurationFile"]);
            }
            if (!File.Exists(configFile))
            {
                configFile = String.Empty;
            }

            ReferenceConfigurator assembler = new ReferenceConfigurator();

            try
            {
                assembler.Initialize(context);

                // 3. Configure the build assembler...
                if (!String.IsNullOrEmpty(configFile))
                {
                    assembler.Configure(group, configFile, finalConfigFile);

                    _manifestFile = Path.Combine(workingDir,
                                                 groupContext["$ManifestFile"]);
                    _configurationFile = finalConfigFile;
                }
            }
            finally
            {
                if (assembler != null)
                {
                    assembler.Uninitialize();
                }
            }

            return(true);
        }
    //Build the Window GUI
    public void OnGUI()
    {
        if (!Application.isPlaying)
        {
            #region Check for errors
            if (so.targetObject == null)
            {
                SetScriptableObject();
            }
            #endregion

            #region Lables
            GUILayout.Space(10);
            GUILayout.Label("Set all the variables", EditorStyles.boldLabel);
            GUILayout.Space(0);
            #endregion

            #region buildStyle drop down
            buildStyle = (BuildStyle)EditorGUILayout.EnumPopup("You level build style:", buildStyle);
            #endregion

            layerHight = EditorGUILayout.IntField("Layer (Optional)", layerHight);

            #region maps and color mappings
            for (int i = 0; i < stringsProp.Length; i++)
            {
                try
                {
                    EditorGUILayout.PropertyField(stringsProp[i], true);
                }
                catch { }
            }

            so.ApplyModifiedProperties();

            #endregion

            #region Buttons
            GUIStyle myButtonStyle = new GUIStyle(GUI.skin.button);
            myButtonStyle.fontSize = 25;
            float buttonHight = 70;

            if (GUILayout.Button("Get Colors From Maps", myButtonStyle, GUILayout.Height(buttonHight)))
            {
                GetColorsToMenu();
            }
            if (GUILayout.Button("Generate Level", myButtonStyle, GUILayout.Height(buttonHight)))
            {
                GenerateLevelButtonPress();
            }
            #endregion
        }
        else
        {
            #region Lables
            GUILayout.Space(10);
            GUIStyle style = new GUIStyle(GUI.skin.label);
            style.fontSize  = 40;
            style.fontStyle = FontStyle.Bold;
            GUILayout.Label("You can not use this\nin play mode", style);
            GUILayout.Space(0);
            #endregion
        }
    }
 /// <summary>
 /// calls the Creat level function
 /// </summary>
 /// <param name="style">How to build the level</param>
 public void CreateLevel(BuildStyle style, int layerHight)
 {
     ImageTosprite();
     InEditorLevelGenerator.GenerateLevel(textures, ColorMapping, style, layerHight);
 }
        public override void Uninitialize()
        {
            base.Uninitialize();

            _style = null;
        }