本文整理汇总了C#中System.Collections.SortedSet.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SortedSet.ToString方法的具体用法?C# SortedSet.ToString怎么用?C# SortedSet.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.SortedSet
的用法示例。
在下文中一共展示了SortedSet.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
var stackOfValues = new Stack<string>();
GetInitialValuesFromArgs(args, ref stackOfValues);
var demoSet1 = new Set<string>(stackOfValues.ToArray());
Console.WriteLine(demoSet1.ToString());
var demoSet3 = new SortedSet(stackOfValues.ToArray());
Console.WriteLine(demoSet3.ToString());
Console.ReadKey();
}
示例2: IntegrateGamesFromVdf
/// <summary>
/// Loads in games from a VDF node containing a list of games.
/// Any games in the node not found in the game list will be added to the gamelist.
/// If a game in the node has a tags subnode, the "favorite" field will be overwritten.
/// If a game in the node has a category set, it will overwrite any categories in the gamelist.
/// If a game in the node does NOT have a category set, the category in the gamelist will NOT be cleared.
/// </summary>
/// <param name="appsNode">Node containing the game nodes</param>
/// <param name="ignore">Set of games to ignore</param>
/// <returns>Number of games loaded</returns>
private int IntegrateGamesFromVdf( VdfFileNode appsNode, SortedSet<int> ignore, bool ignoreDlc )
{
int loadedGames = 0;
Dictionary<string, VdfFileNode> gameNodeArray = appsNode.NodeArray;
if( gameNodeArray != null ) {
foreach( KeyValuePair<string, VdfFileNode> gameNodePair in gameNodeArray ) {
int gameId;
if( int.TryParse( gameNodePair.Key, out gameId ) ) {
if( ( ignore != null && ignore.Contains( gameId ) ) || ( ignoreDlc && Program.GameDB.IsDlc( gameId ) ) ) {
Program.Logger.Write( LoggerLevel.Verbose, GlobalStrings.GameData_SkippedProcessingGame, gameId );
continue;
}
if( gameNodePair.Value != null && gameNodePair.Value.ContainsKey( "tags" ) ) {
SortedSet<Category> cats = new SortedSet<Category>();
loadedGames++;
VdfFileNode tagsNode = gameNodePair.Value["tags"];
Dictionary<string, VdfFileNode> tagArray = tagsNode.NodeArray;
if( tagArray != null ) {
foreach( VdfFileNode tag in tagArray.Values ) {
string tagName = tag.NodeString;
if( tagName != null ) {
Category c = GetCategory( tagName );
if( c != null ) cats.Add( c );
}
}
}
bool hidden = false;
if( gameNodePair.Value.ContainsKey( "hidden" ) ) {
VdfFileNode hiddenNode = gameNodePair.Value["hidden"];
hidden = ( hiddenNode.NodeString == "1" || hiddenNode.NodeInt == 1 );
}
// Add the game to the list if it doesn't exist already
if( !Games.ContainsKey( gameId ) ) {
GameInfo newGame = new GameInfo( gameId, string.Empty );
Games.Add( gameId, newGame );
newGame.Name = Program.GameDB.GetName( gameId );
Program.Logger.Write( LoggerLevel.Verbose, GlobalStrings.GameData_AddedNewGame, gameId, newGame.Name );
}
if( cats.Count > 0 ) {
this.SetGameCategories( gameId, cats, false );
}
Games[gameId].Hidden = hidden;
//TODO: Don't think SortedSet.ToString() does what I hope
Program.Logger.Write( LoggerLevel.Verbose, GlobalStrings.GameData_ProcessedGame, gameId, ( cats.Count == 0 ) ? "~" : cats.ToString() );
}
}
}
}
return loadedGames;
}