本文整理汇总了C#中IGraph.GetUriNode方法的典型用法代码示例。如果您正苦于以下问题:C# IGraph.GetUriNode方法的具体用法?C# IGraph.GetUriNode怎么用?C# IGraph.GetUriNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IGraph
的用法示例。
在下文中一共展示了IGraph.GetUriNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetConfigurationObject
public static object GetConfigurationObject(IGraph configurationGraph, string id)
{
#if PORTABLE
// Bug in portable class library - if id is a fragment identifier the URI is not combined correctly
Uri targetUri = id.StartsWith("#") ? new Uri(configurationGraph.BaseUri + id) : new Uri(configurationGraph.BaseUri, id);
#else
var targetUri = new Uri(configurationGraph.BaseUri, id);
#endif
var configNode = configurationGraph.GetUriNode(targetUri);
return configNode == null ? null : ConfigurationLoader.LoadObject(configurationGraph, configNode);
}
示例2: FindObject
/// <summary>
/// Finds whether there is any Handler Configuration for a wildcard path that the current request path matches
/// </summary>
/// <param name="g">Configuration Graph</param>
/// <param name="requestUri">Request URI</param>
/// <param name="matchedPath">The resulting matched path</param>
/// <returns></returns>
public static INode FindObject(IGraph g, Uri requestUri, out String matchedPath)
{
int pathSegments = requestUri.Segments.Length;
for (int s = pathSegments; s > -1; s--)
{
String path = String.Join(String.Empty, requestUri.Segments, 0, s) + "*";
String objUri = "dotnetrdf:" + path;
INode temp = g.GetUriNode(UriFactory.Create(objUri));
if (temp != null)
{
matchedPath = path;
return temp;
}
}
matchedPath = null;
return null;
}
示例3: GetConfigurationObject
public static object GetConfigurationObject(IGraph configurationGraph, string id)
{
var configNode = configurationGraph.GetUriNode(new Uri(configurationGraph.BaseUri, id));
return configNode == null ? null : ConfigurationLoader.LoadObject(configurationGraph, configNode);
}