コード例 #1
0
        protected override void ConfigureObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                var connectionScope = ((FileConnectionProvider)FileConnectionProvider).ConnectionScope;
                var newWmiDataProvider = new WmiDataProvider(connectionScope);
                var newFileProvider = new WindowsFileProvider(TargetInfo) { WmiDataProvider = newWmiDataProvider };

                ObjectCollector = new TextFileContentObjectCollector() { FileContentProvider = newFileProvider, TargetInfo = TargetInfo };
                FileDataSource = new FileObjectCollector() { WmiDataProvider = newWmiDataProvider };
            }

            if (base.ItemTypeGenerator == null)
            {
                var newFileProvider =
                    new WindowsFileProvider(this.TargetInfo)
                    {
                        WmiDataProvider =
                            WmiDataProviderFactory
                                .CreateWmiDataProviderForFileSearching(this.TargetInfo)
                    };

                var newOperationEvaluator =
                    new TextFileContentEntityOperationEvaluator(ObjectCollector, newFileProvider, FamilyEnumeration.windows);

                ItemTypeGenerator = new TextFileContentItemTypeGenerator()
                {
                    OperationEvaluator = newOperationEvaluator
                };
            }
        }
コード例 #2
0
 public TextFileContentObjectCollectorTests()
 {
     this.ObjectCollector =
         GetTextFileContentObjectCollectorWithMockBehavior(
             new string[] { "Line 1", "Line 2", "Line 3", "Line N", "" });
 }
コード例 #3
0
 public TextFileContentEntityOperationEvaluator(BaseObjectCollector systemDataSource, IFileProvider fileDataSource, FamilyEnumeration platform)
 {
     this.TextFileContentDataSource = systemDataSource;
     this.PathOperatorEvaluator = new PathOperatorEvaluator(fileDataSource, platform);
 }
コード例 #4
0
        /// <summary>
        /// This is a temporary code in order to keep unit tests and oval interpreter prototype compatible.
        /// This method should be replace by dependency injection pattern.
        /// </summary>
        protected override void ConfigureObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                var newWmiProvider = this.CreateWmiProviderFromProberConnection();
                base.ObjectCollector = new FileEffectiveRightsObjectCollector() { WmiDataProvider = newWmiProvider };
                this.FileSystemDataSource = new FileObjectCollector() { WmiDataProvider = newWmiProvider };
            }

            if (base.ItemTypeGenerator == null)
                base.ItemTypeGenerator = new FileEffectiveRightsItemTypeGenerator() { SystemDataSource = base.ObjectCollector, FileDataSource = FileSystemDataSource };
        }
コード例 #5
0
 public RegistryEntityOperationEvaluator(BaseObjectCollector systemDataSource, WmiDataProvider wmiDataProvider)
 {
     this.systemDataSource = systemDataSource;
     this.wmiDataProvider = wmiDataProvider;
 }
コード例 #6
0
ファイル: FileContentProber.cs プロジェクト: jonaslsl/modSIC
        private void CreateObjectCollector()
        {
            if (base.ObjectCollector == null)
            {
                base.ObjectCollector = new FileContentSystemDataSource(TargetInfo.GetAddress());

                var wmiConnectionScope =
                this.FileDataSource = new FileObjectCollector() { WmiDataProvider = CreateWmiDataProvider() };
            }
        }
コード例 #7
0
 public FileContentEntityOperationEvaluator(BaseObjectCollector systemDataSource, IFileProvider fileProvider)
 {
     this.systemDataSource = systemDataSource;
     pathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows);
 }
コード例 #8
0
 public FileEffectiveRightsOperationEvaluator(BaseObjectCollector sytemDataSource, IFileProvider fileProvider)
 {
     this.systemDataSource = sytemDataSource;
     this.pathOperatorEvaluator = new PathOperatorEvaluator(fileProvider, FamilyEnumeration.windows);
 }