Example #1
0
 public X264LogParserService(IX264LogLineItemIdentifierService x264LogLineItemIdentifierService, X264LogFileSettings x264LogFileSerttings, List<X264LogFile> logFiles)
 {
     _x264LogLineItemIdentifierService = x264LogLineItemIdentifierService;
     _x264LogFileSerttings = x264LogFileSerttings;
     _logFiles = logFiles;
     _errors = new ErrorCollection();
 }
Example #2
0
 public X264EncodeService(IX264ValidationService validationService, X264FileSettings x264FileSettings, List<X264File> x264Files)
 {
     _x264Files = x264Files;
     _x264FileSettings = x264FileSettings;
     _errors = new ErrorCollection();
     _validationService = validationService;
 }
        /// <summary>
        /// Setup constructor
        /// </summary>
        /// <param name="parameters">Load parameters</param>
        /// <param name="errors">Error collection</param>
        /// <param name="reader">XML reader positioned at the element that created this builder</param>
        /// <param name="parentBuilder">Parent builder</param>
        public TypeBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder )
            : base(parameters, errors, reader, parentBuilder)
        {
            //  Retrieve type name and optional assembly name from the element
            string typeName     = reader.GetAttribute( "value" );
            string assemblyName = reader.GetAttribute( "assembly" );

            if ( typeName == null )
            {
                throw new ApplicationException( string.Format( "Element \"{0}\" requires a \"type\" attribute", reader.Name ) );
            }

            Type objectType = null;
            if ( assemblyName == null )
            {
                //  Get the object type from the currently loaded set of assemblies
                objectType = AppDomainUtils.FindType( typeName );
                if ( objectType == null )
                {
                    throw new ApplicationException( string.Format( "Failed to find type \"{0}\" in app domain" , typeName ) );
                }
            }
            else
            {
                //  Get the object type from the specified assembly
                Assembly assembly = AppDomain.CurrentDomain.Load( assemblyName );
                objectType = assembly.GetType( typeName );
                if ( objectType == null )
                {
                    throw new ApplicationException( string.Format( "Failed to find type \"{0}\" in assembly \"{1}\"", typeName, assemblyName ) );
                }
            }

            BuildObject = objectType;
        }
 public BluRaySummaryParserService(ILineItemIdentifierService lineItemIdentifierService, List<ProcessOutputLineItem> processOutputLineItems)
 {
     _lineItemIdentifierService = lineItemIdentifierService;
     _processOutputLineItems = processOutputLineItems;
     _summaryList = new List<BluRaySummaryInfo>();
     _errors = new ErrorCollection();
 }
 public bool IsValid()
 {
     if (!_eac3ToCommonRulesValidatorService.IsAtLeastOneDiscSelected())
     {
         _errors = _eac3ToCommonRulesValidatorService.Errors;
         return false;
     }
     if (!_eac3ToCommonRulesValidatorService.IsAtLeastOneSummarySelected())
     {
         _errors = _eac3ToCommonRulesValidatorService.Errors;
         return false;
     }
     if (!_eac3ToCommonRulesValidatorService.WhenSummarySelectedAtLeastOneStreamSelected())
     {
         _errors = _eac3ToCommonRulesValidatorService.Errors;
         return false;
     }
     if (!_eac3ToCommonRulesValidatorService.IsAllEpisodeNumbersSet())
     {
         _errors = _eac3ToCommonRulesValidatorService.Errors;
         return false;
     }
     if (!_eac3ToCommonRulesValidatorService.IsAllBluRayPathsValid())
     {
         _errors = _eac3ToCommonRulesValidatorService.Errors;
         return false;
     }
     return true;
 }
 public FFMSIndexBatchFileWriteService(EAC3ToConfiguration eac3toConfiguration, IDirectorySystemService directorySystemService, List<BluRayDiscInfo> bluRayDiscInfo, AbstractEAC3ToOutputNamingService eac3ToOutputNamingService)
 {
     _bluRayDiscInfoList = bluRayDiscInfo;
     _eac3toConfiguration = eac3toConfiguration;
     _directorySystemService = directorySystemService;
     _eac3ToOutputNamingService = eac3ToOutputNamingService;
     _errors = new ErrorCollection();
 }
 public void AddEmptyValidationErrors()
 {
     var errors = new ErrorCollection();
     var actualEvents = errors.SubscribeObservableCollectionEvents();
     errors.Add(ErrorCollection.EmptyValidationErrors);
     CollectionAssert.IsEmpty(actualEvents);
     CollectionAssert.IsEmpty(errors);
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="parameters">Load parameters</param>
 /// <param name="errors">Error collection</param>
 /// <param name="reader">XML reader positioned at the element that created this builder</param>
 /// <param name="parentBuilder">Parent builder</param>
 public ListBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder )
     : base(parameters, errors, reader, parentBuilder)
 {
     //  NOTE: AP: This Just Works, because the base builder implementation checks if BuildObject is an
     //  IList, and adds child build objects to it if so... this is all we need to do (in fact, <list>
     //  is just a shorthand for <object type="System.Collections.ArrayList">)
     BuildObject = m_BuildObjects;
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="parameters">Load parameters</param>
 /// <param name="errors">Error log</param>
 /// <param name="reader">XML reader positioned at the element that created this builder</param>
 public RootBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader )
     : base(parameters, errors, reader, null)
 {
     if ( reader.Name != "rb" )
     {
         errors.Add( reader, "Expected root node of component XML document to be named <rb>, not <{0}>", reader.Name );
     }
     BuildObject = parameters.Target ?? m_ChildObjects;
 }
        /// <summary>
        /// Setup constructor
        /// </summary>
        /// <param name="parameters">Load parameters</param>
        /// <param name="errors">Error collection</param>
        /// <param name="reader">XML reader positioned at the element that created this object</param>
        /// <param name="parentBuilder">Parent builder</param>
        public ObjectBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder )
            : base(parameters, errors, reader, parentBuilder)
        {
            //  Retrieve type name and optional assembly name from the element
            string typeName = reader.GetAttribute( "type" );
            string assemblyName = reader.GetAttribute( "assembly" );

            Construct( reader.Name, typeName, assemblyName );
        }
 public EAC3ToBatchFileWriteService(EAC3ToConfiguration eac3toConfiguration, IDirectorySystemService directorySystemService, List<BluRayDiscInfo> bluRayDiscInfo, IAudioService audioService, AbstractEAC3ToOutputNamingService eac3ToOutputNamingService, IEAC3ToCommonRulesValidatorService eac3ToCommonRulesValidatorService)
 {
     _bluRayDiscInfoList = bluRayDiscInfo;
     _eac3toConfiguration = eac3toConfiguration;
     _directorySystemService = directorySystemService;
     _audioService = audioService;
     _eac3ToOutputNamingService = eac3ToOutputNamingService;
     _eac3ToCommonRulesValidatorService = eac3ToCommonRulesValidatorService;
     _errors = new ErrorCollection();
 }
 public static void Parse(AAProgram ast, ErrorCollection errors, SharedData data, out string rootFile)
 {
     FinalTransformations finalTrans = new FinalTransformations(errors, data);
     finalTrans.Apply(ast);
     AASourceFile rootSrcFile = Util.GetAncestor<AASourceFile>(finalTrans.mainEntry);
     if (rootSrcFile == null)
         rootFile = "";
     else
         rootFile = rootSrcFile.GetName().Text + ".galaxy";
 }
 public MKVMergeBatchFileWriteForEncodeService(BatchGuyEAC3ToSettings batchGuyEAC3ToSettings, IDirectorySystemService directorySystemService, IAudioService audioService, AbstractEAC3ToOutputNamingService eac3ToOutputNamingService, IEAC3ToCommonRulesValidatorService eac3ToCommonRulesValidatorService)
 {
     _batchGuyEAC3ToSettings = batchGuyEAC3ToSettings;
     _bluRayDiscInfoList = _batchGuyEAC3ToSettings.BluRayDiscs;
     _eac3toConfiguration = _batchGuyEAC3ToSettings.EAC3ToSettings;
     _directorySystemService = directorySystemService;
     _audioService = audioService;
     _eac3ToOutputNamingService = eac3ToOutputNamingService;
     _eac3ToCommonRulesValidatorService = eac3ToCommonRulesValidatorService;
     _errors = new ErrorCollection();
 }
 public void AddWithTwo()
 {
     var errors = new ErrorCollection();
     var changes = errors.SubscribeErrorCollectionEvents();
     var actualEvents = errors.SubscribeObservableCollectionEvents();
     var error1 = Factory.CreateValidationError();
     var error2 = Factory.CreateValidationError();
     errors.Add(Factory.CreateReadOnlyObservableCollection(error1, error2));
     CollectionAssert.AreEqual(new[] { error1, error2 }, errors);
     CollectionAssert.AreEqual(Factory.ResetArgs(), actualEvents, ObservableCollectionArgsComparer.Default);
     CollectionAssert.AreEqual(new[] { Factory.CreateAddedEventArgs(error1, error2) }, changes, ErrorsChangedEventArgsComparer.Default);
 }
