本文整理汇总了C#中System.ComponentModel.Design.ServiceContainer类的典型用法代码示例。如果您正苦于以下问题:C# ServiceContainer类的具体用法?C# ServiceContainer怎么用?C# ServiceContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceContainer类属于System.ComponentModel.Design命名空间,在下文中一共展示了ServiceContainer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HostForm
public HostForm()
{
InitializeComponent();
mServiceContainer = new ServiceContainer();
mServiceContainer.AddService(typeof(ISampleHostService), this);
}
开发者ID:ssickles,项目名称:archive,代码行数:7,代码来源:HostForm.cs
示例2: JsonRpcDispatcher
public JsonRpcDispatcher(IService service, IServiceProvider serviceProvider)
{
if (service == null)
throw new ArgumentNullException("service");
_service = service;
if (serviceProvider == null)
{
//
// No service provider supplied so check if the RPC service
// itself is our service provider.
//
serviceProvider = service as IServiceProvider;
//
// If no service provider found so far, then create a default
// one.
//
if (serviceProvider == null)
serviceProvider = new ServiceContainer();
}
_serviceProvider = serviceProvider;
}
开发者ID:BackupTheBerlios,项目名称:tamjb,代码行数:27,代码来源:JsonRpcDispatcher.cs
示例3: Setup
public void Setup()
{
mr = new MockRepository();
sc = new ServiceContainer();
cfgSvc = mr.Stub<IConfigurationService>();
sc.AddService<IConfigurationService>(cfgSvc);
}
开发者ID:melbcat,项目名称:reko,代码行数:7,代码来源:MachOLoaderTests.cs
示例4: Setup
public void Setup()
{
mr = new MockRepository();
dcSvc = mr.Stub<IConfigurationService>();
sc = new ServiceContainer();
sc.AddService(typeof(IConfigurationService), dcSvc);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:OpenAsInteractorTests.cs
示例5: Setup
public void Setup()
{
mr = new MockRepository();
frame = mr.DynamicMock<IWindowFrame>();
sc = new ServiceContainer();
sc.AddService(typeof(IWindowFrame), frame);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:SearchResultServiceTests.cs
示例6: Setup
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);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:26,代码来源:ProjectSerializerTests.cs
示例7: Setup
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);
}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:35,代码来源:InitialPageInteractorTests.cs
示例8: Setup
public void Setup()
{
mr = new MockRepository();
var eventListener = mr.Stub<DecompilerEventListener>();
sc = new ServiceContainer();
sc.AddService<DecompilerEventListener>(eventListener);
}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:VectorBuilderTests.cs
示例9: Setup
public void Setup()
{
this.sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
this.arch = new X86ArchitectureReal();
this.platform = new MsdosPlatform(sc, arch);
ArgumentSerializer argSer = new ArgumentSerializer(arch);
svc = new SerializedService
{
Name = "msdos_ioctl_get_device_info",
SyscallInfo = new SerializedSyscallInfo
{
Vector = "21",
RegisterValues = new[] {
new SerializedRegValue("ah", "44"),
new SerializedRegValue("al", "00"),
}
},
Signature = new SerializedSignature
{
ReturnValue = argSer.Serialize(
new Identifier("C", PrimitiveType.Bool,
new FlagGroupStorage(Registers.eflags, (uint)FlagM.CF, "C", PrimitiveType.Byte)))
}
};
}
开发者ID:relaxar,项目名称:reko,代码行数:28,代码来源:SerializedServiceTests.cs
示例10: FindByType
public void FindByType()
{
ServiceContainer container = new ServiceContainer();
object service = new object();
container.AddService(typeof(object), service);
Assert.AreSame(service, ServiceQuery.FindByType(container, typeof(object)));
}
开发者ID:BackupTheBerlios,项目名称:jayrock-svn,代码行数:7,代码来源:TestServiceQuery.cs
示例11: Setup
public void Setup()
{
mr = new MockRepository();
mockFactory = new MockFactory(mr);
var platform = mockFactory.CreatePlatform();
var imageMap = new SegmentMap(Address32.Ptr32(0x05));
program = new Program(imageMap, platform.Architecture, platform);
interactor = new CombinedCodeViewInteractor();
var uiPreferencesSvc = mr.Stub<IUiPreferencesService>();
var uiSvc = mr.Stub<IDecompilerShellUiService>();
var styles = new Dictionary<string, UiStyle>()
{
{
UiStyles.CodeWindow,
new UiStyle
{
Background = new SolidBrush(Color.White),
}
}
};
uiPreferencesSvc.Stub(u => u.Styles).Return(styles);
var sc = new ServiceContainer();
sc.AddService<IUiPreferencesService>(uiPreferencesSvc);
sc.AddService<IDecompilerShellUiService>(uiSvc);
interactor.SetSite(sc);
}
开发者ID:relaxar,项目名称:reko,代码行数:27,代码来源:CombinedCodeViewInteractorTests.cs
示例12: Setup
public void Setup()
{
arch = new X86ArchitectureFlat32();
var services = new ServiceContainer();
services.AddService<IFileSystemService>(new FileSystemServiceImpl());
asm = new X86Assembler(services, new DefaultPlatform(services, arch), loadAddress, new List<ImageSymbol>());
}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:RewriteFpuInstructionTests.cs
示例13: Sgrom_LoadImage
public void Sgrom_LoadImage()
{
var sc = new ServiceContainer();
var cfgSvc = mr.Stub<IConfigurationService>();
var openv = mr.Stub<OperatingEnvironment>();
var diagSvc = mr.StrictMock<IDiagnosticsService>();
var arch = new M68kArchitecture();
var platform = new SegaGenesisPlatform(sc, arch);
cfgSvc.Expect(c => c.GetArchitecture("m68k")).Return(arch);
cfgSvc.Expect(c => c.GetEnvironment("sega-genesis")).Return(openv);
openv.Expect(o => o.Load(sc, arch)).Return(platform);
sc.AddService<IConfigurationService>(cfgSvc);
sc.AddService<IDiagnosticsService>(diagSvc);
Given_AbsoluteMemoryMap(platform);
mr.ReplayAll();
var rawBytes = new byte[0x300];
var sgrom = new RomLoader(sc, "foo.bin", rawBytes);
var program = sgrom.Load(Address.Ptr32(0));
var romSegment = program.SegmentMap.Segments.Values.First();
Assert.IsNotNull(romSegment.MemoryArea, "ROM image should have been loaded into first segment");
Assert.AreSame(rawBytes, romSegment.MemoryArea.Bytes, "ROM image should have been loaded into first segment");
Assert.AreEqual(rawBytes.Length, romSegment.ContentSize);
var ramSegment = program.SegmentMap.Segments.Values.First(s => s.Name == ".data");
Assert.IsNotNull(ramSegment.MemoryArea, "RAM segment should have a MemoryArea");
}
开发者ID:relaxar,项目名称:reko,代码行数:27,代码来源:RomLoaderTests.cs
示例14: BuildTest16
private void BuildTest16(Action<X86Assembler> asmProg)
{
sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
arch = new X86ArchitectureReal();
BuildTest(Address.SegPtr(0x0C00, 0x0000), new MsdosPlatform(sc, arch), asmProg);
}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:Scanner.X86Tests.cs
示例15: CreateDocumentWithMockService
public static IDocument CreateDocumentWithMockService()
{
ServiceContainer container = new ServiceContainer();
container.AddService(typeof(ITextMarkerService), new MockTextMarkerService());
return new AvalonEditDocumentAdapter(new ICSharpCode.AvalonEdit.Document.TextDocument(), container);
}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:MockTextMarkerService.cs
示例16: Setup
public void Setup()
{
var sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
var arch = new IntelArchitecture(ProcessorMode.Real);
this.platform = new MsdosPlatform(sc, arch);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:SerializedSequenceTests.cs
示例17: RewriteFile
protected Program RewriteFile(string relativePath, Address addrBase)
{
var sc = new ServiceContainer();
var config = new FakeDecompilerConfiguration();
sc.AddService<IConfigurationService>(config);
sc.AddService<DecompilerHost>(new FakeDecompilerHost());
sc.AddService<DecompilerEventListener>(new FakeDecompilerEventListener());
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
ILoader ldr = new Loader(sc);
var program = ldr.AssembleExecutable(
FileUnitTester.MapTestPath(relativePath),
new X86TextAssembler(sc, new IntelArchitecture(ProcessorMode.Real)),
addrBase);
program.Platform = new DefaultPlatform(sc, program.Architecture);
var ep = new EntryPoint(program.Image.BaseAddress, program.Architecture.CreateProcessorState());
var project = new Project { Programs = { program } };
var scan = new Scanner(
program,
new Dictionary<Address, ProcedureSignature>(),
new ImportResolver(project),
sc);
scan.EnqueueEntryPoint(ep);
scan.ScanImage();
var dfa = new DataFlowAnalysis(program, new FakeDecompilerEventListener());
dfa.AnalyzeProgram();
return program;
}
开发者ID:gitter-badger,项目名称:reko,代码行数:28,代码来源:TypingTestBase.cs
示例18: FormsDesignerContent
public FormsDesignerContent(FormsDesignerExtension parent, OpenedFile sourceFile)
: base(parent)
{
_language = (NetLanguageDescriptor)LanguageDescriptor.GetLanguageByPath(sourceFile.FilePath);
if (!(_language is NetLanguageDescriptor))
throw new ArgumentException("File must be a .NET source file.");
_extensionHost = parent.ExtensionHost;
_extensionHost.ControlManager.AppearanceChanged += ControlManager_AppearanceChanged;
_propertyContainer = new PropertyContainer();
_serviceContainer = new ServiceContainer();
_surfaceManager = parent.DesignerSurfaceManager;
_codeReader = new DesignerCodeReader(_extensionHost, _language);
_codeWriter = new DesignerCodeWriter(_language);
this.Text = sourceFile.FilePath.FileName + sourceFile.FilePath.Extension + " [Design]";
this.AssociatedFile = sourceFile;
this.AssociatedFile.FilePathChanged += AssociatedFile_FilePathChanged;
_errorControl = new ErrorControl()
{
Dock = DockStyle.Fill,
};
_errorControl.ReloadRequested += _errorControl_ReloadRequested;
SetupDesigner();
}
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:30,代码来源:FormsDesignerContent.cs
示例19: Setup
public void Setup()
{
this.sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
arch = new IntelArchitecture(ProcessorMode.Real);
asm = new X86TextAssembler(sc, arch);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:AssemblerBasic.cs
示例20: Setup
public void Setup()
{
var sc = new ServiceContainer();
sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
var arch = new X86ArchitectureReal();
this.platform = new MsdosPlatform(sc, arch);
}
开发者ID:relaxar,项目名称:reko,代码行数:7,代码来源:SerializedSequenceTests.cs
注:本文中的System.ComponentModel.Design.ServiceContainer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论