• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Loader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Awake

    void Awake() {
        // setup icons
        {
            var solutionCount = SolutionLineAngles.Length + SolutionTriangles + SolutionSquares + SolutionPentagons;
            var x = (float)(solutionCount - 1) * -IconGap / 2;
            for (int i = 0; i < solutionCount; i++) {
                GameObject newIcon = null;
                if (i < SolutionLineAngles.Length) {
                    newIcon = Instantiate(IconLinePrefab);
                } else if (i < SolutionLineAngles.Length + SolutionTriangles) {
                    newIcon = Instantiate(IconTrianglePrefab);
                } else if (i < SolutionLineAngles.Length + SolutionTriangles + SolutionSquares) {
                    newIcon = Instantiate(IconSquarePrefab);
                } else if (i < SolutionLineAngles.Length + SolutionTriangles + SolutionSquares + SolutionPentagons) {
                    newIcon = Instantiate(IconPentagonPrefab);
                }
                newIcon.transform.parent = transform;
                newIcon.transform.localPosition = new Vector3(x + i * IconGap, IconY, 10);
                if (i < SolutionLineAngles.Length) {
                    newIcon.transform.rotation = Quaternion.Euler(0, 0, SolutionLineAngles[i]);
                }
            }
        }

        loader = FindObjectOfType<Loader>();
        polygonSolver = FindObjectOfType<PolygonSolver>();
        torches = GetComponentsInChildren<Torch>();
        
        for (int i = 0; i < MAX_LINES; i++) {
            lines[i] = Instantiate(LinePrefab);
            lines[i].transform.parent = transform;
            lines[i].transform.localPosition = Vector3.zero;
            LineColliders[i] = lines[i].GetComponentInChildren<Collider2D>();
        }
    }
开发者ID:foolmoron,项目名称:TheCloister,代码行数:35,代码来源:Level.cs


示例17: TestMeta

        public void TestMeta()
        {
            const string input1 =
                @"
Name fixture\storage\meta;
Description ""Contains dummy meta information for a unit test"";
Author SealedSun;

Import 
{
    System,
    System::Text
};

Is AsFastAsPossible;

Add System::Xml To Imports;
";
            var ldr = new Loader(engine, target);
            ldr.LoadFromString(input1);
            Assert.AreEqual(0, ldr.ErrorCount);

            var stored = ldr.Options.TargetApplication.StoreInString();
            Console.WriteLine(stored);

            var reldr = new Loader(engine, new Application());
            reldr.LoadFromString(stored);
            var restored = reldr.Options.TargetApplication.StoreInString();

            Assert.That(stored,
                Is.EqualTo(stored).Using((IEqualityComparer<string>)Engine.DefaultStringComparer),
                _storedShouldBeEqual);
        }
开发者ID:SealedSun,项目名称:prx,代码行数:33,代码来源:Storage.cs


示例18: LoadEngine

        public static Engine LoadEngine(NAnt.Core.FrameworkInfo framework) {
            //System.AppDomainSetup myDomainSetup = new System.AppDomainSetup();
            //myDomainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
            //myDomainSetup.ApplicationName = "MSBuild";

            //string tempFile = Path.GetTempFileName();
            //using (StreamWriter sw = File.CreateText(tempFile))
            //{
            //    sw.WriteLine(String.Format(
            //        "<?xml version='1.0'?><configuration><runtime>"
            //        + "<assemblyBinding xmlns='urn:schemas-microsoft-com:asm.v1'>"
            //        + "<dependentAssembly><assemblyIdentity name='Microsoft.Build.Framework' publicKeyToken='b03f5f7f11d50a3a' culture='neutral'/><bindingRedirect oldVersion='0.0.0.0-99.9.9.9' newVersion='{0}'/></dependentAssembly>"
            //        + "<dependentAssembly><assemblyIdentity name='Microsoft.Build.Engine' publicKeyToken='b03f5f7f11d50a3a' culture='neutral'/><bindingRedirect oldVersion='0.0.0.0-99.9.9.9' newVersion='{0}'/></dependentAssembly>"
            //        + "</assemblyBinding></runtime></configuration>",
            //        new Version(framework.Version.Major, framework.Version.Minor, 0, 0)));
            //}

            //myDomainSetup.ConfigurationFile = tempFile;// AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

            //var executionAD = AppDomain.CreateDomain(myDomainSetup.ApplicationName,
            //    AppDomain.CurrentDomain.Evidence, myDomainSetup);
            //AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad);
            //executionAD.AssemblyLoad += new AssemblyLoadEventHandler(executionAD_AssemblyLoad);

            //File.Delete(tempFile);

            //Loader l = (Loader)executionAD.CreateInstanceAndUnwrap(typeof(Loader).Assembly.FullName, typeof(Loader).FullName);
            Loader l = new Loader();
            l.framework = framework;
            //executionAD.DoCallBack(new CrossAppDomainDelegate(l.DoLoad));
            l.DoLoad();
            return l.engine;            
        }
开发者ID:RoastBoy,项目名称:nant,代码行数:33,代码来源:Engine.cs


示例19: Initialize

        public void Initialize()
        {
            Application = new Application(ApplicationName);
            Engine = new Engine();
            Loader = new Loader(Engine, Application);

            Dependencies = new List<string>();
            Root = new NullContext(Engine, Application, new string[0]);

            var slnPath = Environment.CurrentDirectory;
            while (Directory.Exists(slnPath) && !File.Exists(Path.Combine(slnPath, "Prexonite.sln")))
                slnPath = Path.Combine(slnPath, @".." + Path.DirectorySeparatorChar);

            if (Directory.Exists(slnPath))
            {
                var psrTestsPath =
                    Path.GetFullPath(Path.Combine(slnPath, @"PrexoniteTests\psr-tests"));
                Console.WriteLine("inferred psr-tests path: " + psrTestsPath, "Engine.Path");
                Engine.Paths.Add(psrTestsPath);

                var prxPath = Path.GetFullPath(Path.Combine(slnPath, @"Prx"));
                Console.WriteLine("inferred prx path: " + prxPath, "Engine.Path");
                Engine.Paths.Add(prxPath);
            }
            else
            {
                Console.WriteLine("CANNOT INFER solution PATH: " + slnPath, "Engine.Path");
            }
        }
开发者ID:SealedSun,项目名称:prx,代码行数:29,代码来源:ScriptedUnitTestContainer.cs


示例20: BatchingEntityLoader

		public BatchingEntityLoader(IEntityPersister persister, int[] batchSizes, Loader[] loaders)
		{
			this.batchSizes = batchSizes;
			this.loaders = loaders;
			this.persister = persister;
			idType = persister.IdentifierType;
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:7,代码来源:BatchingEntityLoader.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Local类代码示例发布时间:2022-05-24
下一篇:
C# LoadedAssembly类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap