当前位置: 首页>>代码示例>>C#>>正文


C# Loader类代码示例

本文整理汇总了C#中Loader的典型用法代码示例。如果您正苦于以下问题:C# Loader类的具体用法?C# Loader怎么用?C# Loader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Loader类属于命名空间,在下文中一共展示了Loader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 static void Main()
 {
     Application.EnableVisualStyles();
       Application.SetCompatibleTextRenderingDefault(false);
       loader = new Loader();
       Application.Run(loader);
 }
开发者ID:svmnotn,项目名称:cuddly-octo-adventure,代码行数:7,代码来源:Program.cs

示例2: CreateWorld

 IWorld CreateWorld(params string[] args)
 {
     var loader = new Loader();
     loader.AddLevel("Demo", "Level1", () => new DemoCompetitions.Level1());
     loader.AddLevel("RoboMovies", "Level1", () => new RMCompetitions.Level1());
     return loader.Load(args);
 }
开发者ID:kentmkmb,项目名称:StrategyTester,代码行数:7,代码来源:WorldCreator.cs

示例3: Main

		public static void Main(string [] args)
		{
            var services = new ServiceContainer();
            if (args.Length == 0)
			{
                services.AddService(typeof(IServiceFactory), new ServiceFactory(services));
                services.AddService(typeof(IDialogFactory), new WindowsFormsDialogFactory(services));
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(ISettingsService), new WindowsFormsSettingsService(services));
                var interactor = new MainFormInteractor(services);
                interactor.Run();
            }
			else
			{
                var host = NullDecompilerHost.Instance;
                var listener = NullDecompilerEventListener.Instance;

                services.AddService(typeof (DecompilerEventListener), listener);
                services.AddService(typeof(IRegistryService), new WindowsFormsRegistryService());
                services.AddService(typeof(IConfigurationService), new DecompilerConfiguration());
                var ldr = new Loader(services);
				var dec = new DecompilerDriver(ldr, services);
				dec.Decompile(args[0]);
			}
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:25,代码来源:Driver.cs

示例4: InitLoader

 private static void InitLoader()
 {
     if (__Loader == null)
         __Loader = (Loader)MonoBehaviour.FindObjectsOfType(typeof(Loader)).FirstOrDefault();
     if (__Loader == null)
         __Loader = ((GameObject)Instantiate(Resources.Load("loader", typeof(GameObject)))).GetComponent<Loader>();
 }   
开发者ID:ConnectDeveloper01,项目名称:dorumon,代码行数:7,代码来源:bs.cs

