// Load items using the specified loader
        public async void Load(ILoader loader)
        {
            _loader = loader;
            _loadingStatusIndicator.LoadingMessage = _loader.LoadingMessage;            

            var selectedItem = _list.SelectedItem as SearchResultPackageMetadata;

            _items.Clear();
            _items.Add(_loadingStatusIndicator);
            _startIndex = 0;            

            // now the package list
            await Load();

            if (selectedItem != null)
            {
                // select the the previously selected item if it still exists.
                foreach (var item in _list.Items)
                {
                    var package = item as SearchResultPackageMetadata;
                    if (package == null)
                    {
                        continue;
                    }

                    if (package.Id.Equals(selectedItem.Id, StringComparison.OrdinalIgnoreCase))
                    {
                        _list.SelectedItem = item;
                        break;
                    }
                }
            }
        }
        public static QueryBoostingContext Load(string fileName, ILoader loader, FrameworkLogger logger)
        {
            try
            {
                using (var reader = loader.GetReader(fileName))
                {
                    var serializer = new JsonSerializer();

                    var value = serializer.Deserialize<QueryBoostingContext>(reader);

                    return value;
                }
            }
            catch (Exception ex)
            {
                if (IndexingUtils.IsFatal(ex))
                {
                    throw;
                }

                logger.LogError($"Unable to load {fileName}.", ex);
            }

            return Default;
        }
Пример #3
0
        public GCalculationView()
        {
            InitializeComponent();
            this._lstMonitor = new List<ICalculationMonitor>();
            //_fcName = new TnFeatureClassName();
            _dicSql = new Dictionary<EnumG1ArcGisTnRecType, string>();
            //_dicSql.Add(EnumG1ArcGisTnRecType.Doanduong, string.Format("select {0},{1},{2} from {3} where {4}=N'{5}'", _fcName.FC_DUONG.MA_DUONG, _fcName.FC_DUONG.BAT_DAU, _fcName.FC_DUONG.KET_THUC, "sde.thixa_duong", _fcName.FC_DUONG.TEN_DUONG, v));
            //_dicSql.Add(EnumG1ArcGisTnRecType.Doanduong, );
            //_sql = string.Format("select {0},{1},{2} from {3} where {4}='a'", _fcName.FC_DUONG.MA_DUONG, _fcName.FC_DUONG.BAT_DAU, _fcName.FC_DUONG.KET_THUC, "sde.thixa_duong", _fcName.FC_DUONG.TEN_DUONG);
            //_dicSql.Add(EnumG1ArcGisTnRecType.Doanduong, "");
            //_dicSql.Add(EnumG1ArcGisTnRecType.Duong, string.Format("select distinct {0} from {1}", _fcName.FC_DUONG.TEN_DUONG, "sde.thixa_duong"));
            //_dicSql.Add(EnumG1ArcGisTnRecType.Huyen, "");
            //_dicSql.Add(EnumG1ArcGisTnRecType.Xa, string.Format("select {0},{1} from {2}", _fcName.FC_RANH_XA_POLY.MA_XA, _fcName.FC_RANH_XA_POLY.TEN_XA, "sde.THIXA_XAPOLY"));
            _dicSql.Add(EnumG1ArcGisTnRecType.Doanduong, "");
            _dicSql.Add(EnumG1ArcGisTnRecType.Duong, "");
            _dicSql.Add(EnumG1ArcGisTnRecType.Huyen, "");
            _dicSql.Add(EnumG1ArcGisTnRecType.Xa, "");

            _loader = new Loader(this);
            _loader.Finished += new LoaderFinishedEventHandler(loader_Finished);
            _loaderController = new LoaderController(this, _loader);
            this.btnCloseFrmTinhAll.Click += new EventHandler(btnCloseFrmTinhAll_Click);
            this.cbxDuong.Click += new EventHandler(cbxDuong_Click);
            this.cbxXa.Click += new EventHandler(cbxXa_Click);
            this.cbxDoanDuong.Click += new EventHandler(cbxDoanDuong_Click);
        }
Пример #4
0
 public void Setup()
 {
     this.mr = new MockRepository();
     this.sc = new ServiceContainer();
     loader = mr.Stub<ILoader>();
     arch = mr.StrictMock<IProcessorArchitecture>();
     Address dummy;
     arch.Stub(a => a.TryParseAddress(null, out dummy)).IgnoreArguments().WhenCalled(m =>
     {
         Address addr;
         var sAddr = (string)m.Arguments[0];
         var iColon = sAddr.IndexOf(':');
         if (iColon > 0)
         {
             addr = Address.SegPtr(
                 Convert.ToUInt16(sAddr.Remove(iColon)),
                 Convert.ToUInt16(sAddr.Substring(iColon+1)));
             m.ReturnValue = true;
         }
         else
         {
             m.ReturnValue = Address32.TryParse32((string)m.Arguments[0], out addr);
         }
         m.Arguments[1] = addr;
     }).Return(false);
 }
Пример #5
0
		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var mem = new MemoryArea(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = new SegmentMap(
                mem.BaseAddress,
                new ImageSegment("code", mem, AccessMode.ReadWriteExecute));
            var arch = mr.StrictMock<IProcessorArchitecture>();
            var platform = mr.StrictMock<IPlatform>();
            program = new Program(imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);
            sc.AddService<DecompilerHost>(host);

            i = new TestInitialPageInteractor(sc, dec);

		}
		public void Setup()
		{
            mr = new MockRepository();
            form = new MainForm();
            sc = new ServiceContainer();
            loader = mr.StrictMock<ILoader>();
            dec = mr.StrictMock<IDecompiler>();
            sc = new ServiceContainer();
            uiSvc = new FakeShellUiService();
            host = mr.StrictMock<DecompilerHost>();
            memSvc = mr.StrictMock<ILowLevelViewService>();
            var image = new LoadedImage(Address.Ptr32(0x10000), new byte[1000]);
            var imageMap = image.CreateImageMap();
            var arch = mr.StrictMock<IProcessorArchitecture>();
            arch.Stub(a => a.CreateRegisterBitset()).Return(new BitSet(32));
            arch.Replay();
            var platform = mr.StrictMock<Platform>(null, arch);
            arch.BackToRecord();
            program = new Program(image, imageMap, arch, platform);
            project = new Project { Programs = { program } };

            browserSvc = mr.StrictMock<IProjectBrowserService>();

            sc.AddService<IDecompilerUIService>(uiSvc);
            sc.AddService(typeof(IDecompilerShellUiService), uiSvc);
            sc.AddService(typeof(IDecompilerService), new DecompilerService());
            sc.AddService(typeof(IWorkerDialogService), new FakeWorkerDialogService());
            sc.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
            sc.AddService(typeof(IProjectBrowserService), browserSvc);
            sc.AddService(typeof(ILowLevelViewService), memSvc);
            sc.AddService<ILoader>(loader);

            i = new TestInitialPageInteractor(sc, dec);

		}
Пример #7
0
 public MazeFactory(string[] arguments, string loaderOption, string solverOption, string displayerOption)
 {
     this.arguments = arguments;
     loader = GetLoader(loaderOption);
     solver = GetSolver(solverOption);
     displayer = GetDisplayer(displayerOption);
 }
 public IssueDetailsPageViewModel(IDeviceService deviceService,
     ILoader loader,
     IProgressService progressService,
     INavigationService navigationService)
     : base(loader, progressService, navigationService)
 {
     _deviceService = deviceService;
 }
Пример #9
0
        public AfterglowRuntime(IDatabase database, ILogger logger, ILoader loader)
        {
            this._database = database;
            this._logger = logger;
            this.Loader = loader;

            Settings = new Settings(database.AddTable("Settings"), logger, this);
        }
