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


C# IModule类代码示例

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


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


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