230V
230V
CC#
Created by המשורר on 5/12/2024 in #help
C# array init
//shit happens
85 replies
CC#
Created by המשורר on 5/12/2024 in #help
C# array init
Something like Array.Fill(array, new MyStruct()); too I think
85 replies
CC#
Created by המשורר on 5/12/2024 in #help
C# array init
A loop, an initializer or any other way of initializing elements used later is required here
85 replies
CC#
Created by Ultimate Riser on 2/19/2024 in #help
Msgbox help
if the options from here are not sufficient for you, you'll need to create a Form for this
8 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
I'll consider using serde in future, definitely serialization logic can be sg'd here For now I want to make this work and move on to next things
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
Oh, this works ...but I really wish the <T> wouldn't need to be here, I'll need to validate that T == member return type (I won't, it will be a default one, but I will need to construct a generic type with e.g. int as a type arg 😔)
class ParsableFormattableConverter<T> : IConverter<T> where T : IParsable<T>, IFormattable {}
//[Converter<ParsableFormattableConverter<int>>] int i;
class ParsableFormattableConverter<T> : IConverter<T> where T : IParsable<T>, IFormattable {}
//[Converter<ParsableFormattableConverter<int>>] int i;
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
I'll have to have a bool CanConvert(Type) method somewhere for types that can't be generic
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
There's just no way without some feature like extensions or something that would let me say "whatever implements I1 and I2 is X, and I have class C : IConverter<X>"
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
Wait, no. It uses int explicitly which isn't what I want painmaxima
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
I figured out a workaround, but for some reason I can't use IParsable
interface IConverter<T>{}
class Converter<T, I1, I2> : IConverter<T> where T : I1, I2 {}
class ParsableFormattableConverter : Converter<int, IParsable<int>, IFormattable> {}
interface IConverter<T>{}
class Converter<T, I1, I2> : IConverter<T> where T : I1, I2 {}
class ParsableFormattableConverter : Converter<int, IParsable<int>, IFormattable> {}
- The interface 'IParsable<int>' cannot be used as type argument. Static member 'IParsable<int>.Parse(string, IFormatProvider?)' does not have a most specific implementation in the interface.
- The interface 'IParsable<int>' cannot be used as type argument. Static member 'IParsable<int>.Parse(string, IFormatProvider?)' does not have a most specific implementation in the interface.
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
anyway, the interface problem is still present
33 replies
CC#
Created by tamponlover69 on 5/18/2023 in #help
❔ Way to use PostMessage as mouse click without switching current foreground window
a single computer which supports multiple independent local users at the same time
HmmNoted
8 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
if there isn't a ConverterAttribute specified, I'll search in a list of types for a Converter<T> implementation that can be used - I need to get the T from it and check if T is compatible with the type that will be (de)serialized (this check differs slightly between reference types and value types)
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
I think I'll just not make it trim-compatible
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
yeah, I see that using Type.GenericTypeArguments produces IL2065 Value passed to implicit 'this' parameter of method 'System.Type.GetInterface(String)' can not be statically determined and may not meet 'DynamicallyAccessedMembersAttribute' requirements. no matter what
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
forced to use it
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
this
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
example:
[Keyed, Separator(Field=":", List="|")]
class C
{
[Index(1)]
int I { get; }
[Index(2)]
string[] S { get; }
[Index(3), Separator(List="~")]
char[] C { get; }
}
Console.WriteLine(Serialize(new C { I = 3, S = { "as", "df" }, C = "zxc".ToArray() }));
[Keyed, Separator(Field=":", List="|")]
class C
{
[Index(1)]
int I { get; }
[Index(2)]
string[] S { get; }
[Index(3), Separator(List="~")]
char[] C { get; }
}
Console.WriteLine(Serialize(new C { I = 3, S = { "as", "df" }, C = "zxc".ToArray() }));
1:3:2:as|df:3:z~x~c
33 replies
CC#
Created by 230V on 5/18/2023 in #help
✅ a class implementing a generic interface with more than one interface as one generic type argument
it seems to be a json serializer, I'm making mine for a different format
33 replies