本文整理汇总了C#中ReturnContainers类的典型用法代码示例。如果您正苦于以下问题:C# ReturnContainers类的具体用法?C# ReturnContainers怎么用?C# ReturnContainers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReturnContainers类属于命名空间,在下文中一共展示了ReturnContainers类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetChildNames
protected virtual void GetChildNames(string path, ReturnContainers returnContainers)
{
using (PSTransactionManager.GetEngineProtectionScope())
{
throw PSTraceSource.NewNotSupportedException("SessionStateStrings", "CmdletProvider_NotSupported", new object[0]);
}
}
示例2: GetNames
public Collection<string> GetNames(string[] path, ReturnContainers returnContainers, bool recurse, bool force,
bool literalPath)
{
var runtime = new ProviderRuntime(SessionState, force, literalPath);
GetNames(path, returnContainers, recurse, runtime);
var packedResults = runtime.ThrowFirstErrorOrReturnResults();
var results = (from r in packedResults select r.ToString()).ToList();
return new Collection<string>(results);
}
示例3: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
if (PathIsDrive(path))
{
foreach (var repository in gitConfigManager.GetTrackedRepositories())
{
WriteItemObject(repository.Name, path, true);
}
return;
}
var trackedRepository = gitConfigManager.GetTrackedRepository(path);
if (trackedRepository != null)
{
WriteItemObject("Git repo", path, false);
}
}
示例4: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
using (new CurrentContextSession(this))
{
var children = GetChildNodesOfPath(path);
if (String.IsNullOrEmpty(path))
{
path = "/";
}
foreach (var child in children)
{
WriteItemObject(child.Name, path, child.GetNodeChildren().Any());
}
}
}
示例5: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
path = NormalizePath(path);
if (path.Length == 0)
{
foreach (var key in GetFilteredItems().Keys)
{
WriteItemObject(key, key, false);
}
return;
}
if (ItemExists(path))
{
WriteItemObject(path, path, false);
}
}
示例6: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
path = NormalizePath(path);
// check for a named child
if (path.Length > 0)
{
object item = GetSessionStateItem(path);
if (item != null)
{
WriteItemObject(path, path, false);
}
return;
}
// otherwise names of all children
IDictionary sessionStateTable = GetSessionStateTable();
foreach (DictionaryEntry entry in sessionStateTable)
{
var name = (string)entry.Key;
WriteItemObject(name, name, false);
}
}
示例7: GetChildNames
//internal object GetChildItemsDynamicParameters(Path path, bool recurse, CmdletProviderContext context);
internal void GetChildNames(Path path, ReturnContainers returnContainers, ProviderRuntime runtime)
{
ProviderRuntime = runtime;
GetChildNames(path, returnContainers);
}
示例8: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
if (TransactionAvailable())
{
using (CurrentPSTransaction)
{
base.GetChildNames(path, returnContainers);
return;
}
}
base.GetChildNames(path, returnContainers);
}
示例9: GetChildNames
/// <summary>
/// Gets names of the children of the specified path.
/// </summary>
///
/// <param name="path">
/// The path to the item from which to retrieve the child names.
/// </param>
///
/// <param name="returnAllContainers">
/// If true, the provider should return all containers, even if they
/// don't match the filter. If false, the provider should only return
/// containers that do match the filter.
/// </param>
///
/// <remarks>
/// Providers override this method to give the user access to the
/// provider objects using the get-childitem -name cmdlet.
///
/// Providers that declare
/// <see cref="System.Management.Automation.Provider.ProviderCapabilities"/>
/// of ExpandWildcards, Filter, Include, or Exclude should ensure that
/// the path passed meets those requirements by accessing the
/// appropriate property from the base class. The exception to this is
/// if <paramref name="returnAllContainers"/> is true, then any child
/// name for a container should be returned even if it doesn't match
/// the Filter, Include, or Exclude.
///
/// By default overrides of this method should not write the names of
/// objects that are generally hidden from the user unless the Force
/// property is set to true. For instance, the FileSystem provider
/// should not call WriteItemObject for hidden or system files unless
/// the Force property is set to true.
///
/// The provider implementation is responsible for preventing infinite
/// recursion when there are circular links and the like. An
/// appropriate terminating exception should be thrown if this
/// situation occurs.
///
/// The child names are the leaf portion of the path. Example, for the
/// file system the name for the path c:\windows\system32\foo.dll would
/// be foo.dll or for the directory c:\windows\system32 would be
/// system32. For Active Directory the child names would be RDN values
/// of the child objects of the container.
///
/// All names should be written to the WriteItemObject method.
/// </remarks>
protected override void GetChildNames( string path,
ReturnContainers returnAllContainers )
{
// Get the names of children at the specified path
// and writing them
// WriteItemObject( item, path, isContainer );
}
示例10: GetChildNames
} // GetChildItems
/// <summary>
/// Return the names of all child items.
/// </summary>
/// <param name="path">The root path.</param>
/// <param name="returnContainers">Not used.</param>
protected override void GetChildNames(string path,
ReturnContainers returnContainers)
{
// If the path represented is a drive, then the child items are
// tables. get the names of all the tables in the drive.
if (PathIsDrive(path))
{
foreach (DatabaseTableInfo table in GetTables())
{
WriteItemObject(table.Name, path, true);
} // foreach (DatabaseTableInfo...
} // if (PathIsDrive...
else
{
// Get type, table name and row number from path specified
string tableName;
int rowNumber;
PathType type = GetNamesFromPath(path, out tableName, out rowNumber);
if (type == PathType.Table)
{
// Get all the rows in the table and then write out the
// row numbers.
foreach (DatabaseRowInfo row in GetRows(tableName))
{
WriteItemObject(row.RowNumber, path, false);
} // foreach (DatabaseRowInfo...
}
else if (type == PathType.Row)
{
// In this case the user has directly specified a row, hence
// just give that particular row
DatabaseRowInfo row = GetRow(tableName, rowNumber);
WriteItemObject(row.RowNumber, path, false);
}
else
{
ThrowTerminatingInvalidPathException(path);
}
} // else
} // GetChildNames
示例11: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
base.GetChildNames(path, returnContainers);
}
示例12: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
var nodeFactory = GetNodeFactoryFromPath(path, false);
if (null == nodeFactory)
{
return;
}
nodeFactory.ToList().ForEach(f => GetChildNames(path, f, returnContainers));
}
示例13: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
GetPathItems(path, false, true, returnContainers);
}
示例14: GetNames
public Collection<string> GetNames(string[] path, ReturnContainers returnContainers, bool recurse, bool force, bool literalPath)
{
return this.sessionState.GetChildNames(path, returnContainers, recurse, force, literalPath);
}
示例15: GetChildNames
protected override void GetChildNames(string path, ReturnContainers returnContainers)
{
foreach (var subItem in this.ZookeeperDriver.Zookeeper.GetChildren(path))
{
this.WriteNodeName( path, subItem );
}
}