本文整理汇总了C#中INodeFactory类的典型用法代码示例。如果您正苦于以下问题:C# INodeFactory类的具体用法?C# INodeFactory怎么用?C# INodeFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INodeFactory类属于命名空间,在下文中一共展示了INodeFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ConstructContext
/// <summary>
/// Creates a new Construct Context
/// </summary>
/// <param name="g">Graph to construct Triples in</param>
/// <param name="s">Set to construct from</param>
/// <param name="preserveBNodes">Whether Blank Nodes bound to variables should be preserved as-is</param>
/// <remarks>
/// <para>
/// Either the <paramref name="s">Set</paramref> or <paramref name="g">Graph</paramref> parameters may be null if required
/// </para>
/// </remarks>
public ConstructContext(IGraph g, ISet s, bool preserveBNodes)
{
this._g = g;
this._factory = (this._g != null ? (INodeFactory)this._g : _globalFactory.Value);
this._s = s;
this._preserveBNodes = preserveBNodes;
}
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:18,代码来源:ConstructContext.cs
示例2: Node
protected Node(INodeFactory factory)
{
if(factory == null)
throw new ArgumentNullException("factory");
this.Factory = factory;
}
开发者ID:zapov,项目名称:Serialize.Linq,代码行数:7,代码来源:Node.cs
示例3: ReportNodeControl
/// <summary>
/// Constructor to create the instance of the node control.
/// </summary>
/// <param name="parentNodeFactory">Parent node factory for this control.</param>
public ReportNodeControl(INodeFactory parentNodeFactory) : this()
{
if (parentNodeFactory == null)
{
ExceptionManager.Throw(new ArgumentNullException("parentNodeFactory"));
}
_parentNodeFactory = parentNodeFactory;
}
开发者ID:gitter-badger,项目名称:UROCare,代码行数:12,代码来源:ReportNodeControl.cs
示例4: ToNode
public static INode ToNode(this EntityId entityId, INodeFactory factory)
{
if (entityId is BlankId)
{
return factory.CreateBlankNode(entityId.Uri.Authority);
}
return factory.CreateUriNode(entityId.Uri);
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:9,代码来源:EntityIdExtensions.cs
示例5: FolderNode
public FolderNode(IProjectIO projectIO, INodeFactory nodeFactory, string dirpath, bool isRoot = false)
{
_io = projectIO;
_nodeFactory = nodeFactory;
_dirpath = dirpath;
_isRoot = isRoot;
_children.CollectionChanged += OnCollectionChanged;
LoadFilesAndDirectories();
}
开发者ID:nathanial,项目名称:project-structure,代码行数:11,代码来源:FolderNode.cs
示例6: Create
internal static MemberBindingNode Create(INodeFactory factory, MemberBinding memberBinding)
{
MemberBindingNode memberBindingNode = null;
if (memberBinding is MemberAssignment)
memberBindingNode = new MemberAssignmentNode(factory, (MemberAssignment)memberBinding);
else if (memberBinding is MemberListBinding)
memberBindingNode = new MemberListBindingNode(factory, (MemberListBinding)memberBinding);
else if (memberBinding is MemberMemberBinding)
memberBindingNode = new MemberMemberBindingNode(factory, (MemberMemberBinding)memberBinding);
else if (memberBinding != null)
throw new ArgumentException("Unknown member binding of type " + memberBinding.GetType(), "memberBinding");
return memberBindingNode;
}
开发者ID:jonparker,项目名称:Serialize.Linq,代码行数:15,代码来源:MemberBindingNode.cs
示例7: ResolvePath
public override System.Collections.Generic.IEnumerable<INodeFactory> ResolvePath(
PowerShell.Provider.PathNodeProcessors.IContext context, string path)
{
path = context.SessionState.Path.GetUnresolvedProviderPathFromPSPath(path);
var nf = PathCache.Get(path);
if (null != nf)
{
return nf;
}
var driveInfo = GetDriveFromPath(context, path);
if (null == driveInfo)
{
context.WriteWarning(String.Format("Could not determine drive for path [{0}]", path));
return base.ResolvePath(context, path);
}
string fileOrServerPath = Regex.Replace(path, @"^[^::]+::", String.Empty);
var re = new Regex("^.*(" + Regex.Escape(driveInfo.Root) + ")(.*)$", RegexOptions.IgnoreCase);
var matches = re.Match(path);
fileOrServerPath = matches.Groups[1].Value;
path = matches.Groups[2].Value;
if (File.Exists(fileOrServerPath) || Directory.Exists(fileOrServerPath))
{
_root = new BipsFileRootNodeFactory(driveInfo, fileOrServerPath);
}
else
{
_root = new BipsRootNodeFactory(driveInfo);
}
var nodes = base.ResolvePath(context, path);
if (null == nodes || !nodes.Any())
{
return nodes;
}
nodes = nodes.ToList();
PathCache.Add( path, nodes );
return nodes;
}
开发者ID:beefarino,项目名称:bips,代码行数:47,代码来源:PathNodeProcessor.cs
示例8: UnWrapNode
/// <summary>Converts a RomanticWeb's <see cref="Node"/> into dotNetRDF's <see cref="INode"/>.</summary>
public static INode UnWrapNode(this Node node, INodeFactory nodeFactory)
{
if (node.IsUri)
{
return nodeFactory.CreateUriNode(node.Uri);
}
if (node.IsLiteral)
{
if (node.Language != null)
{
return nodeFactory.CreateLiteralNode(node.Literal, node.Language);
}
if (node.DataType != null)
{
return nodeFactory.CreateLiteralNode(node.Literal, node.DataType);
}
return nodeFactory.CreateLiteralNode(node.Literal);
}
return nodeFactory.CreateBlankNode(node.BlankNode);
}
开发者ID:rafalrosochacki,项目名称:RomanticWeb,代码行数:25,代码来源:NodeExtensions.cs
示例9: GetProperty
void GetProperty(string path, INodeFactory factory, Collection<string> providerSpecificPickList)
{
var node = factory.GetNodeValue();
PSObject values = null;
if (null == providerSpecificPickList || 0 == providerSpecificPickList.Count)
{
values = PSObject.AsPSObject(node.Item);
}
else
{
values = new PSObject();
var value = node.Item;
var propDescs = TypeDescriptor.GetProperties(value);
var props = (from PropertyDescriptor prop in propDescs
where (providerSpecificPickList.Contains(prop.Name,
StringComparer.InvariantCultureIgnoreCase))
select prop);
props.ToList().ForEach(p =>
{
var iv = p.GetValue(value);
if (null != iv)
{
values.Properties.Add(new PSNoteProperty(p.Name, p.GetValue(value)));
}
});
}
WritePropertyObject(values, path);
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:30,代码来源:Provider.cs
示例10: InvokeDefaultAction
void InvokeDefaultAction( string path, INodeFactory factory )
{
var invoke = factory as IInvokeItem;
if (null == factory || null == invoke)
{
WriteCmdletNotSupportedAtNodeError(path, ProviderCmdlet.InvokeItem, InvokeItemNotSupportedErrorID);
return;
}
var fullPath = path;
if (!ShouldProcess(fullPath, ProviderCmdlet.InvokeItem))
{
return;
}
path = GetChildName(path);
try
{
var results = invoke.InvokeItem(CreateContext(fullPath), path);
if (null == results)
{
return;
}
// TODO: determine what exactly to return here
// http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCAQFjAA&url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.management.automation.provider.itemcmdletprovider.invokedefaultaction(v%3Dvs.85).aspx&ei=28vLTpyrJ42utwfUo6WYAQ&usg=AFQjCNFto_ye_BBjxxWfzBFGfNxw3eEgTw
// docs tell me to return the item being invoked... but I'm not sure.
// is there any way for the target of the invoke to return data to the runspace??
//results.ToList().ForEach(r => this.WriteObject(r));
}
catch( Exception e )
{
WriteGeneralCmdletError(e, InvokeItemInvokeErrorID, fullPath);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:36,代码来源:Provider.cs
示例11: GetCopyItem
private ICopyItem GetCopyItem(INodeFactory sourceNode)
{
var copyItem = sourceNode as ICopyItem;
if (null == sourceNode || null == copyItem)
{
return null;
}
return copyItem;
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:10,代码来源:Provider.cs
示例12: GetItem
void GetItem( string path, INodeFactory factory )
{
try
{
WritePathNode(path, factory);
}
catch (Exception e)
{
WriteGeneralCmdletError(e, GetItemInvokeErrorID, path);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:11,代码来源:Provider.cs
示例13: PatientNodeControl
/// <summary>
/// Constructor to create the instance of the control.
/// </summary>
/// <param name="nodeFactory">Node factory for the control.</param>
public PatientNodeControl(INodeFactory nodeFactory) : this()
{
_nodeFactory = nodeFactory;
}
开发者ID:gitter-badger,项目名称:UROCare,代码行数:8,代码来源:PatientNodeControl.cs
示例14: SetItem
void SetItem( string path, INodeFactory factory, object value )
{
var @set = factory as ISetItem;
if (null == factory || null == @set)
{
WriteCmdletNotSupportedAtNodeError(path, ProviderCmdlet.SetItem, SetItemNotSupportedErrorID);
return;
}
var fullPath = path;
path = GetChildName(path);
if (!ShouldProcess(fullPath, ProviderCmdlet.SetItem))
{
return;
}
try
{
var result = @set.SetItem(CreateContext(fullPath), path, value);
if (null != result)
{
WritePathNode(fullPath, result);
}
}
catch (Exception e)
{
WriteGeneralCmdletError(e, SetItemInvokeErrorID, fullPath);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:30,代码来源:Provider.cs
示例15: GetChildItems
void GetChildItems(string path, INodeFactory nodeFactory, bool recurse)
{
var context = CreateContext(path, recurse );
var children = nodeFactory.GetNodeChildren(context);
WriteChildItem(path, recurse, children);
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:6,代码来源:Provider.cs
示例16: NewItem
void NewItem( string path, bool isParentPathNodeFactory, INodeFactory factory, string itemTypeName, object newItemValue )
{
var @new = factory as INewItem;
if (null == factory || null == @new)
{
WriteCmdletNotSupportedAtNodeError(path, ProviderCmdlet.NewItem, NewItemNotSupportedErrorID);
return;
}
var fullPath = path;
var parentPath = fullPath;
var child = isParentPathNodeFactory ? GetChildName(path) : null;
if( null != child )
{
parentPath = GetParentPath(fullPath, GetRootPath());
}
if (!ShouldProcess(fullPath, ProviderCmdlet.NewItem))
{
return;
}
try
{
var item = @new.NewItem(CreateContext(fullPath), child, itemTypeName, newItemValue);
PathNode node = item as PathNode;
WritePathNode(parentPath, node);
}
catch (Exception e)
{
WriteGeneralCmdletError(e, NewItemInvokeErrorID, fullPath);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:34,代码来源:Provider.cs
示例17: CopyItem
void CopyItem( string path, INodeFactory sourceNode, string copyPath, bool recurse )
{
ICopyItem copyItem = GetCopyItem(sourceNode);
if (null == copyItem)
{
WriteCmdletNotSupportedAtNodeError(path, ProviderCmdlet.CopyItem, CopyItemNotSupportedErrorID);
return;
}
if (!ShouldProcess(path, ProviderCmdlet.CopyItem ))
{
return;
}
try
{
IPathNode node = DoCopyItem(path, copyPath, recurse, copyItem);
WritePathNode(copyPath, node);
}
catch (Exception e)
{
WriteGeneralCmdletError(e, CopyItemInvokeErrorID, path);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:24,代码来源:Provider.cs
示例18: RemoveItem
void RemoveItem( string path, INodeFactory factory, bool recurse)
{
var remove = factory as IRemoveItem;
if (null == factory || null == remove)
{
WriteCmdletNotSupportedAtNodeError(path, ProviderCmdlet.RemoveItem, RemoveItemNotSupportedErrorID);
return;
}
if (!ShouldProcess(path, ProviderCmdlet.RemoveItem))
{
return;
}
try
{
DoRemoveItem(path, recurse, remove);
}
catch (Exception e)
{
WriteGeneralCmdletError(e, RemoveItemInvokeErrorID, path);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:23,代码来源:Provider.cs
示例19: ClearItem
void ClearItem( string path, INodeFactory factory )
{
var clear = factory as IClearItem;
if (null == factory || null == clear)
{
WriteCmdletNotSupportedAtNodeError(path, ProviderCmdlet.ClearItem, ClearItemNotSupportedErrorID);
return;
}
var fullPath = path;
path = GetChildName(path);
if (!ShouldProcess(fullPath, ProviderCmdlet.ClearItem))
{
return;
}
try
{
clear.ClearItem(CreateContext(fullPath), path);
}
catch (Exception e)
{
WriteGeneralCmdletError(e, ClearItemInvokeErrorID, fullPath);
}
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:26,代码来源:Provider.cs
示例20: WritePathNode
private void WritePathNode(string nodeContainerPath, INodeFactory factory)
{
var value = factory.GetNodeValue();
if (null == value)
{
return;
}
PSObject pso = PSObject.AsPSObject(value.Item);
pso.Properties.Add(new PSNoteProperty(ItemModePropertyName, factory.ItemMode));
WriteItemObject(pso, nodeContainerPath, value.IsCollection);
}
开发者ID:modulexcite,项目名称:EntityShell,代码行数:12,代码来源:Provider.cs
注:本文中的INodeFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论