Пример #10
0
 protected BaseViewModel(ILoader loader, IProgressService progressService,
     INavigationService navigationService)
 {
     Loader = loader;
     Loader.LoadingChanged += (sender, args) => IsLoadingChanged(Loader.IsLoading);
     _progressService = progressService;
     NavigationService = navigationService;
 }
Пример #11
0
 public IModel Load(CADType c, ILoader loader)
 {
     if (_parsers.ContainsKey(c))
     {
         return _parsers[c].Parse(loader.Load());
     }
     throw new Exception("Can't parse given type.");
 }
Пример #12
0
			public void SetUp()
			{
				log = Substitute.For<ILog>();
				loader = Substitute.For<ILoader>();
				compiler = Substitute.For<ICompiler>();
				
				compileCommand = new CompileCommand(log, loader, compiler);
			}
Пример #13
0
 public WebSearchProvider(
     ILoader<HtmlDocument> loader,
     ISpliter<HtmlDocument, HtmlNode> spliter,
     IBuilder<HtmlNode> builder)
 {
     _loader  = loader;
     _spliter = spliter;
     _builder = builder;
 }
        public IssueListPageViewModel(ILoader loader, ILoader listLoader, IProgressService progressService,
            INavigationService navigationService,
            IIssueService issueService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _issueService = issueService;

            Title = IssueList.Title;
        }
Пример #15
0
 public AboutPageViewModel(IDeviceService deviceService,
     ILoader loader,
     IProgressService progressService,
     INavigationService navigationService)
     : base(loader, progressService, navigationService)
 {
     _deviceService = deviceService;
     Version = "1.0";
 }
Пример #16
0
        public void Load(string name, ILoader loader, FrameworkLogger logger)
        {
            // The data in downloads.v1.json will be an array of Package records - which has Id, Array of Versions and download count.
            // Sample.json : [["AutofacContrib.NSubstitute",["2.4.3.700",406],["2.5.0",137]],["Assman.Core",["2.0.7",138]]....
            using (var jsonReader = loader.GetReader(name))
            {
                try
                {
                    jsonReader.Read();

                    while (jsonReader.Read())
                    {
                        try
                        {
                            if (jsonReader.TokenType == JsonToken.StartArray)
                            {
                                JToken record = JToken.ReadFrom(jsonReader);
                                string id = String.Intern(record[0].ToString().ToLowerInvariant());

                                // The second entry in each record should be an array of versions, if not move on to next entry.
                                // This is a check to safe guard against invalid entries.
                                if (record.Count() == 2 && record[1].Type != JTokenType.Array)
                                {
                                    continue;
                                }

                                if (!_downloads.ContainsKey(id))
                                {
                                    _downloads.Add(id, new DownloadsByVersion());
                                }
                                var versions = _downloads[id];

                                foreach (JToken token in record)
                                {
                                    if (token != null && token.Count() == 2)
                                    {
                                        string version = String.Intern(token[0].ToString().ToLowerInvariant());
                                        versions[version] = token[1].ToObject<int>();
                                    }
                                }
                            }
                        }
                        catch (JsonReaderException ex)
                        {
                            logger.LogInformation("Invalid entry found in downloads.v1.json. Exception Message : {0}", ex.Message);
                        }
                    }
                }
                catch (JsonReaderException ex)
                {
                    logger.LogError("Data present in downloads.v1.json is invalid. Couldn't get download data.", ex);
                }
            }
        }
Пример #17
0
 public LoginPageViewModel(ILoader loader,
     IProgressService progressService,
     INavigationService navigationService,
     ILoginService loginService,
     IEventAggregator eventAggregator)
     : base(loader, progressService, navigationService)
 {
     Loader.LoadingChanged += (sender, args) => LoginCommand.RaiseCanExecuteChanged();
     _loginService = loginService;
     _eventAggregator = eventAggregator;
 }
        public LogWorkPageViewModel(ILoader loader,
            IProgressService progressService,
            INavigationService navigationService,
            IWorkLogService workLogService)
            : base(loader, progressService, navigationService)
        {
            _workLogService = workLogService;

            Title = LogWork.Title;
            Date = DateTime.Now;
        }
        public RepoListPageViewModel(ILoader loader,
            ILoader listLoader,
            IProgressService progressService,
            INavigationService navigationService,
            IRepoService repoService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _repoService = repoService;

            Title = RepoList.Title;
        }
