Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick PatrickRainer

View GitHub Profile
@PatrickRainer
PatrickRainer / ThrowingObject.cs
Created Oct 28, 2022
Shows a throwing Object in Godot without RB
View ThrowingObject.cs
using Godot;
public class ThrowingObject : Area2D
{
[Export()]float _throwDistance = 400;
[Export()]float _throwHeight = 400f;
Vector2 _startPos;
Vector2 _endPos;
float _radius;
View IterateThroughPropertiesWithReflection.cs
var properties = typeof(Phrase).GetProperties();
foreach (var prop in properties)
{
Console.Write(prop.GetValue(document) + " | ");
}
View BindEnumToComboBoxWpf.cs
public IEnumerable<LicenseType> LicenseTypes =>
Enum.GetValues(typeof(LicenseType))
.Cast<LicenseType>();
public LicenseType SelectedLicenseType
{
get => _selectedLicenseType;
set
{
_selectedLicenseType = value;
View MinimalContainer.cs
public class MinimalContainer
{
private readonly Dictionary&lt;Type, Type&gt; types = new Dictionary&lt;Type, Type&gt;();
public void Register&lt;TInterface, TImplementation&gt;() where TImplementation : TInterface
{
types[typeof(TInterface)] = typeof(TImplementation);
}
public TInterface Create()
View DatePickerConverter.cs
using System;
using System.Globalization;
using Xamarin.Forms;
namespace Av_Planner_Demo.Controls.Converters
{
public class DatePickerConverter : IValueConverter
{
DateTime _timePickerDate;