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

C# IModule类代码示例

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

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



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

示例1: StartAsyncUploading

 private void StartAsyncUploading(IModule uploader, String name, byte[] bytes)
 {
     var backgroundWorker = new BackgroundWorker();
     backgroundWorker.DoWork += (s, e) => e.Result = uploader.Upload(name, bytes);
     backgroundWorker.RunWorkerCompleted += (s, e) => Clipboard.SetText((String) e.Result);
     backgroundWorker.RunWorkerAsync();
 }
开发者ID:nikita-v,项目名称:Screenshoter,代码行数:7,代码来源:ScreenshotUploader.cs


示例2: SetModuleSettings

        public override void SetModuleSettings(IModule module)
        {
            SvrTexture texture = (SvrTexture)module;

            // Set the pixel format
            switch (pixelFormatBox.SelectedIndex)
            {
                case 0: texture.PixelFormat = SvrPixelFormat.Rgb5a3; break;
                case 1: texture.PixelFormat = SvrPixelFormat.Argb8888; break;
            }

            // Set the data format
            switch (dataFormatBox.SelectedIndex)
            {
                case 0: texture.DataFormat = SvrDataFormat.Rectangle; break;
                case 1: texture.DataFormat = SvrDataFormat.Index4ExternalPalette; break;
                case 2: texture.DataFormat = SvrDataFormat.Index8ExternalPalette; break;
                case 3: texture.DataFormat = SvrDataFormat.Index4; break;
                case 4: texture.DataFormat = SvrDataFormat.Index8; break;
            }

            // Set the global index stuff
            texture.HasGlobalIndex = hasGlobalIndexCheckBox.Checked;
            if (texture.HasGlobalIndex)
            {
                uint globalIndex = 0;
                if (!uint.TryParse(globalIndexTextBox.Text, out globalIndex))
                {
                    globalIndex = 0;
                }
                texture.GlobalIndex = globalIndex;
            }
        }
开发者ID:memerdot,项目名称:puyotools-1,代码行数:33,代码来源:SvrWriterSettings.cs


示例3: GenerateResponse

 private void GenerateResponse(IModule module, HttpListenerContext context)
 {
     // Process the request then close the stream. All logic is delegated
     // to the supplied IModule implementer.
     module.Process(context.Response.OutputStream, context);
     context.Response.Close();
 }
开发者ID:Radiation-Wave,项目名称:walrus-server,代码行数:7,代码来源:Server.cs


示例4: ModuleLayout

 public ModuleLayout(IModule module)
 {
     this.InitializeComponent();
     this.module = module;
     this.module.setFrame(Window.Current.Content as Frame);
     this.moduleName.Text = module.getName();
 }
开发者ID:DiabHelp,项目名称:DiabHelp-App-WP,代码行数:7,代码来源:ModuleLayout.xaml.cs


示例5: ClampOutput

        public ClampOutput(IModule sourceModule)
        {
            SourceModule = sourceModule;

            LowerBound = -1;
            UpperBound = 1;
        }
开发者ID:MadoxLabs,项目名称:NoiseTool,代码行数:7,代码来源:ClampOutput.cs


示例6: IntegerType

        /// <summary>
        /// Creates an <see cref="IntegerType"/> instance.
        /// </summary>
        /// <param name="module"></param>
        /// <param name="name"></param>
        /// <param name="enumerator"></param>
        public IntegerType(IModule module, string name, Symbol type, ISymbolEnumerator symbols)
            : base (module, name)
        {
            Types? t = GetExactType(type);
            type.Assert(t.HasValue, "Unknown symbol for unsigned type!");
            _type = t.Value;

            _isEnumeration = false;

            Symbol current = symbols.NextNonEOLSymbol();
            if (current == Symbol.OpenBracket)
            {
                _isEnumeration = true;
                symbols.PutBack(current);
                _map = Lexer.DecodeEnumerations(symbols);
            }
            else if (current == Symbol.OpenParentheses)
            {
                symbols.PutBack(current);
                _ranges = Lexer.DecodeRanges(symbols);
                current.Assert(!_ranges.IsSizeDeclaration, "SIZE keyword is not allowed for ranges of integer types!");
            }
            else
            {
                symbols.PutBack(current);
            }
        }
开发者ID:plocklsh,项目名称:lwip,代码行数:33,代码来源:IntegerType.cs


示例7: ProductsController

 public ProductsController(INews news, IModule module, IPhoto photo, ICacheManager cache)
 {
     _news = news;
     _module = module;
     _cache = cache;
     _photo = photo;
 }
开发者ID:nozerowu,项目名称:ABP,代码行数:7,代码来源:ProductsController.cs