Example #15
0
        public ErrorCollection CreateAVSFiles()
        {
            _errors = _validationService.Validate();
            if (_errors.Count == 0)
            {
                _avsFiles = _fileService.CreateAVSFileList();
                this.Delete();
                this.WriteAVSStreams();
            }

            return _errors;
        }
 public void AddWithOne()
 {
     var reference = new ObservableCollection<ValidationError>();
     var referenceEvents = reference.SubscribeObservableCollectionEvents();
     var errors = new ErrorCollection();
     var changes = errors.SubscribeErrorCollectionEvents();
     var actualEvents = errors.SubscribeObservableCollectionEvents();
     var error = Factory.CreateValidationError();
     errors.Add(Factory.CreateReadOnlyObservableCollection(error));
     reference.Add(error);
     CollectionAssert.AreEqual(reference, errors);
     CollectionAssert.AreEqual(referenceEvents, actualEvents, ObservableCollectionArgsComparer.Default);
     CollectionAssert.AreEqual(new[] { Factory.CreateAddedEventArgs(error) }, changes, ErrorsChangedEventArgsComparer.Default);
 }
        public ApplicationSettingsService(IJsonSerializationService<ApplicationSettings> jsonSerializationService, IAudioService audioService)
        {
            _errors = new ErrorCollection();
            _jsonSerializationService = jsonSerializationService;
            _audioService = audioService;
            Uri uri = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase));
            _applicationDirectory =  uri.LocalPath;
            _applicationSettings = new ApplicationSettings() { ApplicationDirectory = _applicationDirectory };

            if (File.Exists(_applicationSettings.SettingsFile))
            {
                this.LoadSettingsFromConfigFile();
            }

            new SettingsDefaultSeedDataService(_applicationSettings, _audioService).Create();
        }
        /// <summary>
        /// Setup constructor
        /// </summary>
        /// <param name="parameters">Load parameters</param>
        /// <param name="errors">Error collection</param>
        /// <param name="reader">XML reader positioned at the element that created this builder</param>
        /// <param name="parentBuilder">Parent builder</param>
        public BaseBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder )
        {
            IXmlLineInfo lineInfo = reader as IXmlLineInfo;
            if ( lineInfo != null )
            {
                m_Line      = lineInfo.LineNumber;
                m_Column    = lineInfo.LinePosition;
            }

            m_ParentBuilder = parentBuilder;
            m_Errors        = errors;
            m_Parameters    = parameters;
            m_Property      = reader.GetAttribute( "property" );
            m_DynProperty   = reader.GetAttribute( "dynProperty" );
            m_Name          = reader.GetAttribute( "name" );
            m_Id            = reader.GetAttribute( "id" );
        }
        /// <summary>
        /// Setup constructor
        /// </summary>
        /// <param name="parameters">Load parameters</param>
        /// <param name="errors">Error collection</param>
        /// <param name="reader">XML reader positioned at the element that created this builder</param>
        /// <param name="parentBuilder">Parent builder</param>
        public AssetBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder )
            : base(parameters, errors, reader, parentBuilder)
        {
            string assetPath = reader.GetAttribute( "path" );

            string instance = reader.GetAttribute( "instance" );
            m_Instance = string.IsNullOrEmpty( instance ) ? false : bool.Parse( instance );
            m_Loader = AssetManager.Instance.CreateLoadState( Locations.NewLocation( assetPath ), null );

            string useCurrentParams = reader.GetAttribute( "useCurrentParameters" );
            if ( useCurrentParams != null )
            {
                if ( bool.Parse( useCurrentParams ) )
                {
                    m_Loader.Parameters = Parameters;
                }
            }
        }
        private void Initialize(ManagedInstanceDirective directive = null)
        {
            Directives = directive ?? new ManagedInstanceDirective();

            Log.Logger.Debug("Instance initialized with {@directive}", Directives);

            Information = new Information(this);
            Statistics = new Statistic(this);
            Synchronization = new Synchronization(this);

            Announcers = new AnnouncerCollection();
            Folders = new FoldersCollection();
            Errors = new ErrorCollection();

            PossibleEndpoints = new RestEndpointCollection();

            Id = Guid.NewGuid();

            ConfigureThreads();
            ConfigureStateMachine();
        }
 public ValidationException(string message, ErrorCollection errors)
     : base(message)
 {
     foreach (Error error in errors)
         this.Errors.Add(error);
 }
 internal static EventList SubscribeErrorCollectionEvents(this ErrorCollection col)
 {
     return(new EventList(col));
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="parameters">Load parameters</param>
 /// <param name="errors">Error collection</param>
 /// <param name="reader">XML reader positioned at the element that created this object</param>
 /// <param name="parentBuilder">Parent builder</param>
 /// <param name="typeName">Name of the type to create</param>
 public ObjectBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder, string typeName )
     : base(parameters, errors, reader, parentBuilder)
 {
     string assemblyName = reader.GetAttribute( "assembly" );
     Construct( reader.Name, typeName, assemblyName );
 }
 public SetArrayIndexes(SharedData data, ErrorCollection errors)
 {
     this.data = data;
     this.errors = errors;
 }
        public ErrorEventHandler(ErrorCollection collection)
        {
            _collection = collection;

            collection.CollectionChanged += OnCollectionChanged;
        }
