-
-
Notifications
You must be signed in to change notification settings - Fork 957
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6441c0
commit 693352b
Showing
28 changed files
with
396 additions
and
688 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 37 additions & 37 deletions
74
sources/editor/Stride.Editor.CrashReport/CrashReportData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,54 @@ | ||
using System; | ||
// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp) | ||
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information. | ||
|
||
using System.Text; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
|
||
namespace Stride.Editor.CrashReport; | ||
|
||
namespace Stride.Editor.CrashReport | ||
public class CrashReportData | ||
{ | ||
public class CrashReportData | ||
{ | ||
public List<Tuple<string, string>> Data = new List<Tuple<string, string>>(); | ||
public List<(string, string)> Data = []; | ||
|
||
public string this[string key] | ||
public string this[string key] | ||
{ | ||
get | ||
{ | ||
get | ||
{ | ||
return Data.Where(p => p.Item1 == key).FirstOrDefault(); | ||
} | ||
set | ||
{ | ||
int num = -1; | ||
return Data.FirstOrDefault(p => p.Item1 == key).Item2; | ||
} | ||
set | ||
{ | ||
int num = -1; | ||
|
||
foreach(var current in Data) | ||
{ | ||
if (current.Item1 == key) | ||
{ | ||
num = Data.IndexOf(current); | ||
break; | ||
} | ||
} | ||
if (num != -1) | ||
{ | ||
Data[num] = Tuple.Create<string, string>(key, value); | ||
} | ||
else | ||
foreach(var current in Data) | ||
{ | ||
if (current.Item1 == key) | ||
{ | ||
Data.Add(Tuple.Create<string, string>(key, value)); | ||
num = Data.IndexOf(current); | ||
break; | ||
} | ||
} | ||
if(value == null) | ||
return; | ||
if (num != -1) | ||
{ | ||
Data[num] = (key, value); | ||
} | ||
else | ||
{ | ||
Data.Add((key, value)); | ||
} | ||
} | ||
} | ||
|
||
public override string ToString() | ||
public override string ToString() | ||
{ | ||
StringBuilder val = new(); | ||
foreach (var current in Data) | ||
{ | ||
StringBuilder val = new StringBuilder(); | ||
foreach (var current in Data) | ||
{ | ||
val.Append(String.Concat(current.Item1, ": ", current.Item2, "\r\n")); | ||
} | ||
return val.ToString(); | ||
val.Append(string.Concat(current.Item1, ": ", current.Item2, "\r\n")); | ||
} | ||
return val.ToString(); | ||
} | ||
} |
Oops, something went wrong.