示例8: Displace

 public Displace(IModule mod0, IModule xDisplaceModule, IModule yDisplaceModule, IModule zDisplaceModule)
 {
     Module0 = mod0;
     XDisplaceModule = xDisplaceModule;
     YDisplaceModule = yDisplaceModule;
     ZDisplaceModule = zDisplaceModule;
 }
开发者ID:pboechat,项目名称:VoxelEngine,代码行数:7,代码来源:Displace.cs


示例9: PersistModuleToFile

 private static void PersistModuleToFile(string folder, IModule module, IObjectTree tree)
 {
     string fileName = Path.Combine(folder, module.Name + ".module");
     using (StreamWriter writer = new StreamWriter(fileName))
     {
         writer.Write("#");
         foreach (string dependent in module.Dependents)
         {
             writer.Write(dependent);
             writer.Write(',');
         }
         
         writer.WriteLine();
         foreach (IEntity entity in module.Entities)
         {
             IDefinition node = tree.Find(module.Name, entity.Name);
             if (node == null)
             {
                 continue;
             }
             
             uint[] id = node.GetNumericalForm();
             /* 0: id
              * 1: type
              * 2: name
              * 3: parent name
              */
             writer.WriteLine(ObjectIdentifier.Convert(id) + "," + entity.GetType() + "," + entity.Name + "," + entity.Parent);
         }
         
         writer.Close();
     }
 }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:33,代码来源:Assembler.cs


示例10: LoadModule

        public void LoadModule(IModule module)
        {
            if (this.modules.Contains (module))
                throw new ArgumentException ();

            this.modules.Add (module);
        }
开发者ID:victorsamun,项目名称:NSimulator,代码行数:7,代码来源:EngineMock1.cs


示例11: CfgManipulator

        public CfgManipulator(IModule module, PeReader.DefaultHost host, Log.Log logger, MethodCfg methodCfg) {
            this.host = host;
            this.logger = logger;
            this.module = module;

            this.methodCfg = methodCfg;
        }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:7,代码来源:CfgManipulation.cs


示例12: TranslatePoint

 public TranslatePoint(IModule mod0, double xTrans, double yTrans, double zTrans)
 {
     Module0 = mod0;
     XTranslation = xTrans;
     YTranslation = yTrans;
     ZTranslation = zTrans;
 }
开发者ID:pboechat,项目名称:VoxelEngine,代码行数:7,代码来源:TranslatePoint.cs


示例13: CompressedCacheEntry

        public CompressedCacheEntry(IModule destination, HttpListenerContext context)
        {
            Created = DateTime.Now;
            using (MemoryStream memory = new MemoryStream())
            {
                // Store the raw document.
                destination.Process(memory, context);
                Content = memory.ToArray();

                // Attempt to deflate the document, store if size is reduced.
                using (MemoryStream deflateMemory = new MemoryStream())
                using (DeflateStream deflate = new DeflateStream(deflateMemory, CompressionLevel.Optimal))
                {
                    deflate.Write(Content, 0, Content.Length);
                    if (deflateMemory.Length < Content.Length)
                    {
                        Deflated = deflateMemory.ToArray();
                        IsDeflated = true;
                    }
                    else
                    {
                        IsDeflated = false;
                    }
                }
            }
        }
开发者ID:Radiation-Wave,项目名称:walrus-server,代码行数:26,代码来源:CompressedCache.cs


示例14: SubscribeModule

 public virtual bool SubscribeModule(IModule m)
 {
     if (m.Type == typeof(ControlModule))
     {
         var t = m as ControlModule;
         if(!cmdic.ContainsValue(t))
         {
             cmdic.Add(t.Text, t);
         }
         return true;
     }
     if (m.Type == typeof(AnalysisModule))
     {
         var t = m as AnalysisModule;
         if (!amdic.ContainsValue(t))
         {
             amdic.Add(t.Text, t);
         }
         return true;
     }
     if (m.Type == typeof(SignalModule))
     {
         var t = m as SignalModule;
         if (!smdic.ContainsValue(t))
         {
             smdic.Add(t.Text, t);
         }
         return true;
     }
     return false;
 }
开发者ID:babaq,项目名称:NeuSys,代码行数:31,代码来源:NeuSysConsole.cs


示例15: LoadModule

        public void LoadModule(string ModuleName)
        {
            if (ModuleName == "Dummy") return;
            Assembly a = null;
            try {
                a = Assembly.LoadFrom(ModuleName);
            }
            catch {
                throw new ModuleLoadException(string.Format("Не могу загрузить сборку \"{0}\"", ModuleName));
            }

            Type[] allTypes = a.GetTypes();
            foreach (Type type in allTypes) // ищем во всех классах интерфейс IModule
            {
                Type IModule = type.GetInterface("IModule");
                if (IModule != null) {
                    _module = (IModule) Activator.CreateInstance(type);
                    break;
                }
            }

            if (_module == null)
                throw new ModuleLoadException(string.Format("В сборке \"{0}\" не найден интерфейс IModule.", ModuleName));

            _module.Init();
        }
