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


C# ModuleInfo类代码示例

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


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

示例1: LoadModule

 /// <summary>Inherited</summary>
 public void LoadModule(ModuleInfo moduleInfo)
 {
     var assembly = LoadAssembly(moduleInfo);
     var bootstraper = CreateBootstraper(assembly);
     ExecuteOnLoad(bootstraper);
     RegisterModule(moduleInfo, bootstraper);
 }
开发者ID:psla,项目名称:Nomad,代码行数:8,代码来源:ModuleLoader.cs

示例2: BeginLoadModuleType

        /// <summary>
        /// Starts retrieving the <paramref name="moduleInfo"/> and calls the <paramref name="callback"/> when it is done.
        /// </summary>
        /// <param name="moduleInfo">Module that should have it's type loaded.</param>
        /// <param name="callback">Delegate to be called when typeloading process completes or fails.</param>
        public void BeginLoadModuleType(ModuleInfo moduleInfo, ModuleTypeLoadedCallback callback)
        {
            Uri uriRef = new Uri(moduleInfo.Ref, UriKind.RelativeOrAbsolute);
            lock (this.typeLoadingCallbacks)
            {
                ModuleTypeLoaderCallbackMetadata callbackMetadata = new ModuleTypeLoaderCallbackMetadata { Callback = callback, ModuleInfo = moduleInfo };

                List<ModuleTypeLoaderCallbackMetadata> callbacks;
                if (this.typeLoadingCallbacks.TryGetValue(uriRef, out callbacks))
                {
                    callbacks.Add(callbackMetadata);
                    return;
                }

                this.typeLoadingCallbacks[uriRef] = new List<ModuleTypeLoaderCallbackMetadata> { callbackMetadata };
            }

            IFileDownloader downloader = this.CreateDownloader();
            downloader.DownloadCompleted += this.OnDownloadCompleted;

            try
            {
                downloader.DownloadAsync(uriRef, uriRef);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Module download from failed : {0}", uriRef), ex);
            }
        }
开发者ID:neurosoup,项目名称:mymoon,代码行数:34,代码来源:XapModuleTypeLoader.cs

示例3: ContextSecurity

 public ContextSecurity(ModuleInfo objModule)
 {
     UserId = UserController.Instance.GetCurrentUserInfo().UserID;
     CanView = ModulePermissionController.CanViewModule(objModule);
     CanEdit = ModulePermissionController.HasModulePermission(objModule.ModulePermissions, "EDIT");
     IsAdmin = PortalSecurity.IsInRole(PortalSettings.Current.AdministratorRoleName);
 }
开发者ID:donker,项目名称:generator-dnn-spa-gulp-react,代码行数:7,代码来源:ContextSecurity.cs

