Ejemplo n.º 1
0
        protected override void GenerateStyleSheet(OutputGroup outputGroup, IList <InputGroup> inputGroups, SwitchParser switchParser, string outputPath, Encoding outputEncoding)
        {
            if (!FileWriteOperation(outputPath, switchParser.IfNotNull(p => p.Clobber), () =>
            {
                // create the output file, clobbering any existing content
                using (var writer = new StreamWriter(outputPath, false, outputEncoding))
                {
                    if (inputGroups != null && inputGroups.Count > 0)
                    {
                        // for each input file, copy to the output, separating them with a newline (don't need a semicolon like JavaScript does)
                        var addSeparator = false;
                        foreach (var inputGroup in inputGroups)
                        {
                            if (addSeparator)
                            {
                                writer.WriteLine();
                            }
                            else
                            {
                                addSeparator = true;
                            }

                            writer.Write(inputGroup.Source);
                        }
                    }
                }

                return(true);
            }))
            {
                // could not write file
                Log.LogError(Strings.CouldNotWriteOutputFile, outputPath);
            }
        }
        internal void OnGacProjectOutputCommand(object sender, EventArgs e)
        {
            Array projects = (Array)_applicationObject.ActiveSolutionProjects;

            if (projects.Length > 0)
            {
                if (projects.Length > 1)
                {
                    ShowMessageBox("Please select only one project.", OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGICON.OLEMSGICON_WARNING);
                    return;
                }

                Project proj = projects.GetValue(0) as Project;

                if (proj.ConfigurationManager == null)
                {
                    return;
                }

                OutputGroup primaryOutputGroup = proj.ConfigurationManager.ActiveConfiguration.OutputGroups.Item("Built");
                object[]    primaryOutputs     = primaryOutputGroup.FileURLs as object[];

                Uri path = new Uri(primaryOutputs[0].ToString());

                string arguments = string.Format("/i \"{0}\" /f", System.IO.Path.GetFullPath(path.LocalPath));
                _commandRunner.ExecuteBuild(_gacUtilPath, arguments);
            }
        }
Ejemplo n.º 3
0
        protected override void GenerateJavaScript(OutputGroup outputGroup, IList <InputGroup> inputGroups, SwitchParser switchParser, string outputPath, Encoding outputEncoding)
        {
            if (switchParser == null)
            {
                throw new ArgumentNullException("switchParser");
            }

            try
            {
                var settings = switchParser.JSSettings;

                // process the resources for this output group into the settings list
                // if there are any to be processed
                if (outputGroup != null && settings != null &&
                    outputGroup.Resources.IfNotNull(rs => rs.Count > 0))
                {
                    outputGroup.ProcessResourceStrings(settings.ResourceStrings, null);
                }

                // then process the javascript output group
                ProcessJavaScript(
                    inputGroups,
                    switchParser,
                    outputPath,
                    outputGroup.IfNotNull(og => og.SymbolMap),
                    outputEncoding);
            }
            catch (ArgumentException ex)
            {
                // processing the resource strings could throw this exception
                Log.LogError(ex.Message);
            }
        }
Ejemplo n.º 4
0
        public OutputGroup GetOutputGroup()
        {
            var outputGroup = new OutputGroup
            {
                Name      = Text,
                IsCurrent = TabControl != null && TabControl.SelectedTabPage == this
            };

            if (_container.EditedContent.DigitalProducts.Any(p => !String.IsNullOrEmpty(p.Name)))
            {
                outputGroup.Items = new List <OutputItem>(new[]
                {
                    new OutputItem
                    {
                        Name = Text,
                        PresentationSourcePath =
                            Path.Combine(ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())),
                        SlidesCount           = _summaryControls.Count / RowsPerSlide + (_summaryControls.Count % RowsPerSlide > 0 ? 1 : 0),
                        IsCurrent             = true,
                        SlideGeneratingAction = (processor, destinationPresentation) =>
                        {
                            PopulateReplacementsList();
                            processor.AppendDigitalSummary(this, destinationPresentation);
                        },
                        PreviewGeneratingAction = (processor, filePath) =>
                        {
                            PopulateReplacementsList();
                            processor.PrepareDigitalSummaryEmail(filePath, this);
                        }
                    }
                });
            }
            return(outputGroup);
        }
 /*
  * Process a section of config, iterating if it's an array.
  */
 private void LoadConfigSection(
     JToken jsonConfig,
     ConfigFileSection configFileSection,
     OutputGroup outputGroup,
     Action <IInclusionRule> addInclusionRule,
     string configFilePath,
     string sectionRootString
     )
 {
     if (jsonConfig.Type == JTokenType.Array)
     {
         foreach (JToken token in (JArray)jsonConfig)
         {
             ProcessConfigSectionObject(
                 token,
                 configFileSection,
                 outputGroup,
                 addInclusionRule,
                 configFilePath,
                 sectionRootString
                 );
         }
     }
     else
     {
         ProcessConfigSectionObject(
             jsonConfig,
             configFileSection,
             outputGroup,
             addInclusionRule,
             configFilePath,
             sectionRootString
             );
     }
 }
 public OutputGroupRepositoryTest()
 {
     this.group1     = new OutputGroup("test1");
     this.group2     = new OutputGroup("test2");
     this.group3     = new OutputGroup("test3");
     this.repository = new OutputGroupRepository();
 }