Пример #20
0
 public DecompilerDriver(ILoader ldr, IServiceProvider services)
 {
     if (ldr == null)
         throw new ArgumentNullException("ldr");
     if (services == null)
         throw new ArgumentNullException("services");
     this.loader = ldr;
     this.host = services.RequireService<DecompilerHost>();
     this.services = services;
     this.eventListener = services.GetService<DecompilerEventListener>();
 }
        public WorkLogsPageViewModel(ILoader loader,
            ILoader listLoader,
            IProgressService progressService,
            INavigationService navigationService,
            IWorkLogService workLogService)
            : base(loader, listLoader, progressService, navigationService)
        {
            _workLogService = workLogService;

            Title = Resources.Strings.WorkLogs.Title;
        }
Пример #22
0
 public void Setup()
 {
     mr = new MockRepository();
     var config = new FakeDecompilerConfiguration();
     var host = new FakeDecompilerHost();
     var sp = new ServiceContainer();
     loader = mr.StrictMock<ILoader>();
     sp.AddService(typeof(DecompilerEventListener), new FakeDecompilerEventListener());
     loader.Replay();
     decompiler = new TestDecompiler(loader, host, sp);
     loader.BackToRecord();
 }
Пример #23
0
 public static string GetCompanyRoster(ILoader<IEnumerable<Company>> companyByName)
 {
     IEnumerable<Company> companies = companyByName.Load();
     var b = new StringBuilder();
     b.Append("<html><body>");
     foreach (Company company in companies)
     {
         b.Append("<li>{0}</li>".FormatWith(company.Name));
     }
     b.Append("</body></html>");
     return b.ToString();
 }
        private Task LoadReposAsync(ILoader loader)
        {
            Repos = null;

            return loader.LoadAsync(async cancellationToken =>
            {
                var repos =
                    await _repoService.GetReposAsync(cancellationToken);

                Repos = repos;
            });
        }
        private Task LoadWorkLogsAsync(ILoader loader)
        {
            WorkLogs = null;

            return loader.LoadAsync(async cancellationToken =>
            {
                var logs =
                    await _workLogService.GetLogsAsync(_repo.Path, _issue.Number, cancellationToken);

                WorkLogs = logs;
            });
        }
        private Task LoadIssuesAsync(ILoader loader)
        {
            _issues = null;
            TriggerIssuesPropertyChanged();

            return loader.LoadAsync(async cancellationToken =>
            {
                var issues =
                    await _issueService.GetIssuesAsync(_repo.Path, cancellationToken);

                _issues = issues.Select(issue => new IssueViewModel(issue)).ToList();
                TriggerIssuesPropertyChanged();
            });
        }
Пример #27
0
        public FastStartAgent(AgentConfiguration config,
            ILoader<INotificationEventPublisher> publisherLoader,
            ILoader<IHealthCheckSchedulerPlugin> checksLoader,
            ILoader<IActivityPlugin> activitiesLoader)
            : base(config, publisherLoader, checksLoader, activitiesLoader)
        {
            InternalIdentity = new PluginDescriptor
                             {
                                 Description = "Fast Startup Agent",
                                 Name = "FastStartAgent",
                                 TypeId = new Guid("F90773BA-C659-4964-B22D-A998719CB1FD")
                             };

            _startingGate = new ManualResetEvent(false);
        }
