Click here to Skip to main content
15,906,335 members
Home / Discussions / C#
   

C#

 
QuestionHow to save panel content into PDF Pin
RedPandinus19-Dec-20 17:46
RedPandinus19-Dec-20 17:46 
AnswerRe: How to save panel content into PDF Pin
OriginalGriff19-Dec-20 19:57
mveOriginalGriff19-Dec-20 19:57 
SuggestionRe: How to save panel content into PDF Pin
RedPandinus19-Dec-20 20:30
RedPandinus19-Dec-20 20:30 
GeneralRe: How to save panel content into PDF Pin
OriginalGriff19-Dec-20 22:57
mveOriginalGriff19-Dec-20 22:57 
GeneralRe: How to save panel content into PDF Pin
RedPandinus20-Dec-20 6:07
RedPandinus20-Dec-20 6:07 
GeneralAForge Motion Detection from PictureBox? Pin
Herboren19-Dec-20 17:15
Herboren19-Dec-20 17:15 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz19-Dec-20 21:51
mveGerry Schmitz19-Dec-20 21:51 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Herboren20-Dec-20 6:09
Herboren20-Dec-20 6:09 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz20-Dec-20 9:30
mveGerry Schmitz20-Dec-20 9:30 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Herboren20-Dec-20 12:47
Herboren20-Dec-20 12:47 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz21-Dec-20 6:52
mveGerry Schmitz21-Dec-20 6:52 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Herboren21-Dec-20 8:31
Herboren21-Dec-20 8:31 
GeneralRe: AForge Motion Detection from PictureBox? Pin
Gerry Schmitz21-Dec-20 8:57
mveGerry Schmitz21-Dec-20 8:57 
QuestionHow to make connection with SQL Server on another computer? Pin
Alex Dunlop17-Dec-20 9:14
Alex Dunlop17-Dec-20 9:14 
AnswerRe: How to make connection with SQL Server on another computer? Pin
BabyYoda17-Dec-20 9:20
BabyYoda17-Dec-20 9:20 
AnswerRe: How to make connection with SQL Server on another computer? Pin
DerekT-P17-Dec-20 10:16
professionalDerekT-P17-Dec-20 10:16 
QuestionComboBoxItem in another Form Pin
AnissGharib4917-Dec-20 2:09
AnissGharib4917-Dec-20 2:09 
AnswerRe: ComboBoxItem in another Form Pin
Dave Kreskowiak17-Dec-20 3:56
mveDave Kreskowiak17-Dec-20 3:56 
AnswerRe: ComboBoxItem in another Form Pin
OriginalGriff17-Dec-20 4:40
mveOriginalGriff17-Dec-20 4:40 
AnswerRe: ComboBoxItem in another Form Pin
Gerry Schmitz17-Dec-20 4:48
mveGerry Schmitz17-Dec-20 4:48 
AnswerRe: ComboBoxItem in another Form Pin
Herboren18-Dec-20 10:55
Herboren18-Dec-20 10:55 
QuestionBecoming functional: adding Option of T to List when IsSome only Pin
Bernhard Hiller13-Dec-20 22:55
Bernhard Hiller13-Dec-20 22:55 
Eventually I decided to start with the functional concept and installed the LanguageExt library (see GitHub - louthy/language-ext: C# functional language extensions - a base class library for functional programming[^] ). In our code base, there is a class which is full of bool TryGet(some parameters, out T result) functions - I want to change them to Option<T> TryGet(some parameters).

But then, things start to look ugly at a different level. E.g.
List<PointF> result = new List<PointF>();
...
foreach (IIntersectionInfo intersection in intersections)
{
    Option<PointF> angle = m_Geometry.TryGetAnglesForPosition(intersectionPoint, _name);
    if (angle.IsNone)
    {
        Logger.LogWarning(Name, $"Cannot determine angle for position '{intersectionPoint}' corresponding to pixel '{pixel}'.");
    }
    else
    {
        result.Add(angle.IfNone(PointF.Empty));
    }
}
There are two kinds of ugliness:
- I have to use the IfNone(PointF.Empty) clause even when angle is guaranteed to be Some there.
- I do not know how to get rid of the foreach in this situation.

How can the code become clean?
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!

AnswerRe: Becoming functional: adding Option of T to List when IsSome only Pin
Richard Deeming14-Dec-20 0:41
mveRichard Deeming14-Dec-20 0:41 
GeneralRe: Becoming functional: adding Option of T to List when IsSome only Pin
Bernhard Hiller14-Dec-20 2:40
Bernhard Hiller14-Dec-20 2:40 
Questionc# programing Pin
toori shabab9-Dec-20 3:50
toori shabab9-Dec-20 3:50 

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.