Skip to content

Instantly share code, notes, and snippets.

View MartinZikmund's full-sized avatar
⌨️
Coding

Martin Zikmund MartinZikmund

⌨️
Coding
View GitHub Profile
var attributeData = typeof(TestClass).GetCustomAttributesData();
using System.Reflection;
var attributeData = CustomAttributeData.GetCustomAttributes(typeof(TestClass))[0];
Console.WriteLine(attributeData.AttributeType == typeof(TestAttribute)); // true
Console.WriteLine(attributeData.ConstructorArguments[0].Value); // "Hello World"
[Test("Hello, world!")]
public class TestClass
{
}
using Uno.Wasm.Bootstrap.Server;
...
app.UseAuthentication();
app.UseAuthorization();
app.UseUnoFrameworkFiles();
app.MapFallbackToFile("index.html");
if (gamepad.Buttons.HasFlag(GamepadButtons.A))
{
// The A button on the Gamepad is pressed.
}
var reading = Gamepad.GetCurrentReading();
Buttons = reading.Buttons;
RightThumbstickX = reading.RightThumbstickX;
RightThumbstickY = reading.RightThumbstickY;
LeftThumbstickX = reading.LeftThumbstickX;
LeftThumbstickY = reading.LeftThumbstickY;
LeftTrigger = reading.LeftTrigger;
RightTrigger = reading.RightTrigger;
Timestamp = reading.Timestamp;
Gamepad.GamepadAdded += GamepadAdded;
Gamepad.GamepadRemoved += GamepadRemoved;
private void GamepadAdded(object sender, Gamepad gamepad)
{
Debug.WriteLine("A gamepad was connected");
}
private void GamepadRemoved(object sender, Gamepad gamepad)
{
var UnoAppManifest = {
splashScreenImage: "Assets/SplashScreen.png",
splashScreenColor: "transparent",
displayName: "Theme-aware splash screen",
darkThemeBackgroundColor: "blue",
lightThemeBackgroundColor: "yellow",
}
var UnoAppManifest = {
splashScreenImage: "Assets/SplashScreen.png",
splashScreenColor: "transparent",
displayName: "Theme-aware splash screen"
}
for (int i = 0; i < 10000; i++)
{
new Button();
}
GC.Collect();
GC.WaitForPendingFinalizers();
var s="var s={0}{1}{0};Write(s,(char)34,s);";Write(s,(char)34,s);