开发者ID:Beetle-ru,项目名称:NucleusCollaborative,代码行数:26,代码来源:Core.cs


示例16: ScalePoint

 public ScalePoint(IModule mod0, double xScale, double yScale, double zScale)
 {
     Module0 = mod0;
     XScale = xScale;
     YScale = yScale;
     ZScale = zScale;
 }
开发者ID:pboechat,项目名称:VoxelEngine,代码行数:7,代码来源:ScalePoint.cs


示例17: Execute

        public override StateEnums.Status Execute(Object o, Hashtable inputData)
        {
            int activityIdStarting = UpdateProcessStatus(Enums.ProcessStatus.Starting, "", (State)o );

            try
            {
                for (int i = 0; i < testLoopCycles; i++)
                {
                    if (!ifRetry) throw new Exception("Cancelling " + job.JobName + "...");
                    Thread.Sleep(testLoopInterval);
                }
            }
            catch (Exception ex)
            {
                log.Error(ex.Message);
            }

            log.InfoFormat(((State)o).CurrentJobHash, "NullModule executed.");

            if (impersonatedModule != null)
            {
                IDependency<IModule> impersonatedDependencyToRestore =
                                                            (IDependency<IModule>)this.job.Dependencies[this.Name];
                impersonatedDependencyToRestore.Module = impersonatedModule;
                impersonatedModule = null;
            }

            return StateEnums.Status.Success;
        }
开发者ID:BrianGoff,项目名称:BITS,代码行数:29,代码来源:NullModule.cs


示例18: AutofacViewModelFactory

 /// <summary>
 /// Creates new instance of AutofacViewModelFactory using an Autofac Module
 /// 
 /// This will cause the container to be disposed when the AutofacViewModelFactory is disposed
 /// </summary>
 public AutofacViewModelFactory(IModule moduleToRegister)
 {
     var containerBuilder = new ContainerBuilder();
     containerBuilder.RegisterModule(moduleToRegister);
     autofacContainer = containerBuilder.Build();
     shouldDisposeContainer = true;
 }
开发者ID:roxberry,项目名称:VSTOContrib,代码行数:12,代码来源:AutofacViewModelFactory.cs


示例19: RewriteModule

        public static IModule RewriteModule(IMetadataHost host, ILocalScopeProvider localScopeProvider, ISourceLocationProvider sourceLocationProvider, IModule module)
        {
            var m = new PropertyChangedWeaver(host);
            m._rewriter = new ReferenceReplacementRewriter(host, localScopeProvider, sourceLocationProvider);

            return m.Rewrite(module);
        }
开发者ID:robocoder,项目名称:aphid,代码行数:7,代码来源:PropertyChangedWeaver.cs


示例20: DemoInferables

        private static void DemoInferables(IModule module)
        {
            ShowConsoleHeader(module);

            // Here we are getting an inferred type that matches interface IFoo based on the namespace bindings for this module.
            var foo = module.Get<IFoo>();
            foo.Dump("Value for foo");

            // This method resolves the inferred on finding the match patten foo2 for Interface type IFoo.
            var foo2 = module.Get<IFoo>("foo2");
            foo.Dump("Value for foo2");

            // Here we are getting foo again- performance very good this time around since all type generation il code has been cached.
            var fooAgain = module.Get<IFoo>();
            fooAgain.Dump("Value for fooAgain");

            // Here we are mapping explicitly to a Foo type, choosing the appropriate constructor and infering dependencies.
            var explicitFoo = module.GetExplicit<Foo>();
            explicitFoo.Dump("Value of explicit foo");

            ShowFactoryTestsHeader();

            // Here we are binding to a custom factory interface, which will automatically generate a type for this factory, cache the it, and instantiate it.
            var factory = module.GetFactory<IFactory>();
            factory.GetFoo().Dump("Value for GetFoo()");
            factory.GetFoo1().Dump("Value for GetFoo1()");
            factory.GetFoo2().Dump("Value for GetFoo2()");
            factory.GetFoo3().Dump("Value for GetFoo3()");
            factory.GetFoo4().Dump("Value for GetFoo4()");
            factory.GetFoo5().Dump("Value for GetFoo5()");
            factory.GetFoo6().Dump("Value for GetFoo6()");
        }
开发者ID:nmuhonen,项目名称:Inferables-For-CLR,代码行数:32,代码来源:Program.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IModuleContext类代码示例发布时间:2022-05-24
下一篇:
C# IModelSystemStructure类代码示例发布时间: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