Пример #28
0
        public override async Task<bool> PrepareAsync(WebClient client, CancellationToken cancellation) {
            var downloadPage = await client.DownloadStringTaskAsync(Url);
            if (cancellation.IsCancellationRequested) return false;

            var match = Regex.Match(downloadPage, @"<p class=""download""><a href=""([^""]+)");
            if (!match.Success) {
                NonfatalError.Notify(ToolsStrings.Common_CannotDownloadFile, ToolsStrings.DirectLoader_AcClubChanged);
                return false;
            }

            Url = HttpUtility.HtmlDecode(match.Groups[1].Value);
            Logging.Write("AssettoCorsa.club download link: " + Url);

            _innerLoader = FlexibleLoader.CreateLoader(Url);
            if (_innerLoader is AcClubLoader) throw new Exception(ToolsStrings.DirectLoader_RecursionDetected);
            return await _innerLoader.PrepareAsync(client, cancellation);
        }
Пример #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Catalog"/> class using given culture info
 /// and loads data using given loader.
 /// </summary>
 /// <param name="loader">Loader instance.</param>
 /// <param name="cultureInfo">Culture info.</param>
 public Catalog(ILoader loader, CultureInfo cultureInfo)
     : this(cultureInfo)
 {
     try
     {
         this.Load(loader);
     }
     #if NETSTANDARD1_0
     catch (FileNotFoundException) { }
     #else
     catch (FileNotFoundException exception)
     {
         // Suppress FileNotFound exceptions
         Trace.WriteLine(String.Format("Translation file loading fail: {0}", exception.Message), "NGettext");
     }
     #endif
 }
Пример #30
0
        public Agent(AgentConfiguration config,
            ILoader<INotificationEventPublisher> publisherLoader,
            ILoader<IHealthCheckSchedulerPlugin> checksLoader,
            ILoader<IActivityPlugin> activitiesLoader)
        {
            _config = config;
            PublisherLoader = publisherLoader;
            ChecksLoader = checksLoader;
            ActivitiesLoader = activitiesLoader;

            InternalIdentity = new PluginDescriptor
                             {
                                 Description = "Agent description [TODO]",
                                 Name = "Agent",
                                 TypeId = new Guid("649D0AAC-3AA0-4457-B82D-F834EA324CFA")
                             };
        }
 public SomeClassThatDependsOnLoader(ILoader loader)     // Constructor Injection
 {
     this.loader = loader ?? throw new ArgumentNullException(nameof(loader));
 }
Пример #32
0
 public LogicQuery(ILoader <T, U, V> loader)
     : base(loader)
 {
 }
Пример #33
0
 public virtual IDecompiler CreateDecompiler(ILoader ldr)
 {
     return(new Decompiler(ldr, sc));
 }
 public static void AddLoader(ILoader loader)
 {
     _loaders.Add(loader);
 }
Пример #35
0
        public bool OpenBinaryAs()
        {
            IOpenAsDialog          dlg  = null;
            IProcessorArchitecture arch = null;

            try
            {
                dlg          = dlgFactory.CreateOpenAsDialog();
                dlg.Services = sc;
                if (uiSvc.ShowModalDialog(dlg) != DialogResult.OK)
                {
                    return(true);
                }

                var               rawFileOption = (ListOption)dlg.RawFileTypes.SelectedValue;
                string            archName      = null;
                string            envName       = null;
                string            sAddr         = null;
                string            loader        = null;
                EntryPointElement entry         = null;

                if (rawFileOption != null && rawFileOption.Value != null)
                {
                    RawFileElement raw = null;
                    raw      = (RawFileElement)rawFileOption.Value;
                    loader   = raw.Loader;
                    archName = raw.Architecture;
                    envName  = raw.Environment;
                    sAddr    = raw.BaseAddress;
                    entry    = raw.EntryPoint;
                }
                archName = archName ?? (string)((ListOption)dlg.Architectures.SelectedValue).Value;
                var envOption = (OperatingEnvironment)((ListOption)dlg.Platforms.SelectedValue).Value;
                envName = envName ?? (envOption?.Name);
                sAddr   = sAddr ?? dlg.AddressTextBox.Text.Trim();

                arch = config.GetArchitecture(archName);
                if (arch == null)
                {
                    throw new InvalidOperationException(string.Format("Unable to load {0} architecture.", archName));
                }
                if (!arch.TryParseAddress(sAddr, out var addrBase))
                {
                    throw new ApplicationException(string.Format("'{0}' doesn't appear to be a valid address.", sAddr));
                }

                var details = new LoadDetails
                {
                    LoaderName       = loader,
                    ArchitectureName = archName,
                    PlatformName     = envName,
                    LoadAddress      = sAddr,
                    EntryPoint       = entry,
                };

                OpenBinary(dlg.FileName.Text, (f) =>
                           pageInitial.OpenBinaryAs(
                               f,
                               details));
            }
            catch (Exception ex)
            {
                uiSvc.ShowError(
                    ex,
                    string.Format("An error occurred when opening the binary file {0}.", dlg.FileName.Text));
            }
            return(true);
        }
