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

C# ModuleInfo类代码示例

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

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



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


示例16: NativeModule

 public NativeModule(NativeRuntime runtime, ModuleInfo module)
 {
     _runtime = runtime;
     _name = string.IsNullOrEmpty(module.FileName) ? "" : Path.GetFileNameWithoutExtension(module.FileName);
     _filename = module.FileName;
     _imageBase = module.ImageBase;
     _size = module.FileSize;
 }
开发者ID:kailer89,项目名称:clrmd,代码行数:8,代码来源:module.cs


示例17: GetCommonJsModule

 public string GetCommonJsModule(ModuleInfo moduleInfo)
 {
     return ModuleFormat
         .Replace("<name>", moduleInfo.Name)
         .Replace("<content>", moduleInfo.Content.Replace("\n", "\t\t\n"))
         .Replace("<dependencies>", moduleInfo.Dependencies.Count==0 ? "[]" :  string.Format("['{0}']", String.Join("','", moduleInfo.Dependencies)))
         .Replace("\t", indent);
 }
开发者ID:karlbohlmark,项目名称:front,代码行数:8,代码来源:CommonJsFormatter.cs


示例18: ReadModuleInfo

        public new void ReadModuleInfo( BinaryReader BinaryStream, uint Count )
        {
            ModuleInfo = new ModuleInfo[Count];

            for( uint ModuleIndex = 0; ModuleIndex < Count; ModuleIndex++ )
            {
                ModuleInfo[ModuleIndex] = new ModuleInfo( BinaryStream );
            }
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:9,代码来源:Xbox360.cs


示例19: AppDataMap

 public AppDataMap(bool languageCaseSensitive, AstNode programRoot = null) {
   LanguageCaseSensitive = languageCaseSensitive;
   ProgramRoot = programRoot?? new AstNode(); 
   var mainScopeInfo = new ScopeInfo(ProgramRoot, LanguageCaseSensitive); 
   StaticScopeInfos.Add(mainScopeInfo);
   mainScopeInfo.StaticIndex = 0;
   MainModule = new ModuleInfo("main", "main", mainScopeInfo);
   Modules.Add(MainModule);
 }
开发者ID:androdev4u,项目名称:XLParser,代码行数:9,代码来源:AppDataMap.cs


示例20: AddModules

        /// <summary>
        /// Connects to database and adds modules details.
        /// </summary>
        /// <param name="objList">Object of ModuleInfo.</param>
        /// <param name="isAdmin">Set true if the module is admin.</param>
        /// <param name="PackageID">Package ID.</param>
        /// <param name="IsActive">Set true if the module is active.</param>
        /// <param name="AddedOn">Module added date.</param>
        /// <param name="PortalID">Portal ID.</param>
        /// <param name="AddedBy">Module added user's name.</param>
        /// <returns>Returns array of int containing 1: ModuleID and 2: ModuleDefID.</returns>
        public int[] AddModules(ModuleInfo objList, bool isAdmin, int PackageID, bool IsActive, DateTime AddedOn, int PortalID, string AddedBy)
        {
            string sp = "[dbo].[sp_ModulesAdd]";
            //SQLHandler sagesql = new SQLHandler();
            try
            {
                List<KeyValuePair<string, object>> ParamCollInput = new List<KeyValuePair<string, object>>();
                ParamCollInput.Add(new KeyValuePair<string, object>("@ModuleName", objList.ModuleName));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Name", objList.Name));
                ParamCollInput.Add(new KeyValuePair<string, object>("@FriendlyName", objList.FriendlyName));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Description", objList.Description));
                ParamCollInput.Add(new KeyValuePair<string, object>("@FolderName", objList.FolderName));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Version", objList.Version));

                ParamCollInput.Add(new KeyValuePair<string, object>("@isPremium", objList.isPremium));
                ParamCollInput.Add(new KeyValuePair<string, object>("@isAdmin", isAdmin));


                ParamCollInput.Add(new KeyValuePair<string, object>("@Owner", objList.Owner));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Organization", objList.Organization));
                ParamCollInput.Add(new KeyValuePair<string, object>("@URL", objList.URL));
                ParamCollInput.Add(new KeyValuePair<string, object>("@Email", objList.Email));
                ParamCollInput.Add(new KeyValuePair<string, object>("@ReleaseNotes", objList.ReleaseNotes));
                ParamCollInput.Add(new KeyValuePair<string, object>("@License", objList.License));
                ParamCollInput.Add(new KeyValuePair<string, object>("@PackageType", objList.PackageType));
                ParamCollInput.Add(new KeyValuePair<string, object>("@supportedFeatures", objList.supportedFeatures));
                ParamCollInput.Add(new KeyValuePair<string, object>("@BusinessControllerClass", objList.BusinessControllerClass));
                ParamCollInput.Add(new KeyValuePair<string, object>("@CompatibleVersions", objList.CompatibleVersions));
                ParamCollInput.Add(new KeyValuePair<string, object>("@dependencies", objList.dependencies));
                ParamCollInput.Add(new KeyValuePair<string, object>("@permissions", objList.permissions));

                ParamCollInput.Add(new KeyValuePair<string, object>("@PackageID", PackageID));
                ParamCollInput.Add(new KeyValuePair<string, object>("@IsActive", IsActive));
                ParamCollInput.Add(new KeyValuePair<string, object>("@AddedOn", AddedOn));
                ParamCollInput.Add(new KeyValuePair<string, object>("@PortalID", PortalID));
                ParamCollInput.Add(new KeyValuePair<string, object>("@AddedBy", AddedBy));

                List<KeyValuePair<string, object>> ParamCollOutput = new List<KeyValuePair<string, object>>();
                ParamCollOutput.Add(new KeyValuePair<string, object>("@ModuleID", objList.ModuleID));
                ParamCollOutput.Add(new KeyValuePair<string, object>("@ModuleDefID", objList.ModuleDefID));

                SageFrameSQLHelper sagesql = new SageFrameSQLHelper();

                List<KeyValuePair<int, string>> OutputValColl = new List<KeyValuePair<int, string>>();
                OutputValColl = sagesql.ExecuteNonQueryWithMultipleOutput(sp, ParamCollInput, ParamCollOutput);
                int[] arrOutPutValue = new int[2];
                arrOutPutValue[0] = int.Parse(OutputValColl[0].Value);
                arrOutPutValue[1] = int.Parse(OutputValColl[1].Value);

                return arrOutPutValue;

            }
            catch (Exception)
            {
                throw;
            }
        }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:68,代码来源:ModuleProvider.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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