Ejemplo n.º 7
0
        public OutputGroup GetOutputGroup()
        {
            var outputGroup = new OutputGroup
            {
                Name      = Text,
                IsCurrent = TabControl != null && TabControl.SelectedTabPage == this
            };

            if (PackageRecords.Any())
            {
                outputGroup.Items = new List <OutputItem>(new[]
                {
                    new OutputItem
                    {
                        Name = Text,
                        PresentationSourcePath =
                            Path.Combine(ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())),
                        SlidesCount           = PackageRecords.Count() / RowsPerSlide + (PackageRecords.Count() % RowsPerSlide > 0 ? 1 : 0),
                        IsCurrent             = true,
                        SlideGeneratingAction = (processor, destinationPresentation) =>
                        {
                            PopulateReplacementsList();
                            processor.AppendWebPackage(this, destinationPresentation);
                        },
                        PreviewGeneratingAction = (processor, filePath) =>
                        {
                            PopulateReplacementsList();
                            processor.PrepareWebPackageEmail(filePath, this);
                        }
                    }
                });
            }
            return(outputGroup);
        }
Ejemplo n.º 8
0
        public void TestItReturnsAirportGroupWithSpecificDescriptor()
        {
            ConfigFileSection section = ConfigFileSectionFactory.Make(descriptor: "foo", dataType: InputDataType.SCT_FIXES);
            OutputGroup       group   = OutputGroupFactory.CreateAirport(section, "EGLL");

            Assert.Equal("airport.SCT_FIXES.EGLL", group.Key);
            Assert.Equal("Start EGLL foo", group.HeaderDescription);
        }
Ejemplo n.º 9
0
        public void TestItReturnsEnrouteGroupWithoutSpecificDescriptor()
        {
            ConfigFileSection section = ConfigFileSectionFactory.Make(descriptor: null, dataType: InputDataType.SCT_FIXES);
            OutputGroup       group   = OutputGroupFactory.CreateEnroute(section);

            Assert.Equal("enroute.SCT_FIXES", group.Key);
            Assert.Null(group.HeaderDescription);
        }
Ejemplo n.º 10
0
        public void TestItReturnsMiscGroupWithSpecificDescriptor()
        {
            ConfigFileSection section = ConfigFileSectionFactory.Make(descriptor: "foo", dataType: InputDataType.SCT_FIXES);
            OutputGroup       group   = OutputGroupFactory.CreateMisc(section);

            Assert.Equal("misc.SCT_FIXES", group.Key);
            Assert.Equal("Start misc foo", group.HeaderDescription);
        }