Пример #36
0
 public ProjectLoader(IServiceProvider services, ILoader loader, Project project)
     : base(services)
 {
     this.loader  = loader;
     this.project = project;
 }
Пример #37
0
 public OBJECT(ILoader dxfData, Property prop)
     : base(dxfData, prop)
 {
 }
Пример #38
0
 protected override IDecompiler CreateDecompiler(ILoader ldr)
 {
     return(decompiler);
 }
Пример #39
0
 public static ILoader SBC_IMMEDIATE(this ILoader loader, string refLabel, string label = null)
 {
     loader.Write(OPCODE.SBC_IMMEDIATE, label);
     loader.RefByte(refLabel);
     return(loader);
 }
Пример #40
0
 public static ILoader JSR(this ILoader loader, string refLabel, string label = null)
 {
     loader.Write(OPCODE.JSR, label);
     loader.Ref(refLabel);
     return(loader);
 }
Пример #41
0
 public static ILoader BVS(this ILoader loader, string refLabel, string label = null)
 {
     loader.Write(OPCODE.BVS, label);
     loader.RelativeRef(refLabel);
     return(loader);
 }
Пример #42
0
        public bool OpenBinaryAs(string initialFilename)
        {
            IOpenAsDialog          dlg  = null;
            IProcessorArchitecture arch = null;

            try
            {
                dlg = dlgFactory.CreateOpenAsDialog();
                dlg.FileName.Text       = initialFilename;
                dlg.Services            = sc;
                dlg.ArchitectureOptions = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);
                if (uiSvc.ShowModalDialog(dlg) != DialogResult.OK)
                {
                    return(false);
                }

                var    rawFileOption       = (ListOption)dlg.RawFileTypes.SelectedValue;
                string archName            = null;
                string envName             = null;
                string sAddr               = null;
                string loader              = null;
                EntryPointDefinition entry = null;
                if (rawFileOption != null && rawFileOption.Value != null)
                {
                    var raw = (RawFileDefinition)rawFileOption.Value;
                    loader   = raw.Loader;
                    archName = raw.Architecture;
                    envName  = raw.Environment;
                    sAddr    = raw.BaseAddress;
                    entry    = raw.EntryPoint;
                }
                ArchitectureDefinition archOption = dlg.GetSelectedArchitecture();
                PlatformDefinition     envOption  = dlg.GetSelectedEnvironment();
                archName = archName ?? archOption?.Name;
                envName  = envName ?? envOption?.Name;
                sAddr    = sAddr ?? dlg.AddressTextBox.Text.Trim();
                arch     = config.GetArchitecture(archName);
                if (arch == null)
                {
                    throw new InvalidOperationException(string.Format("Unable to load {0} architecture.", archName));
                }
                arch.LoadUserOptions(dlg.ArchitectureOptions);
                if (!arch.TryParseAddress(sAddr, out var addrBase))
                {
                    throw new ApplicationException(string.Format("'{0}' doesn't appear to be a valid address.", sAddr));
                }
                var details = new LoadDetails
                {
                    LoaderName          = loader,
                    ArchitectureName    = archName,
                    ArchitectureOptions = dlg.ArchitectureOptions,
                    PlatformName        = envName,
                    LoadAddress         = sAddr,
                    EntryPoint          = entry,
                };

                OpenBinary(dlg.FileName.Text, (f) => pageInitial.OpenBinaryAs(f, details), f => false);
            }
            catch (Exception ex)
            {
                uiSvc.ShowError(
                    ex,
                    string.Format("An error occurred when opening the binary file {0}.", dlg.FileName.Text));
            }
            return(true);
        }