Example #26
0
        /// <summary>
        /// Creates a compiler instance based on the <see cref="StubType" /> of <paramref name="project" />.
        /// </summary>
        /// <param name="project">The project to compile.</param>
        /// <param name="intermediateDirectory">The intermediate directory path to store temporary files during compilations.</param>
        /// <param name="outputFileName">The path to the final output file.</param>
        /// <param name="errors">The <see cref="ErrorCollection" /> to write compilation errors to.</param>
        /// <returns>A new instance of a class that inherits <see cref="ProjectCompiler" />.</returns>
        public static ProjectCompiler Create(ProjectFile project, string intermediateDirectory, string outputFileName, ErrorCollection errors)
        {
            DirectoryEx.DeleteContents(intermediateDirectory, true);
            Directory.CreateDirectory(Path.Combine(intermediateDirectory, "src"));
            Directory.CreateDirectory(Path.Combine(intermediateDirectory, "bin"));

            switch (project.Stub.Type)
            {
            case StubType.Pe32:
                return(new Pe32Compiler(project, intermediateDirectory, outputFileName, errors));

            case StubType.DotNet32:
            case StubType.DotNet64:
                return(new DotNetCompiler(project, intermediateDirectory, outputFileName, errors));

            default:
                throw new InvalidEnumArgumentException();
            }
        }
        public string this[string propertyname]
        {
            get
            {
                string result = null;
                switch (propertyname)
                {
                case "EntityNameTxt":
                    if (string.IsNullOrWhiteSpace(EntityNameTxt))
                    {
                        result = "Entity Name cannot be empty";
                    }
                    else if (IsBeginWNum(EntityNameTxt))
                    {
                        result = "Cannot begin with a number";
                    }
                    else if (IsValidName(EntityNameTxt))
                    {
                        result = "Not a valid name. Only Letters, Numbers or underscore are allowed";
                    }
                    else if (IsReservedWord(EntityNameTxt))
                    {
                        result = "This is a Reserved Word";
                    }
                    break;

                case "PortNameTxt":
                    if (string.IsNullOrWhiteSpace(PortNameTxt))
                    {
                        result = "Port Name cannot be empty";
                    }
                    else if (IsBeginWNum(PortNameTxt))
                    {
                        result = "Cannot begin with a number";
                    }
                    else if (IsValidName(PortNameTxt))
                    {
                        result = "Not a valid name. Only Letters, Numbers or underscore are allowed";
                    }
                    else if (IsReservedWord(PortNameTxt))
                    {
                        result = "This is a Reserved Word";
                    }
                    break;

                case "DirectionSel":
                    if (!IsDirectionSel(DirectionSel))
                    {
                        result = "No Direction Selected";
                    }
                    break;

                case "MsbTxt":
                    if (BitsEnable == true)
                    {
                        if (string.IsNullOrWhiteSpace(MsbTxt))
                        {
                            result = "MSB cannot be empty";
                        }
                        else if (IsInterger(MsbTxt))
                        {
                            result = "Only Integers are allowed";
                        }
                        break;
                    }
                    else
                    {
                        break;
                    }

                case "LsbTxt":
                    if (BitsEnable == true)
                    {
                        if (string.IsNullOrWhiteSpace(LsbTxt))
                        {
                            result = "LSB cannot be empty";
                        }
                        else if (IsInterger(LsbTxt))
                        {
                            result = "Only Integers are allowed";
                        }
                        break;
                    }
                    else
                    {
                        break;
                    }
                }

                if (ErrorCollection.ContainsKey(propertyname))
                {
                    ErrorCollection[propertyname] = result;
                }
                else if (result != null)
                {
                    ErrorCollection.Add(propertyname, result);
                }

                OnPropertyChanged("ErrorCollection");
                OnPropertyChanged("FinishEnable");
                OnPropertyChanged("AddPortEnable");
                return(result);
            }
        }
