本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}