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


C# IEngine类代码示例

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


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

示例1: FrmModifyUser

 public FrmModifyUser(IEngine engine, IDatabase db, OpenDMS.Storage.Security.Session session)
 {
     InitializeComponent();
     _engine = engine;
     _db = db;
     _session = session;
 }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:7,代码来源:FrmModifyUser.cs

示例2: How_to_connect_to_an_event_source

        // HOW-TO: Connect to an event source (IConnectionPoint)
        public static void How_to_connect_to_an_event_source( IEngine engine )
        {
            // COM objects implement IConnectionPoint interface to make events
            // they support available to clients. Working directly with this interface
            // is possible but rather tedious. To facilitate working with events,
            // the .NET Framework generates a set of helper classes when importing
            // types information from a type library.

            // For example, to subscribe to ICollectionEvents from an object, you use
            // ICollectionEvents_Event helper class. Casting an object to this class
            // will automatically check if the object implements IConnectionPoint interface
            // and connect to ICollectionEvents if found. If the connection point is not available,
            // the cast will result in a null:

            trace( "Cast the object to the helper class for the required event source." );
            ICollectionEvents_Event collectionEvents = engine as ICollectionEvents_Event;
            if( collectionEvents != null ) {
                // IEngine does not support this kind of events, but if it did, we could
                // assign a method to handle the events:

                trace( "Assign a method to be called when a particular event occurs." );
                // collectionEvents.OnCollectionChanged +=
                //		new ICollectionEvents_OnCollectionChangedEventHandler( ... );
            }
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:26,代码来源:Frequently+asked+questions.cs

示例3: Configure

        public virtual void Configure(IEngine engine, EventBroker broker, ConfigurationManagerWrapper configuration)
        {
            configuration.Start();
            engine.Container.AddComponentInstance("n2.configuration", typeof(ConfigurationManagerWrapper), configuration);
            engine.Container.AddComponentInstance("n2.engine", typeof(IEngine), engine);
            engine.Container.AddComponentInstance("n2.container", typeof(IServiceContainer), engine.Container);
            engine.Container.AddComponentInstance("n2.containerConfigurer", typeof(ContainerConfigurer), this);

            AddComponentInstance(engine.Container, configuration.GetConnectionStringsSection());
            AddComponentInstance(engine.Container, configuration.Sections.Engine);
            if (configuration.Sections.Engine != null)
                RegisterConfiguredComponents(engine.Container, configuration.Sections.Engine);
            AddComponentInstance(engine.Container, configuration.Sections.Web);
            if (configuration.Sections.Web != null)
                InitializeEnvironment(engine.Container, configuration.Sections);
            AddComponentInstance(engine.Container, configuration.Sections.Database);
            AddComponentInstance(engine.Container, configuration.Sections.Management);

            AddComponentInstance(engine.Container, broker);

            engine.Container.AddComponent("n2.typeFinder", typeof(ITypeFinder), typeof(WebAppTypeFinder));
            engine.Container.AddComponent("n2.webContext", typeof(N2.Web.IWebContext), typeof(N2.Web.AdaptiveContext));
            engine.Container.AddComponent("n2.serviceRegistrator", typeof(ServiceRegistrator), typeof(ServiceRegistrator));

            var registrator = engine.Container.Resolve<ServiceRegistrator>();
            var services = registrator.FindServices();
            var configurationKeys = GetComponentConfigurationKeys(configuration);
            services = registrator.FilterServices(services, configurationKeys);
            registrator.RegisterServices(services);
        }
开发者ID:GrimaceOfDespair,项目名称:n2cms,代码行数:30,代码来源:ContainerConfigurer.cs

示例4: DemoSat

        public DemoSat(string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass)
            : base(craftDirectory, position, velocity, payloadMass, 0, "Textures/fairing.png")
        {
            _fairingMass = 1750;

            Engines = new IEngine[0];
        }
开发者ID:zlynn1990,项目名称:SpaceSim,代码行数:7,代码来源:DemoSat.cs

示例5: MasterPageConcern

		public MasterPageConcern(IEngine engine)
		{
			this.engine = engine;
			var section = engine.Config.GetContentSection<TemplatesSection>("templates");
			if (section != null)
				configuredMasterPagePath = section.MasterPageFile;
		}
开发者ID:nagarjunachallapalli,项目名称:n2cms,代码行数:7,代码来源:MasterPageConcern.cs

示例6: Configure

        public virtual void Configure(IEngine engine, ContainerManager containerManager, EventBroker broker, SiteConfig configuration)
        {
            //other dependencies
            containerManager.AddComponentInstance<SiteConfig>(configuration, "site.configuration");
            containerManager.AddComponentInstance<IEngine>(engine, "site.engine");
            containerManager.AddComponentInstance<ContainerConfigurer>(this, "site.containerConfigurer");

            //type finder
            containerManager.AddComponent<ITypeFinder, WebAppTypeFinder>("site.typeFinder");

            //register dependencies provided by other assemblies
            var typeFinder = containerManager.Resolve<ITypeFinder>();
            containerManager.UpdateContainer(x =>
            {
                var drTypes = typeFinder.FindClassesOfType<IDependencyRegistrar>();
                var drInstances = new List<IDependencyRegistrar>();
                foreach (var drType in drTypes)
                    drInstances.Add((IDependencyRegistrar)Activator.CreateInstance(drType));
                //sort
                drInstances = drInstances.AsQueryable().OrderBy(t => t.Order).ToList();
                foreach (var dependencyRegistrar in drInstances)
                    dependencyRegistrar.Register(x, typeFinder);
            });

            //event broker
            containerManager.AddComponentInstance(broker);

            //service registration
            containerManager.AddComponent<DependencyAttributeRegistrator>("site.serviceRegistrator");
            var registrator = containerManager.Resolve<DependencyAttributeRegistrator>();
            var services = registrator.FindServices();
            var configurations = GetComponentConfigurations(configuration);
            services = registrator.FilterServices(services, configurations);
            registrator.RegisterServices(services);
        }
开发者ID:netsouls,项目名称:eCentral,代码行数:35,代码来源:ContainerConfigurer.cs

示例7: Evaluate

        public static CreateObjectCommand Evaluate(IEngine engine, Command command)
        {
            if (command.Parameters.Count < 2)
                return null;

            if (command.Parameters[0].Name.ToLower() != "create")
                return null;
            if (command.Parameters[0].Value != null)
                return null;

            string name = command.Parameters[1].Name;
            if (string.IsNullOrEmpty(name))
                return null;

            ISchemaService schemaService = engine.GetService<ISchemaService>();
            if (!schemaService.HasClass(name))
                return null;

            CreateObjectCommand createObjectCommand = new CreateObjectCommand(name);

            IList<Parameter> parameters = command.Parameters[1].Value as IList<Parameter>;
            if (parameters != null)
            {
                foreach (Parameter parameter in parameters)
                {
                    if (schemaService.HasProperty(name, parameter.Name))
                    {
                        createObjectCommand.Values[parameter.Name] = parameter.Value;
                    }
                }
            }

            return createObjectCommand;
        }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:34,代码来源:CreateObjectCommand.cs

示例8: Configure

		public virtual void Configure(IEngine engine, EventBroker broker, ConfigurationManagerWrapper configuration)
		{
			engine.Container.AddComponentInstance("n2.configuration", typeof(ConfigurationManagerWrapper), configuration);
			engine.Container.AddComponentInstance("n2.engine", typeof(IEngine), engine);
			engine.Container.AddComponentInstance("n2.container", typeof(IServiceContainer), engine.Container);
			engine.Container.AddComponentInstance("n2.containerConfigurer", typeof(ContainerConfigurer), this);

			AddComponentInstance(engine.Container, configuration.GetConnectionStringsSection());
			AddComponentInstance(engine.Container, configuration.Sections.Engine);
			RegisterConfiguredComponents(engine.Container, configuration.Sections.Engine);
			AddComponentInstance(engine.Container, configuration.Sections.Web);
			InitializeEnvironment(engine.Container, configuration.Sections);
			AddComponentInstance(engine.Container, configuration.Sections.Database);
			AddComponentInstance(engine.Container, configuration.Sections.Management);

			AddComponentInstance(engine.Container, broker);

			var skipTypes = configuration.Sections.Engine.Components.GetConfiguredServiceTypes();
			AddComponentUnlessConfigured(engine.Container, typeof(BasicTemporaryFileHelper), typeof(BasicTemporaryFileHelper), skipTypes);
			AddComponentUnlessConfigured(engine.Container, typeof(TypeCache), typeof(TypeCache), skipTypes);
			AddComponentUnlessConfigured(engine.Container, typeof(ITypeFinder), typeof(WebAppTypeFinder), skipTypes);
			AddComponentUnlessConfigured(engine.Container, typeof(ServiceRegistrator), typeof(ServiceRegistrator), skipTypes);

			var registrator = engine.Container.Resolve<ServiceRegistrator>();
			var services = registrator.FindServices();
			var configurationKeys = configuration.GetComponentConfigurationKeys();
			services = registrator.FilterServices(services, configurationKeys);
			services = registrator.FilterServices(services, skipTypes);
			registrator.RegisterServices(services);

			InitializeUrlParser(engine.Container);
		}
开发者ID:navneetccna,项目名称:n2cms,代码行数:32,代码来源:ContainerConfigurer.cs

示例9: SendMessage

 public SendMessage(IEngine engine)
     : base(engine)
 {
     // default 1 second timeout
     Timeout = 1;
     Async = true;
 }
开发者ID:jardrake03,项目名称:incert,代码行数:7,代码来源:SendMessage.cs

示例10: GetTargetingContext

		public static TargetingContext GetTargetingContext(this System.Web.HttpContextBase httpContext, IEngine engine = null)
		{
			var context = httpContext.Items["N2.TargetingContext"] as TargetingContext;
			if (context == null)
				httpContext.Items["N2.TargetingContext"] = context = (engine ?? httpContext.GetEngine()).Resolve<TargetingRadar>().BuildTargetingContext(httpContext);
			return context;
		}
开发者ID:rajeshpillai,项目名称:n2cms,代码行数:7,代码来源:TargetingExtensions.cs

示例11: Visit

        public virtual void Visit(IEngine engine)
        {
            Console.WriteLine("The engine has: " + 
									camshaftCount +" camshaft(s), " + 
									pistonCount + " piston(s), and " + 
									sparkPlugCount + " spark plug(s)");
        }
开发者ID:MahendraSv,项目名称:csdpe,代码行数:7,代码来源:EngineInventory.cs

示例12: TerrainCollection

		public TerrainCollection( ResourceManager rm, IEngine engine, IScene scene ) {
			_engine = engine;
			_scene = scene;
			_resource_manager = rm;

			// now create chunks at the empty points
			int i, j, k, cs;
			for ( k=0; k<zoomorder; k++ ) {
				cs = (int)(ts*Math.Pow(hpc,k+1));
				CX[k] = 0;
				CZ[k] = 0;
				for ( i=0; i<xorder; i++ ) {
					for ( j=0; j<zorder; j++ ) {
						TC[i,j,k] = _engine.CreateTerrainChunk(i*cs, j*cs, cs/hpc, hpc);

						ITexture texture = engine.CreateTexture( "land", Constants.terrainPieceTextureWidth*hpc, Constants.terrainPieceTextureWidth*hpc );
						TC[i,j,k].SetTexture( texture );

						// TODO: how to know which detail texture to use?
						//TC[i,j,k].SetDetailTexture( _resource_manager.GetTexture( 9 ) );

						// TODO: fix this don't hardcode it... and don't set it per terrain chunk
						//if ( k == zoomorder-1 ){
							// TODO:
						//	TC[i,j,k].SetClouds(_resource_manager.GetTexture(8));
						//}
					}
				}
			}
		}
开发者ID:timothypratley,项目名称:Strive.NET,代码行数:30,代码来源:TerrainCollection.cs

示例13: InterceptionEngine

        public InterceptionEngine(IEngine engine, IEnumerable<IIntercept> intercepts, bool active)
            : base(intercepts, active)
        {
            Contract.Requires(engine != null, "engine != null");

            _engine = engine;
        }
开发者ID:CNH-Hyper-Extractive,项目名称:parallel-sdk,代码行数:7,代码来源:InterceptionEngine.cs

示例14: DragonV2Trunk

        public DragonV2Trunk(string craftDirectory, DVector2 position, DVector2 velocity)
            : base(craftDirectory, position, velocity, 0, 0, "Textures/dragonTrunkV2.png")
        {
            StageOffset = new DVector2(0, 4);

            Engines = new IEngine[0];
        }
开发者ID:zlynn1990,项目名称:SpaceSim,代码行数:7,代码来源:DragonV2Trunk.cs

示例15: Using_a_configured_FlexiCapture_project_to_recognize_image_files

        // USE CASE: Using a configured FlexiCapture project to recognize image files
        public static void Using_a_configured_FlexiCapture_project_to_recognize_image_files( IEngine engine )
        {
            trace( "Open the sample project..." );
            IProject project = engine.OpenProject( SamplesFolder + "\\SampleProject\\Invoices_eng.fcproj" );

            try {
                trace( "Add a new batch..." );
                IBatch batch = project.Batches.AddNew( "TestBatch" );

                trace( "Open the batch..." );
                batch.Open();

                try {
                    trace( "Add image files to the batch..." );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_1.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_2.tif" );
                    batch.AddImage( SamplesFolder + "\\SampleImages\\Invoices_3.tif" );

                    trace( "Recognize all images in the batch..." );
                    batch.Recognize( null, RecognitionModeEnum.RM_ReRecognizeMinimal, null );

                    trace( "Export the results..." );
                    batch.Export( null, null );

                    trace( "Close and delete the batch..." );
                } finally {
                    batch.Close(); // Before the batch could be deleted, it has to be closed
                    project.Batches.DeleteAll();
                }

                trace( "Close the project..." );
            } finally {
                project.Close();
            }
        }
开发者ID:DominatorCode,项目名称:FlexiCapture-Code-Snippets--C--,代码行数:36,代码来源:Working+with+an+existing+FlexiCapture+project.cs


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