Click here to Skip to main content
15,885,159 members
Home / Discussions / C#
   

C#

 
GeneralRe: Cron mechanism Pin
johnpierwszy3-Nov-21 23:21
johnpierwszy3-Nov-21 23:21 
GeneralRe: Cron mechanism Pin
OriginalGriff3-Nov-21 23:34
mveOriginalGriff3-Nov-21 23:34 
GeneralRe: Cron mechanism Pin
johnpierwszy4-Nov-21 0:02
johnpierwszy4-Nov-21 0:02 
GeneralRe: Cron mechanism Pin
OriginalGriff4-Nov-21 0:54
mveOriginalGriff4-Nov-21 0:54 
GeneralRe: Cron mechanism Pin
johnpierwszy4-Nov-21 1:09
johnpierwszy4-Nov-21 1:09 
GeneralRe: Cron mechanism Pin
OriginalGriff4-Nov-21 1:59
mveOriginalGriff4-Nov-21 1:59 
GeneralRe: Cron mechanism Pin
johnpierwszy4-Nov-21 6:16
johnpierwszy4-Nov-21 6:16 
Questionmissing a meow ? observations of Net#5 C#9 'record' structures in a VS 2019 WinForm project Pin
BillWoodruff3-Nov-21 11:21
professionalBillWoodruff3-Nov-21 11:21 
For how to enable .NET 5 in VS 2019: [^]. Also, see the weird hack at the end of this post.

Note: the two 'records defined here use positional arguments rather than Property get/set for parameters. that is supposed to confer immutability, and non-destructive mutation (whatever that is). The code below runs without errors.
public record Cat(string Name, int HowHungry);

public record AlleyCat(string Name, int HowHungry, string Color) : Cat(Name, HowHungry);

public void TaleOfTwoCats()
{
    Cat cat1 = new Cat("Bonita gatita", 2);

    AlleyCat alleycat1 = new AlleyCat("Anhela cabezas de pescado", 99, "stale orangina");

    bool iscat1 = cat1 is Cat;
    bool isalleycat1 = cat1 is AlleyCat;

    bool iscat2 = alleycat1 is AlleyCat;
    bool iscat3 = alleycat1 is Cat;

    bool issamecat1 = cat1 == alleycat1;
    bool issamecat2 = cat1.Equals(alleycat1);

    // put breakpoint here ... examine tests above

    cat1 = alleycat1;  // can you predict what happens after this ?

    bool iscat4 = cat1 is Cat;
    bool isalleycat2 = cat1 is AlleyCat;

    bool iscat5 = alleycat1 is AlleyCat;
    bool iscat6 = alleycat1 is Cat;

    bool issamecat3 = cat1 == alleycat1;
    bool issamecat4 = cat1.Equals(alleycat1);

    // put breakpoint here ... examine tests above
}
Note: to make this work in a WinForm 4.8 program, i had to include this:
// see https://stackoverflow.com/a/64749403/133321
// enable C# 5
namespace System.Runtime.CompilerServices
{
    internal static class IsExternalInit { }
}
Weird: there is no reference in the Project to CompilerServices, or top=level using statement invoking it.
«The mind is not a vessel to be filled but a fire to be kindled» Plutarch

QuestionC# regarding running multiple task Pin
Mou_kol1-Nov-21 8:15
Mou_kol1-Nov-21 8:15 
AnswerRe: C# regarding running multiple task Pin
OriginalGriff1-Nov-21 22:49
mveOriginalGriff1-Nov-21 22:49 
AnswerRe: C# regarding running multiple task Pin
lmoelleb1-Nov-21 22:53
lmoelleb1-Nov-21 22:53 
AnswerRe: C# regarding running multiple task Pin
Gerry Schmitz2-Nov-21 7:53
mveGerry Schmitz2-Nov-21 7:53 
QuestionC# reading multiple files by multiple thread issue Pin
Mou_kol1-Nov-21 8:13
Mou_kol1-Nov-21 8:13 
QuestionRe: C# reading multiple files by multiple thread issue Pin
Member 153296131-Nov-21 8:29
Member 153296131-Nov-21 8:29 
AnswerRe: C# reading multiple files by multiple thread issue Pin
Randor 1-Nov-21 15:41
professional Randor 1-Nov-21 15:41 
AnswerRe: C# reading multiple files by multiple thread issue Pin
Gerry Schmitz2-Nov-21 7:53
mveGerry Schmitz2-Nov-21 7:53 
AnswerRe: C# reading multiple files by multiple thread issue Pin
primem0ver4-Nov-21 5:47
primem0ver4-Nov-21 5:47 
QuestionThread Label Updating Pin
Member 1540852926-Oct-21 8:15
Member 1540852926-Oct-21 8:15 
AnswerRe: Thread Label Updating Pin
Gerry Schmitz26-Oct-21 8:36
mveGerry Schmitz26-Oct-21 8:36 
GeneralRe: Thread Label Updating Pin
Member 1540852926-Oct-21 9:17
Member 1540852926-Oct-21 9:17 
AnswerRe: Thread Label Updating Pin
OriginalGriff26-Oct-21 8:59
mveOriginalGriff26-Oct-21 8:59 
GeneralRe: Thread Label Updating Pin
Member 1540852926-Oct-21 9:15
Member 1540852926-Oct-21 9:15 
GeneralRe: Thread Label Updating Pin
OriginalGriff26-Oct-21 22:17
mveOriginalGriff26-Oct-21 22:17 
GeneralRe: Thread Label Updating Pin
Gerry Schmitz28-Oct-21 6:43
mveGerry Schmitz28-Oct-21 6:43 
GeneralRe: Thread Label Updating Pin
OriginalGriff28-Oct-21 20:17
mveOriginalGriff28-Oct-21 20:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.