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


C# IResourceService.GetResource方法代码示例

本文整理汇总了C#中IResourceService.GetResource方法的典型用法代码示例。如果您正苦于以下问题:C# IResourceService.GetResource方法的具体用法?C# IResourceService.GetResource怎么用?C# IResourceService.GetResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IResourceService的用法示例。


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

示例1: Licenses

        public Licenses(IResourceService resourceService) {
            string[] licenses;
            using (var stream = resourceService.GetResource("applicenses.applicenses.lst")
                )
            using (var reader = new StreamReader(stream))
                licenses = reader.ReadToEnd().Split(new[] {"\r\n", "\n"}, StringSplitOptions.None);

            var result = "";
            foreach (var resource in licenses) {
                using (var stream = resourceService.GetResource("applicenses." + resource))
                using (var reader = new StreamReader(stream))
                    result = result + reader.ReadToEnd() + "\n\n\n";
            }
            LicenseText = result;
        }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:15,代码来源:Licenses.cs

示例2: GetSymbolFromReference

 private static ISymbolDefinitionBase GetSymbolFromReference(IResourceService resSvc, ISymbolInstanceReference symRef)
 {
     switch(symRef.Type)
     {
         case SymbolInstanceType.Inline:
             return ((ISymbolInstanceReferenceInline)symRef).SymbolDefinition;
         case SymbolInstanceType.Reference:
             return (ISymbolDefinitionBase)resSvc.GetResource(((ISymbolInstanceReferenceLibrary)symRef).ResourceId);
     }
     return null;
 }
开发者ID:kanbang,项目名称:Colt,代码行数:11,代码来源:ThemeCreator.cs

示例3: LocalRuntimeMapLayer

 internal LocalRuntimeMapLayer(LocalRuntimeMap parent, MgLayerBase layer, IResourceService resSvc, bool suppressErrors)
     : base(parent)
 {
     _parent = parent;
     _impl = layer;
     var ldfId = layer.GetLayerDefinition();
     var ldf = (ILayerDefinition)resSvc.GetResource(ldfId.ToString());
     Initialize(ldf, suppressErrors);
     _disableChangeTracking = false;
 }
开发者ID:kanbang,项目名称:Colt,代码行数:10,代码来源:LocalRuntimeMap.cs

示例4: Execute

        public CommandResult Execute(IResourceService iResourceService)
        {
            var result = new CommandResult();
            if(!IsUndo)
            {

                var undo = new UpdateResourceCommand
                                                 {Resource = iResourceService.GetResource(_resource.Id), IsUndo = true};

                var ser = new XmlStringSerializer();

                var serialized = ser.Serialize(undo);

                var suc = new SavedUndoCommand
                {
                    Id = Guid.NewGuid(),
                    CreatedDate = DateTime.Now,
                    SerializedCommand = serialized
                };

                result.UndoCommandId = iResourceService.SaveUndoCommand(suc);

            }

            iResourceService.UpdateResourceCategories(_resource);
            return result;
        }
开发者ID:ctrlShiftBryan,项目名称:TKProto,代码行数:27,代码来源:ResourceController.cs


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