Ejemplo n.º 11
0
        IEnumerator Generate()
        {
            mIsGenerating = true;
            int cnt = 0;

            foreach (OutpuRegion opr in mOutputs)
            {
                List <OutputGroup> group = opr.groups;
                for (int j = 0; j < group.Count; j++)
                {
                    OutputGroup opg = group[j];

                    if (opg.node.IsOutOfDate())
                    {
                        continue;
                    }

                    opg.node.Dirty(mData, false);

                    RGLODQuadTreeNode node = opg.node;
                    string            desc = "Grass Batch [" + node.xIndex.ToString() + ", " + node.zIndex.ToString() + "] _ LOD [" + node.LOD + "]";
                    GameObject        go   = CreateBatchGos(desc, opg.billboard, opg.tri);
                    node.gameObject = go;

                    if (go != null)
                    {
                        go.transform.parent        = transform;
                        go.transform.localPosition = Vector3.zero;

                        if (go.activeSelf != node.visible)
                        {
                            go.SetActive(node.visible);
                        }

                        if (cnt % c_Interval == 0)
                        {
                            yield return(0);
                        }

                        cnt++;
                    }
                }

                ClearMeshes(opr.oldGos);
            }

            if (onReqsFinished != null)
            {
                onReqsFinished();
            }

            mOutputs.Clear();
            mIsGenerating = false;
            mActive       = false;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Process an output group by deleting the output files if they exist.
        /// </summary>
        /// <param name="outputGroup">the OutputGroup being processed</param>
        /// <param name="outputFileInfo">FileInfo for the desired output file</param>
        /// <param name="symbolsFileInfo">FileInfo for the optional desired symbol file</param>
        /// <param name="defaultSettings">default settings for this output group</param>
        /// <param name="manifestModifiedTime">modified time for the manifest</param>
        protected override void ProcessOutputGroup(OutputGroup outputGroup, FileInfo outputFileInfo, FileInfo symbolsFileInfo, SwitchParser defaultSettings, DateTime manifestModifiedTime)
        {
            // get the settings to use -- take the configuration for this output group
            // and apply them over the default settings
            var settings = ParseConfigSettings(outputGroup.GetConfigArguments(this.Configuration), defaultSettings);

            // we really only care about the clobber setting -- if the file is read-only, don't bother deleting it
            // unless we have the clobber setting. If the current setting is Preserve, then we want to change it to
            // Auto because it makes no sense to not delete a non-readonly file during a "clean"
            var clobber = settings.Clobber == ExistingFileTreatment.Preserve
                ? ExistingFileTreatment.Auto
                : settings.Clobber;

            // we don't care about the inputs, we just want to delete the outputs and be done
            if (outputFileInfo != null)
            {
                if (!FileWriteOperation(outputFileInfo.FullName, clobber, () =>
                {
                    outputFileInfo.IfNotNull(fi =>
                    {
                        if (fi.Exists)
                        {
                            Log.LogMessage(MessageImportance.Normal, Strings.DeletingFile, fi.FullName);
                            fi.Delete();
                        }
                    });
                    return(true);
                }))
                {
                    // can't delete the file - not an error; just informational
                    Log.LogMessage(MessageImportance.Normal, Strings.CouldNotDeleteOutputFile, outputFileInfo.FullName);
                }
            }

            if (symbolsFileInfo != null)
            {
                if (!FileWriteOperation(symbolsFileInfo.FullName, clobber, () =>
                {
                    symbolsFileInfo.IfNotNull(fi =>
                    {
                        if (fi.Exists)
                        {
                            Log.LogMessage(MessageImportance.Normal, Strings.DeletingFile, fi.FullName);
                            fi.Delete();
                        }
                    });
                    return(true);
                }))
                {
                    // can't delete the file - not an error; just informational
                    Log.LogMessage(MessageImportance.Normal, Strings.CouldNotDeleteOutputFile, symbolsFileInfo.FullName);
                }
            }
        }
Ejemplo n.º 13
0
        public void OnCustomSlidePreview(object sender, SlideMasterEventArgs e)
        {
            if (!CheckPowerPointRunning())
            {
                return;
            }
            if (e.SlideMaster == null)
            {
                return;
            }
            var previewGroup = new OutputGroup
            {
                Name      = e.SlideMaster.Name,
                IsCurrent = true,
                Items     = new List <OutputItem>(new[]
                {
                    new OutputItem
                    {
                        Name                   = e.SlideMaster.Name,
                        IsCurrent              = true,
                        SlidesCount            = 1,
                        PresentationSourcePath = Path.Combine(Asa.Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath,
                                                              Path.GetFileName(Path.GetTempFileName())),
                        SlideGeneratingAction = (processor, destinationPresentation) =>
                        {
                            var templatePath = e.SlideMaster.GetMasterPath();
                            processor.AppendSlideMaster(templatePath, destinationPresentation);
                        },
                        PreviewGeneratingAction = (processor, presentationSourcePath) =>
                        {
                            var templatePath = e.SlideMaster.GetMasterPath();
                            processor.PreparePresentation(presentationSourcePath,
                                                          presentation => processor.AppendSlideMaster(templatePath, presentation));
                        }
                    }
                })
            };

            var selectedOutputItems = new List <OutputItem>();

            using (var form = new FormPreview(
                       MainForm,
                       PowerPointProcessor))
            {
                form.LoadGroups(new[] { previewGroup });
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            OutputPowerPointCustom(selectedOutputItems);
        }
Ejemplo n.º 14
0
        protected override void GenerateStyleSheet(OutputGroup outputGroup, IList <InputGroup> inputGroups, SwitchParser switchParser, string outputPath, Encoding outputEncoding)
        {
            if (switchParser == null)
            {
                throw new ArgumentNullException("switchParser");
            }

            ProcessStylesheet(
                inputGroups,
                switchParser,
                outputPath,
                outputEncoding);
        }
        private void ProcessConfigSectionObject(
            JToken jsonConfig,
            ConfigFileSection configFileSection,
            OutputGroup outputGroup,
            Action <IInclusionRule> addInclusionRule,
            string rootPath,
            string sectionRootString
            )
        {
            if (jsonConfig.Type != JTokenType.Object)
            {
                throw new ConfigFileInvalidException(GetInvalidConfigParentSectionFormatMessage(sectionRootString));
            }

            JObject configObject = (JObject)jsonConfig;

            // Check the type field to see what we're dealing with
            if (
                !configObject.TryGetValue("type", out var typeToken) ||
                typeToken.Type != JTokenType.String ||
                ((string)typeToken != "files" && (string)typeToken != "folder")
                )
            {
                throw new ConfigFileInvalidException(
                          GetMissingTypeMessage($"{sectionRootString}.{configFileSection.JsonPath}")
                          );
            }

            if ((string)typeToken == "files")
            {
                ProcessFilesList(
                    configObject,
                    configFileSection,
                    outputGroup,
                    addInclusionRule,
                    rootPath,
                    sectionRootString
                    );
            }
            else
            {
                ProcessFolder(
                    configObject,
                    configFileSection,
                    outputGroup,
                    addInclusionRule,
                    rootPath,
                    sectionRootString
                    );
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Get an encoding to use for the given input file
        /// </summary>
        /// <param name="outputGroup">output file</param>
        /// <param name="defaultEncodingName">default encoding name to use if none specified</param>
        /// <returns>encoding; UTF8 WITHOUT THE BOM is the default if nothing else specified</returns>
        public static Encoding GetEncoding(this OutputGroup outputGroup, string defaultEncodingName)
        {
            Encoding encoding = null;

            if (outputGroup != null)
            {
                // if none specified on the output group, use the default
                var encodingName = outputGroup.EncodingName.IfNullOrWhiteSpace(defaultEncodingName);
                if (!encodingName.IsNullOrWhiteSpace())
                {
                    try
                    {
                        // try to create an encoding from the encoding name
                        // using special encoder fallback determined earlier, or a default
                        // encoder fallback that uses the UNICODE "replace character" for
                        // things it doesn't understand, and a decoder replacement fallback
                        // that also uses the UNICODE "replacement character" for things it doesn't understand.
                        encoding = Encoding.GetEncoding(
                            encodingName,
                            GetEncoderFallback(outputGroup.CodeType),
                            new DecoderReplacementFallback("\uFFFD"));
                    }
                    catch (ArgumentException e)
                    {
                        // eat the exception and just go with UTF-8
                        System.Diagnostics.Debug.WriteLine(e.ToString());
                    }
                }
            }

            // the default output is UTF-8 WITHOUT the BOM if we are outputting to a file,
            // or ASCII if we are outputting to STDOUT
            if (encoding == null)
            {
                if (outputGroup == null || outputGroup.Path.IsNullOrWhiteSpace())
                {
                    // no output group or outputting to stdout (no output path)
                    encoding = (Encoding)Encoding.ASCII.Clone();
                    encoding.EncoderFallback = GetEncoderFallback(outputGroup.IfNotNull(g => g.CodeType));
                }
                else
                {
                    // outputting to file, use UTF-8 WITHOUT the BOM.
                    // don't need a fallback encoder for UTF-8.
                    encoding = new UTF8Encoding(false);
                }
            }

            return(encoding);
        }
Ejemplo n.º 17
0
 public FileListInclusionRule(
     IEnumerable <string> fileList,
     bool ignoreMissing,
     string exceptWhereExists,
     InputDataType inputDataType,
     OutputGroup outputGroup
     )
 {
     this.FileList          = fileList;
     this.IgnoreMissing     = ignoreMissing;
     this.ExceptWhereExists = exceptWhereExists;
     this.InputDataType     = inputDataType;
     this.outputGroup       = outputGroup;
 }
Ejemplo n.º 18
0
        protected override YAMLMappingNode ExportYAMLRoot(IAssetsExporter exporter)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(exporter);

            //node.AddSerializedVersion(GetSerializedVersion(exporter.Version));
            node.Add("m_OutputGroup", OutputGroup.ExportYAML(exporter));
            node.Add("m_MasterGroup", MasterGroup.ExportYAML(exporter));
            node.Add("m_Snapshots", Snapshots.ExportYAML(exporter));
            node.Add("m_StartSnapshot", StartSnapshot.ExportYAML(exporter));
            node.Add("m_SuspendThreshold", SuspendThreshold);
            node.Add("m_EnableSuspend", EnableSuspend);
            node.Add("m_UpdateMode", UpdateMode);
            node.Add("m_MixerConstant", MixerConstant.ExportYAML(exporter));
            return(node);
        }
Ejemplo n.º 19
0
        protected override YAMLMappingNode ExportYAMLRoot(IExportContainer container)
        {
            YAMLMappingNode node = base.ExportYAMLRoot(container);

            //node.AddSerializedVersion(GetSerializedVersion(container.Version));
            node.Add(OutputGroupName, OutputGroup.ExportYAML(container));
            node.Add(MasterGroupName, MasterGroup.ExportYAML(container));
            node.Add(SnapshotsName, Snapshots.ExportYAML(container));
            node.Add(StartSnapshotName, StartSnapshot.ExportYAML(container));
            node.Add(SuspendThresholdName, SuspendThreshold);
            node.Add(EnableSuspendName, EnableSuspend);
            node.Add(UpdateModeName, UpdateMode);
            node.Add(MixerConstantName, MixerConstant.ExportYAML(container));
            return(node);
        }
 public InputFileListFactoryTest()
 {
     this.outputGroup           = new OutputGroup("test");
     this.outputGroups          = new OutputGroupRepository();
     this.sectorDataFileFactory = SectorDataFileFactoryFactory.Make(new List <string>());
     this.inclusionRules        = new ConfigInclusionRules();
     inclusionRules.AddMiscInclusionRule(
         new FolderInclusionRule(
             ConvertPath("_TestData/InputFileListFactory"),
             false,
             InputDataType.ESE_AGREEMENTS,
             this.outputGroup
             )
         );
 }
Ejemplo n.º 21
0
        private IList <OutputItem> GetOutputItems(SlideMaster slideMaster = null)
        {
            var selectedSlideMaster = slideMaster ?? _slideContainer.SelectedSlide;
            var defaultOutputGroup  = new OutputGroup
            {
                Name      = "Preview",
                IsCurrent = true,
                Items     = new List <OutputItem>(new[]
                {
                    new OutputItem
                    {
                        Name                   = "Preview",
                        IsCurrent              = true,
                        SlidesCount            = 1,
                        PresentationSourcePath = Path.Combine(Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath,
                                                              Path.GetFileName(Path.GetTempFileName())),
                        SlideGeneratingAction = (processor, destinationPresentation) =>
                        {
                            var templatePath = selectedSlideMaster.GetMasterPath();
                            processor.AppendSlideMaster(templatePath, destinationPresentation);
                        },
                        PreviewGeneratingAction = (processor, presentationSourcePath) =>
                        {
                            var templatePath = selectedSlideMaster.GetMasterPath();
                            processor.PreparePresentation(presentationSourcePath,
                                                          presentation => processor.AppendSlideMaster(templatePath, presentation));
                        }
                    }
                })
            };

            var selectedOutputItems = new List <OutputItem>();

            using (var form = new FormPreview(
                       Controller.Instance.FormMain,
                       BusinessObjects.Instance.PowerPointManager.Processor))
            {
                form.LoadGroups(new[] { defaultOutputGroup });
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            return(selectedOutputItems);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Create ResourceString objects from all the input resources for an output group and add them to a list
        /// </summary>
        /// <param name="outputGroup">output group</param>
        /// <param name="resourceStringList">resource strings list</param>
        /// <param name="defaultResourceObjectName">optional default resource object name</param>
        public static void ProcessResourceStrings(this OutputGroup outputGroup, IList <ResourceStrings> resourceStringList, string defaultResourceObjectName)
        {
            if (outputGroup != null && resourceStringList != null)
            {
                foreach (var resource in outputGroup.Resources)
                {
                    // create the resource strings object from the resources file.
                    var resourceStrings = ProcessResourceFile(resource.Path);

                    // if there is no name specified in the resource element, use the default.
                    resourceStrings.Name = resource.Name.IfNullOrWhiteSpace(defaultResourceObjectName);

                    // add it to the given list.
                    resourceStringList.Add(resourceStrings);
                }
            }
        }
Ejemplo n.º 23
0
        /*private static int GetSerializedVersion(Version version)
         * {
         #warning TODO: serialized version acording to read version (current 2017.3.0f3)
         *      return 2;
         * }*/

        public override void Read(AssetStream stream)
        {
            base.Read(stream);

            OutputGroup.Read(stream);
            MasterGroup.Read(stream);
            m_snapshots = stream.ReadArray <PPtr <AudioMixerSnapshot> >();
            StartSnapshot.Read(stream);
            SuspendThreshold = stream.ReadSingle();
            EnableSuspend    = stream.ReadBoolean();
            stream.AlignStream(AlignType.Align4);

            UpdateMode = stream.ReadInt32();
            stream.AlignStream(AlignType.Align4);

            MixerConstant.Read(stream);
            stream.AlignStream(AlignType.Align4);
        }
Ejemplo n.º 24
0
        void AddLine_GUI(Line line, string applicationName)
        {
            var outputGroup = outputGroups.Find(x => x.ApplicationName.ToLower() == applicationName.ToLower());

            if (outputGroup == null)
            {
                outputGroup = new OutputGroup();
                outputGroup.ApplicationName = applicationName;
                outputGroups.Add(outputGroup);
            }
            line.Row = outputGroup.RowIndex++;
            outputGroup.Lines.Add(line);

            if (applicationName == CurrentOutput)
            {
                AddConsoleLine(line);
            }
        }
Ejemplo n.º 25
0
        /*public static int ToSerializedVersion(Version version)
         * {
         #warning TODO: serialized version acording to read version (current 2017.3.0f3)
         *      return 2;
         * }*/

        public override void Read(AssetReader reader)
        {
            base.Read(reader);

            OutputGroup.Read(reader);
            MasterGroup.Read(reader);
            Snapshots = reader.ReadAssetArray <PPtr <AudioMixerSnapshot> >();
            StartSnapshot.Read(reader);
            SuspendThreshold = reader.ReadSingle();
            EnableSuspend    = reader.ReadBoolean();
            reader.AlignStream();

            UpdateMode = reader.ReadInt32();
            reader.AlignStream();

            MixerConstant.Read(reader);
            reader.AlignStream();
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Process an output group. Override this method if the task doesn't want to check the input file times against
        /// the output file times (or existence) and call the GenerateOutput methods.
        /// </summary>
        /// <param name="outputGroup">the OutputGroup being processed</param>
        /// <param name="outputFileInfo">FileInfo for the desired output file</param>
        /// <param name="symbolsFileInfo">FileInfo for the optional desired symbol file</param>
        /// <param name="defaultSettings">default settings for this output group</param>
        /// <param name="manifestModifiedTime">modified time for the manifest</param>
        protected virtual void ProcessOutputGroup(OutputGroup outputGroup, FileInfo outputFileInfo, FileInfo symbolsFileInfo, SwitchParser defaultSettings, DateTime manifestModifiedTime)
        {
            // check the file times -- if any of the inputs are newer than any output (or if any outputs don't exist),
            // then generate the output files
            if (AnyInputsAreNewerThanOutputs(outputGroup, outputFileInfo, symbolsFileInfo, manifestModifiedTime))
            {
                // get the settings to use -- take the configuration for this output group
                // and apply them over the default settings
                var settings = ParseConfigSettings(outputGroup.GetConfigArguments(this.Configuration), defaultSettings);

                GenerateOutputFiles(outputGroup, outputFileInfo, settings);
            }
            else
            {
                // none of the inputs are newer than the output -- we're good.
                Log.LogMessage(Strings.SkippedOutputFile, outputFileInfo.IfNotNull(fi => fi.Name) ?? string.Empty);
            }
        }
Ejemplo n.º 27
0
        public override void ProcessReqsImmediatly()
        {
            try
            {
                mActive = false;

                ProcessReqs(mReqs);

                // Create Mesh
                foreach (OutpuRegion opr in mOutputs)
                {
                    List <OutputGroup> group = opr.groups;
                    for (int j = 0; j < group.Count; j++)
                    {
                        OutputGroup opg = group[j];

                        if (opg.node.IsOutOfDate())
                        {
                            continue;
                        }

                        RGLODQuadTreeNode node = opg.node;
                        string            desc = "Grass Batch [" + node.xIndex.ToString() + ", " + node.zIndex.ToString() + "] _ LOD [" + node.LOD + "]";
                        GameObject        go   = CreateBatchGos(desc, opg.billboard, opg.tri);
                        node.gameObject = go;

                        if (go != null)
                        {
                            go.transform.parent        = transform;
                            go.transform.localPosition = Vector3.zero;
                        }
                    }
                    ClearMeshes(opr.oldGos);
                }

                mOutputs.Clear();
                mIsGenerating = false;
                mActive       = false;
            }
            catch
            {
            }
        }
Ejemplo n.º 28
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        var story = target as Story;

        if (story == null || story.Output == null)
        {
            return;
        }

        EditorGUILayout.Separator();

        EditorGUILayout.LabelField("Story State", story.State.ToString());
        EditorGUILayout.LabelField("Current Passage", story.CurrentPassage == null ? "(none)" : story.CurrentPassage.Name);

        EditorGUILayout.Separator();

        int defaultIndent = EditorGUI.indentLevel;

        for (int i = 0; i < story.Output.Count; i++)
        {
            StoryOutput output = story.Output[i];

            if (output is Embed)
            {
                continue;
            }

            int         groupCount = 0;
            OutputGroup group      = output.Group;
            while (group != null)
            {
                groupCount++;
                group = group.Group;
            }
            EditorGUI.indentLevel = defaultIndent + groupCount;
            EditorGUILayout.LabelField(output.ToString());
        }

        EditorGUI.indentLevel = defaultIndent;
    }
 public FolderInclusionRule(
     string folder,
     bool recursive,
     InputDataType inputDataType,
     OutputGroup outputGroup,
     bool excludeList = true,
     List <string> includeExcludeFiles = null,
     Regex includePattern = null
     )
 {
     Folder              = folder;
     Recursive           = recursive;
     InputDataType       = inputDataType;
     this.outputGroup    = outputGroup;
     IncludePattern      = includePattern;
     ExcludeList         = excludeList;
     IncludeExcludeFiles = includeExcludeFiles != null
         ? includeExcludeFiles.ToList()
         : new List <string>();
 }
Ejemplo n.º 30
0
        protected override IList <OutputGroup> GeneratePreviewData(IList <CaledarMonthOutputItem> monthItems)
        {
            var previewGroups = new List <OutputGroup>();

            FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Calendar for Preview...");
            FormProgress.ShowProgress(FormMain);
            Enabled = false;
            foreach (var monthOutputItem in monthItems)
            {
                var tempPresentationPath = Path.Combine(Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath,
                                                        Path.GetFileName(Path.GetTempFileName()));
                var previewGroup = new OutputGroup
                {
                    Name      = monthOutputItem.DisplayName,
                    IsCurrent = monthOutputItem.IsCurrent,
                    Items     = new List <OutputItem>(new[]
                    {
                        new OutputItem
                        {
                            Name = monthOutputItem.DisplayName,
                            PresentationSourcePath = tempPresentationPath,
                            SlidesCount            = 1,
                            IsCurrent             = true,
                            SlideGeneratingAction = (processor, destinationPresentation) =>
                            {
                                processor.AppendCalendar(monthOutputItem.CalendarMonth.OutputData, destinationPresentation);
                            },
                            PreviewGeneratingAction = (processor, filePath) =>
                            {
                                processor.PrepareCalendarPreview(filePath, monthOutputItem.CalendarMonth.OutputData);
                            }
                        }
                    })
                };
                previewGroups.Add(previewGroup);
            }
            FormProgress.CloseProgress();
            Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false);

            return(previewGroups);
        }
Ejemplo n.º 31
0
        void AddLine_GUI(Line line, string applicationName)
        {
            var outputGroup = outputGroups.Find(x => x.ApplicationName.ToLower() == applicationName.ToLower());
            if (outputGroup == null)
            {
                outputGroup = new OutputGroup();
                outputGroup.ApplicationName = applicationName;
                outputGroups.Add(outputGroup);
            }
            line.Row = outputGroup.RowIndex++;
            outputGroup.Lines.Add(line);

            if (applicationName == CurrentOutput) AddConsoleLine(line);
        }