Пример #43
0
 public ProjectLoader(IServiceProvider services, ILoader loader, DecompilerEventListener listener)
     : this(services, loader, new Project(), listener)
 {
 }
Пример #44
0
 public TestDecompiler(ILoader loader, IServiceProvider sp)
     : base(loader, sp)
 {
 }
Пример #45
0
 /// <summary>
 /// 任何一个加载完成后,移除这个加载器的事件监听
 /// </summary>
 /// <param name="obj"></param>
 private void OnOneEndHandler(ILoader obj)
 {
     obj.onLoadComplete.RemoveEventListener(OnOneLoadCompleteHandler);
     obj.onLoadError.RemoveEventListener(OnOneLoadErrorHandler);
 }
 public ContentTypeLoaderDecorator(ILoader loader, ContentType contentType) : base(loader)
 {
     _contentType = contentType;
 }
Пример #47
0
 public ProjectLoader(IServiceProvider services, ILoader loader)
     : this(services, loader, new Project())
 {
 }
Пример #48
0
 /// <summary>
 /// Initializes the <paramref name="loader"/> instance
 /// with the given <paramref name="assemblyLoader"/> instance.
 /// </summary>
 /// <param name="loader">The loader being configured.</param>
 /// <param name="assemblyLoader">The assembly loader that will load the types into the loader itself.</param>
 protected abstract void Initialize(ILoader <TTarget> loader,
                                    IAssemblyTargetLoader <TTarget, TAssembly, TType> assemblyLoader);
Пример #49
0
 public APPID(ILoader dxfData, Property prop)
     : base(dxfData, prop)
 {
 }
Пример #50
0
 public JsEnv(ILoader loader, int debugPort = -1)
     : this(loader, debugPort, IntPtr.Zero, IntPtr.Zero)
 {
 }
Пример #51
0
 public static ILoader STA_INDIRECT_Y(this ILoader loader, string refLabel, string label = null)
 {
     loader.Write(OPCODE.STA_INDIRECT_Y, label);
     loader.ZeroPageRef(refLabel);
     return(loader);
 }
 public WebElementProxy(ILoader <IWebElement> loader) : base(loader)
 {
 }
Пример #53
0
 protected virtual IDecompiler CreateDecompiler(ILoader ldr)
 {
     return(new Decompiler(ldr, Services));
 }
Пример #54
0
 public static ILoader STY_ZERO_PAGE_X(this ILoader loader, string refLabel, string label = null)
 {
     loader.Write(OPCODE.STY_ZERO_PAGE_X, label);
     loader.ZeroPageRef(refLabel);
     return(loader);
 }
 public TimeoutLoaderDecorator(ILoader loader, TimeSpan timeout) : base(loader)
 {
     _timeout = timeout;
 }
Пример #56
0
 public static ILoader AND_ABSOLUTE_Y(this ILoader loader, string refLabel, string label = null)
 {
     loader.Write(OPCODE.AND_ABSOLUTE_Y, label);
     loader.Ref(refLabel);
     return(loader);
 }
Пример #57
0
 internal OnlinerScraper(ILoader loader)
 {
     _loader = loader;
 }
Пример #58
0
 public XmlConfiger(string xmlPath, string xmlRootNodeName, ILoader loader)
 {
     ConfigDict = new Dictionary <string, string>();
     Loader     = loader;
     AnalysisXml(xmlPath, xmlRootNodeName);
 }