示例4: CanAddContentToPage

 private static bool CanAddContentToPage(ModuleInfo objModule)
 {
     bool canManage = Null.NullBoolean;
     TabInfo objTab = new TabController().GetTab(objModule.TabID, objModule.PortalID, false);
     canManage = TabPermissionController.CanAddContentToPage(objTab);
     return canManage;
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:7,代码来源:ModulePermissionController.cs

示例5: DeviceInfo

    //helper for simple devices
    public DeviceInfo(
		int id,		
		string deviceName,
		string spriteName,
		string promoterName,
		float productionMax,
		float terminatorFactor,
		string formula,
		string product,
		float rbs)
    {
        ModuleInfo moduleInfo = new ModuleInfo(
            "pLac",
            10.0f,
            1.0f,
            "![0.8,2]LacI",
            "GFP",
            1.0f
            );
        List<ModuleInfo> modules = new List<ModuleInfo>();
        modules.Add(moduleInfo);

        _id = id;
        _name = deviceName;
        _spriteName = spriteName;
        _modules = modules;
    }
开发者ID:quito,项目名称:DSynBio_reloaded,代码行数:28,代码来源:DeviceInfo.cs

示例6: Add

        public bool Add(ModuleInfo entity)
        {
            T_PF_MODULEINFO model = entity.CloneObject<T_PF_MODULEINFO>(new T_PF_MODULEINFO());
            model = Utility.CreateCommonProperty().CloneObject<T_PF_MODULEINFO>(model);

            return _commonDAL.Add(model);
        }
开发者ID:JuRogn,项目名称:OA,代码行数:7,代码来源:ModuleInfoDAL.cs

示例7: AddContent

 private static void AddContent(XmlNode nodeModule, ModuleInfo objModule)
 {
     XmlAttribute xmlattr;
     if (!String.IsNullOrEmpty(objModule.DesktopModule.BusinessControllerClass) && objModule.DesktopModule.IsPortable)
     {
         try
         {
             object objObject = Framework.Reflection.CreateObject(objModule.DesktopModule.BusinessControllerClass, objModule.DesktopModule.BusinessControllerClass);
             if (objObject is IPortable)
             {
                 string Content = Convert.ToString(((IPortable)objObject).ExportModule(objModule.ModuleID));
                 if (!String.IsNullOrEmpty(Content))
                 {
                     XmlNode newnode = nodeModule.OwnerDocument.CreateElement("content");
                     xmlattr = nodeModule.OwnerDocument.CreateAttribute("type");
                     xmlattr.Value = Globals.CleanName(objModule.DesktopModule.ModuleName);
                     newnode.Attributes.Append(xmlattr);
                     xmlattr = nodeModule.OwnerDocument.CreateAttribute("version");
                     xmlattr.Value = objModule.DesktopModule.Version;
                     newnode.Attributes.Append(xmlattr);
                     Content = HttpContext.Current.Server.HtmlEncode(Content);
                     newnode.InnerXml = XmlUtils.XMLEncode(Content);
                     nodeModule.AppendChild(newnode);
                 }
             }
         }
         catch
         {
         }
     }
 }
开发者ID:jackiechou,项目名称:thegioicuaban.com,代码行数:31,代码来源:ModuleController.cs

示例8: load_modules_only_loads_modules_that_pass_filter

        public void load_modules_only_loads_modules_that_pass_filter()
        {
            var a = new ModuleInfo("a", _moduleManifestMock.Object);
            var b = new ModuleInfo("b", _moduleManifestMock.Object);

            var expectedModuleInfos = new[]
                                          {
                                              a, b
                                          };

            var discoveryMock = new Mock<IModuleDiscovery>(MockBehavior.Loose);
            discoveryMock.Setup(discovery => discovery.GetModules())
                .Returns(expectedModuleInfos);

            var filterMock = new Mock<IModuleFilter>(MockBehavior.Loose);
            filterMock.Setup(filter => filter.Matches(a))
                .Returns(true);
            filterMock.Setup(filter => filter.Matches(b))
                .Returns(false);

            var loaderMock = new Mock<IModuleLoader>(MockBehavior.Strict);
            loaderMock.Setup(x => x.GetLoadedModules()).Returns(new List<ModuleInfo>());
            loaderMock.Setup(loader => loader.LoadModule(a));

            var moduleManager = new ModuleManager(loaderMock.Object, filterMock.Object,
                                                  _dependencyMock.Object);

            moduleManager.LoadModules(discoveryMock.Object);

            loaderMock.Verify(x => x.LoadModule(a));
            loaderMock.Verify(x => x.LoadModule(It.IsAny<ModuleInfo>()), Times.Exactly(1));
        }
开发者ID:NomadPL,项目名称:Nomad,代码行数:32,代码来源:ModuleManagerInteractions.cs

示例9: ExtractAll

 public static void ExtractAll(string path, string projectName)
 {
     if (!Directory.Exists(Path.Combine(path, "Projects")))
         Directory.CreateDirectory(Path.Combine(path, "Projects"));
     var module = new ModuleInfo { Name = projectName };
     module.Save(Path.Combine(path, "Module.xml"));
 }
开发者ID:kolupaev,项目名称:Protobuild,代码行数:7,代码来源:ResourceExtractor.cs

示例10: BeginLoadModuleType

        /// <summary>
        /// Starts retrieving the <paramref name="moduleInfo"/> and calls the <paramref name="callback"/> when it is done.
        /// </summary>
        /// <param name="moduleInfo">Module that should have it's type loaded.</param>
        /// <param name="callback">Delegate to be called when typeloading process completes or fails.</param>
        public void BeginLoadModuleType(ModuleInfo moduleInfo, ModuleTypeLoadedCallback callback)
        {
            Uri uriRef = new Uri(moduleInfo.Ref, UriKind.RelativeOrAbsolute);
            lock (this.typeLoadingCallbacks)
            {
                ModuleTypeLoaderCallbackMetadata callbackMetadata = new ModuleTypeLoaderCallbackMetadata()
                                                                 {
                                                                     Callback = callback,
                                                                     ModuleInfo = moduleInfo
                                                                 };

                List<ModuleTypeLoaderCallbackMetadata> callbacks;
                if (this.typeLoadingCallbacks.TryGetValue(uriRef, out callbacks))
                {
                    callbacks.Add(callbackMetadata);
                    return;
                }

                this.typeLoadingCallbacks[uriRef] = new List<ModuleTypeLoaderCallbackMetadata> { callbackMetadata };
            }

            IFileDownloader downloader = this.CreateDownloader();
            downloader.DownloadCompleted += this.OnDownloadCompleted;

            downloader.DownloadAsync(uriRef, uriRef);
        }
开发者ID:eslahi,项目名称:prism,代码行数:31,代码来源:XapModuleTypeLoader.cs

示例11: Open

 public static void Open(ModuleInfo root, object obj, Action update)
 {
     var definitionInfo = obj as DefinitionInfo;
     var moduleInfo = obj as ModuleInfo;
     if (definitionInfo != null)
     {
         // Open XML in editor.
         Process.Start("monodevelop", definitionInfo.DefinitionPath);
     }
     if (moduleInfo != null)
     {
         // Start the module's Protobuild unless it's also our
         // module (for the root node).
         if (moduleInfo.Path != root.Path)
         {
             var info = new ProcessStartInfo
             {
                 FileName = System.IO.Path.Combine(moduleInfo.Path, "Protobuild.exe"),
                 WorkingDirectory = moduleInfo.Path
             };
             var p = Process.Start(info);
             p.EnableRaisingEvents = true;
             p.Exited += (object sender, EventArgs e) => update();
         }
     }
 }
开发者ID:JoschaMetze,项目名称:Protobuild,代码行数:26,代码来源:Actions.cs

示例12: update_list_closes_the_cycle_with_additional_module

        public void update_list_closes_the_cycle_with_additional_module()
        {
            /*
             * Local:
             * A(v1) v1-> B(v1) v1 -> C(v1)
             *
             * Remote:
             * C(v2) v2-> D(v2) v0-> A(v1) from local
             *
             * Result: failure
             */

            ModuleInfo c1;
            ModuleInfo a1;
            ModuleInfo b1;

            PrepareChainWithVersion(_v1, out a1, out b1, out c1);

            ModuleInfo c2 = SetUpModuleInfoWithVersion("C", _v2,
                                                       new KeyValuePair<string, Version>("D", _v2));
            ModuleInfo d2 = SetUpModuleInfoWithVersion("D", _v2,
                                                       new KeyValuePair<string, Version>("A", _v0));

            Modules = new[] {a1, b1, c1};
            _updateModules = new[] {c2, d2};

            // FIXME:  should it be empty list ? or we should put what ?
            ExpectedModules = new ModuleInfo[] {};

            PerformTest();

            Assert.IsFalse(_resultBool);
            Assert.AreEqual(ExpectedModules, _resultNonValidModules);
        }
开发者ID:NomadPL,项目名称:Nomad,代码行数:34,代码来源:CheckModulesTest.cs

示例13: Parse

 public ModuleInfo Parse(string script)
 {
     var alreadyModuleDef = Regex.Match(script, "^require.define\\(", RegexOptions.Singleline);
     var directiveHeader = Regex.Match(script, "^[\"'](.*)[\"'];\r?\n", RegexOptions.Singleline);
     if (alreadyModuleDef.Success || !directiveHeader.Success) return new ModuleInfo() { Content = script, Dependencies = new List<string>(), Packaged = true };
     var directives = directiveHeader.Groups[1].Value.Split(';');
     var moduleInfo = new ModuleInfo();
     foreach (var directive in directives)
     {
         var parts = directive.Split(':');
         var name = parts[0].Trim();
         var value = parts[1].Trim();
         if (name == "depends")
         {
             if (value.Length > 0)
                 moduleInfo.Dependencies.AddRange(value.Split(new char[] { ',' }).Select(v => v.Trim()));
         }
         if (name == "provides")
         {
             moduleInfo.Name = value;
         }
     }
     moduleInfo.Content = script.Substring(directiveHeader.Index + directiveHeader.Value.Length, script.Length - directiveHeader.Value.Length);
     return moduleInfo;
 }
开发者ID:karlbohlmark,项目名称:front,代码行数:25,代码来源:ModuleParser.cs

示例14: RhModule

 public RhModule(RhRuntime runtime, ModuleInfo module)
 {
     m_runtime = runtime;
     m_name = string.IsNullOrEmpty(module.FileName) ? "" : Path.GetFileNameWithoutExtension(module.FileName);
     m_filename = module.FileName;
     m_imageBase = module.ImageBase;
     m_size = module.FileSize;
 }
开发者ID:FrenchData,项目名称:dotnetsamples,代码行数:8,代码来源:module.cs

示例15: GetManifest

 /// <summary>
 /// Inherited.
 /// </summary>
 public ModuleManifest GetManifest(ModuleInfo moduleInfo)
 {
     var manifestPath = string.Format("{0}{1}", moduleInfo.AssemblyPath,
                                      ModuleManifest.ManifestFileNameSuffix);
     var manifest = File.ReadAllBytes(manifestPath);
     return
         XmlSerializerHelper.Deserialize<ModuleManifest>(manifest);
 }
开发者ID:NomadPL,项目名称:Nomad,代码行数:11,代码来源:ModuleManifestFactory.cs


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