Example #28
0
 public ResourceException(string message, int code, ErrorCollection errorCollection) : base(message)
 {
     Code   = code;
     Errors = errorCollection;
 }
Example #29
0
 public static void Add(int errornumber)
 {
     Add(ErrorCollection.GetError(errornumber));
 }
Example #30
0
 internal Pe32Compiler(ProjectFile project, string intermediateDirectory, string outputFileName, ErrorCollection errors) : base(project, intermediateDirectory, outputFileName, errors)
 {
     Helper = new CompilerHelper(Project, Errors);
 }
Example #31
0
 public BatchGuyEAC3ToSettingsService(IJsonSerializationService <BatchGuyEAC3ToSettings> jsonSerializationService)
 {
     _jsonSerializationService = jsonSerializationService;
     _errors = new ErrorCollection();
 }
Example #32
0
 public CodeGeneration(ErrorCollection errors, SharedData data, DirectoryInfo outputDir)
 {
     this.errors    = errors;
     this.data      = data;
     this.outputDir = outputDir;
 }
Example #33
0
 public static void Parse(AAProgram ast, ErrorCollection errors, SharedData data, DirectoryInfo outputDir)
 {
     ast.Apply(new CodeGeneration(errors, data, outputDir));
 }
Example #34
0
        public ErrorCollection CreateX264File()
        {
            _errors = _validationService.Validate();

            if (_errors.Count() == 0)
            {
                switch (_x264FileSettings.EncodeType)
                {
                    case EnumEncodeType.CRF:
                        this.CreateCRFX264File();
                        break;
                    case EnumEncodeType.TwoPass:
                        this.CreateTwoPassX264File();
                        break;
                    default:
                        _errors.Add(new Error() { Description = "Invalid x264 encode type" });
                        break;
                }
            }
            return _errors;
        }