Пример #59
0
        private void CreateServices(IServiceFactory svcFactory, IServiceContainer sc)
        {
            config = svcFactory.CreateDecompilerConfiguration();
            sc.AddService(typeof(IConfigurationService), config);

            var cmdFactory = new Commands.CommandFactory(sc);

            sc.AddService <ICommandFactory>(cmdFactory);

            var sbSvc = svcFactory.CreateStatusBarService();

            sc.AddService <IStatusBarService>(sbSvc);

            diagnosticsSvc = svcFactory.CreateDiagnosticsService();
            sc.AddService(typeof(IDiagnosticsService), diagnosticsSvc);

            decompilerSvc = svcFactory.CreateDecompilerService();
            sc.AddService(typeof(IDecompilerService), decompilerSvc);

            sc.AddService(typeof(IDecompilerUIService), uiSvc);

            var codeViewSvc = svcFactory.CreateCodeViewerService();

            sc.AddService <ICodeViewerService>(codeViewSvc);

            var segmentViewSvc = svcFactory.CreateImageSegmentService();

            sc.AddService(typeof(ImageSegmentService), segmentViewSvc);

            var del = svcFactory.CreateDecompilerEventListener();

            workerDlgSvc = (IWorkerDialogService)del;
            sc.AddService(typeof(IWorkerDialogService), workerDlgSvc);
            sc.AddService <DecompilerEventListener>(del);

            sc.AddService <IDecompiledFileService>(svcFactory.CreateDecompiledFileService());

            loader = svcFactory.CreateLoader();
            sc.AddService <ILoader>(loader);

            var abSvc = svcFactory.CreateArchiveBrowserService();

            sc.AddService <IArchiveBrowserService>(abSvc);

            sc.AddService <ILowLevelViewService>(svcFactory.CreateMemoryViewService());
            sc.AddService <IDisassemblyViewService>(svcFactory.CreateDisassemblyViewService());

            var tlSvc = svcFactory.CreateTypeLibraryLoaderService();

            sc.AddService <ITypeLibraryLoaderService>(tlSvc);

            this.projectBrowserSvc = svcFactory.CreateProjectBrowserService();
            sc.AddService <IProjectBrowserService>(projectBrowserSvc);

            this.procedureListSvc = svcFactory.CreateProcedureListService();
            sc.AddService <IProcedureListService>(procedureListSvc);

            var upSvc = svcFactory.CreateUiPreferencesService();

            sc.AddService <IUiPreferencesService>(upSvc);

            srSvc = svcFactory.CreateSearchResultService();
            sc.AddService <ISearchResultService>(srSvc);

            var callHierSvc = svcFactory.CreateCallHierarchyService();

            sc.AddService <ICallHierarchyService>(callHierSvc);

            this.searchResultsTabControl = svcFactory.CreateTabControlHost();
            sc.AddService <ITabControlHostService>(this.searchResultsTabControl);

            var resEditService = svcFactory.CreateResourceEditorService();

            sc.AddService <IResourceEditorService>(resEditService);

            var cgvSvc = svcFactory.CreateCallGraphViewService();

            sc.AddService <ICallGraphViewService>(cgvSvc);

            var viewImpSvc = svcFactory.CreateViewImportService();

            sc.AddService <IViewImportsService>(viewImpSvc);

            var symLdrSvc = svcFactory.CreateSymbolLoadingService();

            sc.AddService <ISymbolLoadingService>(symLdrSvc);

            var selSvc = svcFactory.CreateSelectionService();

            sc.AddService <ISelectionService>(selSvc);

            var testGenSvc = svcFactory.CreateTestGenerationService();

            sc.AddService <ITestGenerationService>(testGenSvc);
        }
Пример #60
0
 /// <summary>
 /// Searches the loader for an <see cref="IAssemblyTargetLoader{T}"/>
 /// instance and uses its derived classes to initialize
 /// the assembly target loader.
 /// </summary>
 /// <param name="source">The <see cref="ILoader{TTarget}"/> instance that will hold the plugin.</param>
 public void Initialize(ILoader <TTarget> source)
 {
     Initialize(source, _assemblyLoader);
 }