示例5: Load

		public void Load ()
		{
			Assembly assembly = Assembly.GetExecutingAssembly ();
			var appDomainSetup = new AppDomainSetup {
				ApplicationBase = Path.GetDirectoryName(assembly.Location)
			};
			this.testDomain = AppDomain.CreateDomain ("TestDomain", null, appDomainSetup);
			this.testDomain.AssemblyResolve += (s, e) => {
				return Assembly.LoadFrom (e.Name);
			};
			this.loader = (Loader) this.testDomain.CreateInstanceAndUnwrap (assembly.Location, typeof (Loader).FullName);

			using (var rewritten = new MemoryStream ()) {
				RewriterOptions options = new RewriterOptions {
					ForceAssemblyRename = "RewrittenForTest",
					Assembly = assembly.Location,
					OutputFile = rewritten,
					ThrowOnFailure = true,
					WritePdbFile = false,
				};
				Rewriter.Rewrite (options);
				byte [] bytes = rewritten.ToArray ();
				this.loader.Load (bytes);
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:25,代码来源:RewriteAndLoad.cs

示例6: ReaderModel

        public async Task ReaderModel()
        {
            using (var con = new SqlConnection(connectionString))
            {
                var sproc = SimulatedSelectStatement.Create();

                var cmd = sproc.Build(con);
                await con.OpenAsync();

                var reader = await cmd.ExecuteReaderAsync();

                Assert.IsTrue(reader.Read());

                var loader = new Loader<SelectData>();
                var obj = loader.Model(reader);

                Assert.IsNotNull(obj);
                Assert.AreEqual(sproc.TestInt, obj.Identifier);
                Assert.AreEqual(sproc.TestBigInt, obj.BigInt);
                Assert.AreEqual(sproc.TestBit, obj.Bit);
                Assert.AreEqual(sproc.TestDate.Value.Date, obj.Date.Date);
                Assert.AreEqual(sproc.TestDateTime.Value.Date, obj.DateTime.Date);
                Assert.AreEqual(sproc.TestDateTime2.Value.Date, obj.DateTime2.Date);
                Assert.AreEqual(sproc.TestDecimal, obj.Decimal);
                Assert.AreEqual(sproc.TestFloat, obj.Float);
                Assert.AreEqual(Math.Round((decimal)sproc.TestMoney, 4), obj.Money);
                Assert.AreEqual(sproc.TestNChar, obj.NChar.ToString());
                Assert.AreEqual(sproc.TestNText, obj.NText);
                Assert.AreEqual(sproc.TestText, obj.Text);
                CollectionAssert.AreEqual(sproc.TestBinary, obj.Binary);
                CollectionAssert.AreEqual(sproc.TestImage, obj.Image);
                Assert.AreEqual(sproc.TestGuid, obj.Unique);
            }
        }
开发者ID:modulexcite,项目名称:King.Mapper,代码行数:34,代码来源:LoaderTests.cs

示例7: SetUp

        public void SetUp()
        {
            skype = MockRepository.GenerateMock<ISkype>();
            chat = MockRepository.GenerateMock<IChat>();
            userCollection = MockRepository.GenerateMock<IUserCollection>();
            client = MockRepository.GenerateMock<IClient>();
            user = MockRepository.GenerateMock<IUser>();
            configurationLoader = new ConfigurationLoader();
            httpGet = MockRepository.GenerateMock<IHttpGet>();
            chats = MockRepository.GenerateMock<IChats>();
            messengerClient = new MessengerClient(skype, userCollection, chats);

            buildCollection = MockRepository.GenerateMock<IBuildCollection>();
            loader = new Loader(messengerClient, buildCollection);
            stopper = MockRepository.GenerateMock<IStopper>();
            controller = new Controller();
            controller.Container.Kernel.AddComponentInstance<ISkype>(skype);
            controller.Container.Kernel.AddComponentInstance<IUserCollection>(userCollection);
            controller.Container.Kernel.AddComponentInstance<IStopper>(stopper);
            controller.CcTrayUrl = "http://localhost/Cctray.xml";
            controller.CcTrayUsername = "username";
            controller.CcTrayPassword = "password";
            controller.HttpTimeout = 30;
            controller.Configuration = @"RealUsers.xml";
        }
开发者ID:perryofpeek,项目名称:CCSkype,代码行数:25,代码来源:Mocked_End_To_End_Tests.cs

示例8: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     loader = new Loader();
     scripts = new CommonPage();
     if (IsPostBack)
         LoadGames();
 }
开发者ID:Aphramzo,项目名称:AnAvalancheOfStats,代码行数:7,代码来源:LoadData.aspx.cs

示例9: EquipmentTemplate

        public EquipmentTemplate(Loader l)
        {
            ID = l.ID;

            foreach (Instruction i in l.Parse())
                Load(l, i);
        }
开发者ID:danzhu,项目名称:JoyfulColours,代码行数:7,代码来源:EquipmentTemplate.cs

示例10: 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

示例11: Game

        /// <summary>
        /// Maak een spelview aan.
        /// </summary>
        /// <param name="loader">desbetreffend spel</param>
        /// <param name="spelers"></param>
        /// <param name="main"></param>
        public Game(Loader loader, Dictionary<Speler, ISpeler> spelers, MainWindow main)
        {
            InitializeComponent();

            foreach (var speler in spelers.Keys.ToList())
            {
                if (spelers[speler] == null)
                    spelers[speler] = this;
            }

            MainWindow = main;

            _loader = loader;
            _logicSpel = loader.Spel;
            _processSpel = new Process.Spel(_logicSpel, this, spelers);

            _statischeLaag = new StatischeLaag(Spelbord, loader.Kaart);

            // Inladen moet later voor het opzoeken van veldposities
            Loaded += LaadDynamischeLaag;
            MouseMove += OnMove;

            Closing += OnClosing;

            _userControls = new UserInterface(this, _logicSpel.Spelers) {HorizontalAlignment = HorizontalAlignment.Left };
            GameHolder.Children.Add(_userControls);
        }
开发者ID:Roconda,项目名称:Barricade,代码行数:33,代码来源:Game.xaml.cs

示例12: Terrain

 public Terrain(vec2 pos,Loader loader,ModelTexture texture)
 {
     this.texture = texture;
     Position.x = pos.x * SIZE;
     Position.y = pos.y * SIZE;
     model = generateTerrain(loader);
 }
开发者ID:FelixKimmerle,项目名称:SFMLdotNetOpenGL,代码行数:7,代码来源:Terrain.cs

示例13: Execute

        public void Execute(string[] args)
        {
            var pArgs = ProcessArguments(Console.Out, args);
            if (pArgs == null)
                return;

            var ldr = new Loader(services);
            object defaultTo;
            if (pArgs.TryGetValue("--default-to", out defaultTo))
            {
                ldr.DefaultToFormat = (string)defaultTo;
            }
            var dec = new DecompilerDriver(ldr, services);

            if (OverridesRequested(pArgs))
            {
                DecompileRawImage(dec, pArgs);
            }
            else if (pArgs.ContainsKey("filename"))
            {
                dec.Decompile((string)pArgs["filename"]);
            }
            else
            {
                Usage(Console.Out);
            }
        }
开发者ID:relaxar,项目名称:reko,代码行数:27,代码来源:CmdLineDriver.cs

示例14: RewriteFile

		protected Program RewriteFile(string relativePath, Address addrBase)
		{
            sc = new ServiceContainer();
            var config = new FakeDecompilerConfiguration();
            var eventListener = new FakeDecompilerEventListener();
            sc.AddService<IConfigurationService>(config);
            sc.AddService<DecompilerHost>(new FakeDecompilerHost());
            sc.AddService<DecompilerEventListener>(eventListener);
            sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
            ILoader ldr = new Loader(sc);
            var program = ldr.AssembleExecutable(
                FileUnitTester.MapTestPath(relativePath),
                new X86TextAssembler(sc, new X86ArchitectureReal()),
                addrBase);
            program.Platform = new DefaultPlatform(sc, program.Architecture);
            var ep = new ImageSymbol(program.SegmentMap.BaseAddress);
            var project = new Project { Programs = { program } };
            var scan = new Scanner(
                program,
                new ImportResolver(project, program, eventListener),
                sc);
			scan.EnqueueImageSymbol(ep, true);
			scan.ScanImage();

            var importResolver = new ImportResolver(project, program, eventListener);
            var dfa = new DataFlowAnalysis(program, importResolver, eventListener);
			dfa.AnalyzeProgram();
            return program;
		}
开发者ID:relaxar,项目名称:reko,代码行数:29,代码来源:TypingTestBase.cs

示例15: Skeleton

        public Skeleton(Loader l)
        {
            ID = l.ID;

            foreach (Instruction i in l.Parse())
                Load(l, i);
        }
开发者ID:danzhu,项目名称:JoyfulColours,代码行数:7,代码来源:Skeleton.cs


注:本文中的Loader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。