Example #35
0
 protected void AddErrors(ErrorCollection errors)
 {
     _notification.AddErrors(errors);
 }
Example #36
0
 public EnviromentBuilding(ErrorCollection errors, SharedData data)
 {
     this.errors = errors;
     this.data   = data;
 }
Example #37
0
        public static ProjectModel FromProjectFile(string path, out ErrorCollection errors)
        {
            errors = new ErrorCollection();

            if (ProjectFile.FromFile(path, errors) is ProjectFile file)
            {
                ProjectModel project = new ProjectModel(Path.GetFileName(path));

                project.Stub.Type     = file.Stub.Type;
                project.Stub.IconPath = file.Stub.IconPath;
                project.Stub.Padding  = file.Stub.Padding;

                project.Startup.Melt = file.Startup.Melt;

                project.VersionInfo.FileDescription = file.VersionInfo.FileDescription;
                project.VersionInfo.ProductName     = file.VersionInfo.ProductName;
                if (Version.TryParse(file.VersionInfo.FileVersion, out Version fileVersion))
                {
                    project.VersionInfo.FileVersion1 = fileVersion.Major;
                    project.VersionInfo.FileVersion2 = fileVersion.Minor;
                    project.VersionInfo.FileVersion3 = fileVersion.Build;
                    project.VersionInfo.FileVersion4 = fileVersion.Revision;
                }
                project.VersionInfo.ProductVersion   = file.VersionInfo.ProductVersion;
                project.VersionInfo.Copyright        = file.VersionInfo.Copyright;
                project.VersionInfo.OriginalFilename = file.VersionInfo.OriginalFilename;

                project.Manifest.UseNone     = file.Manifest.Template == null && file.Manifest.Template == null;
                project.Manifest.UseTemplate = file.Manifest.Template != null;
                project.Manifest.UseFile     = file.Manifest.Path != null;
                if (file.Manifest.Template != null)
                {
                    project.Manifest.Template = file.Manifest.Template.Value;
                }
                if (file.Manifest.Path != null)
                {
                    project.Manifest.Path = file.Manifest.Path;
                }

                foreach (ProjectAction action in file.Actions)
                {
                    ProjectItemModel item;

                    if (action is RunPEAction)
                    {
                        item = new ProjectRunPEItemModel();
                    }
                    else if (action is InvokeAction)
                    {
                        item = new ProjectInvokeItemModel();
                    }
                    else if (action is DropAction dropAction)
                    {
                        item = new ProjectDropItemModel
                        {
                            Location            = dropAction.Location,
                            FileName            = dropAction.FileName,
                            FileAttributeHidden = dropAction.FileAttributeHidden,
                            FileAttributeSystem = dropAction.FileAttributeSystem,
                            ExecuteVerb         = dropAction.ExecuteVerb
                        };
                    }
                    else if (action is MessageBoxAction messageBoxAction)
                    {
                        item = new ProjectMessageBoxItemModel
                        {
                            Title    = messageBoxAction.Title,
                            Text     = messageBoxAction.Text,
                            Icon     = messageBoxAction.Icon,
                            Buttons  = messageBoxAction.Buttons,
                            OnOk     = messageBoxAction.OnOk,
                            OnCancel = messageBoxAction.OnCancel,
                            OnYes    = messageBoxAction.OnYes,
                            OnNo     = messageBoxAction.OnNo,
                            OnAbort  = messageBoxAction.OnAbort,
                            OnRetry  = messageBoxAction.OnRetry,
                            OnIgnore = messageBoxAction.OnIgnore
                        };
                    }
                    else
                    {
                        throw new InvalidOperationException();
                    }

                    if (!(action is MessageBoxAction))
                    {
                        item.SourceId = action.Source.Id;

                        if (action.Source is EmbeddedSource embeddedSource)
                        {
                            item.Source                 = ProjectItemSource.Embedded;
                            item.SourceEmbeddedPath     = embeddedSource.Path;
                            item.SourceEmbeddedCompress = embeddedSource.Compress;
                            item.SourceEmbeddedEofData  = embeddedSource.EofData;
                        }
                        else if (action.Source is DownloadSource downloadSource)
                        {
                            item.Source            = ProjectItemSource.Download;
                            item.SourceDownloadUrl = downloadSource.Url;
                        }
                        else
                        {
                            throw new InvalidOperationException();
                        }
                    }

                    project.Items.Add(item);
                }

                return(project);
            }
            else
            {
                return(null);
            }
        }
 public Enheritance(SharedData data, ErrorCollection errors)
 {
     this.data   = data;
     this.errors = errors;
 }
Example #39
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectCompiler" /> class.
 /// </summary>
 /// <param name="project">The project file to be associated with this <see cref="ProjectCompiler" /> instance.</param>
 /// <param name="intermediateDirectory">The intermediate directory path to store temporary files during compilations.</param>
 /// <param name="outputFileName">The path to the final output file.</param>
 /// <param name="errors">The <see cref="ErrorCollection" /> to write compilation errors to.</param>
 protected ProjectCompiler(ProjectFile project, string intermediateDirectory, string outputFileName, ErrorCollection errors)
 {
     Project = project;
     IntermediateDirectory = intermediateDirectory;
     OutputFileName        = outputFileName;
     Errors = errors;
 }
Example #40
0
 public MakeEnrichmentLinks(SharedData data, ErrorCollection errors)
 {
     this.data   = data;
     this.errors = errors;
 }
 public FixGenerics(ErrorCollection errors, SharedData data)
 {
     this.errors = errors;
     this.data = data;
 }
Example #42
0
        private void bgwCreateAviSynthFiles_DoWork(object sender, DoWorkEventArgs e)
        {
            ErrorCollection errors = _avsService.CreateAVSFiles();

            e.Result = errors;
        }
Example #43
0
        internal void Finish(OidCollection applicationPolicy, OidCollection certificatePolicy)
        {
            WorkingChain workingChain = null;

            // If the chain had any errors during the previous build we need to walk it again with
            // the error collector running.
            if (Interop.Crypto.X509StoreCtxGetError(_storeCtx) !=
                Interop.Crypto.X509VerifyStatusCode.X509_V_OK)
            {
                Interop.Crypto.X509StoreCtxReset(_storeCtx);

                workingChain = new WorkingChain();
                Interop.Crypto.X509StoreVerifyCallback workingCallback = workingChain.VerifyCallback;
                Interop.Crypto.X509StoreCtxSetVerifyCallback(_storeCtx, workingCallback);

                bool verify = Interop.Crypto.X509VerifyCert(_storeCtx);

                if (workingChain.AbortedForSignatureError)
                {
                    Debug.Assert(!verify, "verify should have returned false for signature error");
                    CloneChainForSignatureErrors();

                    // Reset to a WorkingChain that won't fail.
                    workingChain    = new WorkingChain(abortOnSignatureError: false);
                    workingCallback = workingChain.VerifyCallback;
                    Interop.Crypto.X509StoreCtxSetVerifyCallback(_storeCtx, workingCallback);

                    verify = Interop.Crypto.X509VerifyCert(_storeCtx);
                }

                GC.KeepAlive(workingCallback);

                // Because our callback tells OpenSSL that every problem is ignorable, it should tell us that the
                // chain is just fine (unless it returned a negative code for an exception)
                Debug.Assert(verify, "verify should have returned true");

                const Interop.Crypto.X509VerifyStatusCode NoCrl =
                    Interop.Crypto.X509VerifyStatusCode.X509_V_ERR_UNABLE_TO_GET_CRL;

                ErrorCollection?errors =
                    workingChain.LastError > 0 ? (ErrorCollection?)workingChain[0] : null;

                if (_revocationMode == X509RevocationMode.Online &&
                    _remainingDownloadTime > TimeSpan.Zero &&
                    errors?.HasError(NoCrl) == true)
                {
                    Interop.Crypto.X509VerifyStatusCode ocspStatus = CheckOcsp();

                    ref ErrorCollection refErrors = ref workingChain[0];

                    if (ocspStatus == Interop.Crypto.X509VerifyStatusCode.X509_V_OK)
                    {
                        refErrors.ClearError(NoCrl);
                    }
                    else if (ocspStatus != NoCrl)
                    {
                        refErrors.ClearError(NoCrl);
                        refErrors.Add(ocspStatus);
                    }
                }
            }
Example #44
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompilerHelper" /> class.
 /// </summary>
 /// <param name="project">The <see cref="ProjectFile" /> associated with this helper class instance.</param>
 /// <param name="errors">The <see cref="ErrorCollection" /> associated with this helper class instance.</param>
 public CompilerHelper(ProjectFile project, ErrorCollection errors)
 {
     Project = project;
     Errors  = errors;
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="parameters">Load parameters</param>
 /// <param name="errors">Error collection</param>
 /// <param name="reader">XML reader positioned at the element that created this builder</param>
 /// <param name="parentBuilder">Parent builder</param>
 public InstanceBuilder( ComponentLoadParameters parameters, ErrorCollection errors, XmlReader reader, BaseBuilder parentBuilder )
     : base(parameters, errors, reader, parentBuilder)
 {
 }
Example #46
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProjectFileHelper" /> class.
 /// </summary>
 /// <param name="projectFilePath">The path to the project file that is currently processed.</param>
 /// <param name="ini">The <see cref="IniFile" /> associated with this helper class instance.</param>
 /// <param name="project">The <see cref="ProjectFile" /> associated with this helper class instance.</param>
 /// <param name="errors">The <see cref="ErrorCollection" /> associated with this helper class instance.</param>
 public ProjectFileHelper(string projectFilePath, IniFile ini, ProjectFile project, ErrorCollection errors)
 {
     ProjectFilePath = projectFilePath;
     Ini             = ini;
     Project         = project;
     Errors          = errors;
 }
 public ValidationException(ErrorCollection errors)
     : base("O objeto é inválido.")
 {
     foreach (Error error in errors)
         this.Errors.Add(error);
 }
Example #48
0
 public static void Parse(AAProgram ast, ErrorCollection errors, SharedData data)
 {
     ast.Apply(new Weeder(errors, data));
 }
 public ValidationException(string message, Exception inner, ErrorCollection errors)
     : base(message, inner)
 {
 }
        /// <summary>
        /// Loads component XML from a stream
        /// </summary>
        public object Load( Stream stream, ISource source, LoadParameters parameters )
        {
            if ( !( parameters is ComponentLoadParameters ) )
            {
                ComponentLoadParameters newParameters = new ComponentLoadParameters( parameters.Target );

                foreach ( IDynamicProperty property in parameters.Properties )
                {
                    newParameters.Properties.Add( property );
                }

                parameters = newParameters;
            }

            parameters.CanCache = false;

            ErrorCollection errors = new ErrorCollection( string.Copy( source.Path ) );

            XmlTextReader reader = new XmlTextReader( stream );
            reader.WhitespaceHandling = WhitespaceHandling.Significant;
            try
            {
                if ( reader.MoveToContent( ) == XmlNodeType.None )
                {
                    AssetsLog.Warning( "XML component asset \"{0}\" was empty - returning null", source.Name );
                    return null;
                }
            }
            catch ( XmlException ex )
            {
                AssetsLog.Error( "Moving to XML component asset \"{0}\" content threw an exception", source.Name );

                Entry entry = new Entry( AssetsLog.GetSource( Severity.Error ), ex.Message );
                Source.HandleEntry( entry.Locate( source.Path, ex.LineNumber, ex.LinePosition, "" ) );

                throw new ApplicationException( string.Format( "Failed to load component XML asset \"{0}\" (see log for details)", source.Name ) );
            }

            string cacheable = reader.GetAttribute( "cacheable" );
            parameters.CanCache = ( cacheable != null ) && ( ( cacheable == "yes" ) || ( cacheable == "true" ) );

            RootBuilder builder = ( RootBuilder )BaseBuilder.CreateBuilderFromReader( null, ( ComponentLoadParameters )parameters, errors, reader );

            if ( errors.Count == 0 )
            {
                BaseBuilder.SafePostCreate( builder );
                if ( errors.Count == 0 )
                {
                    BaseBuilder.SafeResolve( builder, true );
                }
            }

            if ( ( builder.BuildObject == null ) && ( errors.Count == 0 ) )
            {
                errors.Add( builder, "Empty components file" );
            }

            if ( errors.Count > 0 )
            {
                foreach ( Entry error in errors )
                {
                    Source.HandleEntry( error );
                }
                throw new ApplicationException( string.Format( "Failed to load component XML asset \"{0}\" (see log for details)", source.Name ) );
            }

            //	TODO: AP: bit dubious... if there's more than one object, return a list
            if ( builder.Children.Count == 0 )
            {
                throw new ApplicationException( string.Format( "Failed to load component XML asset \"{0}\" - did not contain any components", source.Name ) );
            }
            if ( builder.Children.Count == 1 )
            {
                return builder.Children[ 0 ];
            }
            return builder.Children;
        }
 public EventList(ErrorCollection source)
 {
     this.source           = source;
     source.ErrorsChanged += this.Add;
 }
Example #52
0
 public AviSynthValidationService(AviSynthBatchSettings avsBatchSettings)
 {
     _avsBatchSettings = avsBatchSettings;
     _errors           = new ErrorCollection();
 }
Example #53
0
 public static void Parse(AAProgram ast, ErrorCollection errors, SharedData data)
 {
     ast.Apply(new EnviromentBuilding(errors, data));
 }
 protected IActionResult Errors(ErrorCollection errors)
 {
     return(errors.AsActionResult());
 }