Questions tagged as 'c#'

1
answer

Report progress for interface of an asynchronous method in C #

I have a Windows Forms application. This application will run some processes that take a while to run, so I would like to run them in parallel. Here's a little of what I'm trying to implement. In the form constructor, I create a generi...
asked by 09.09.2014 / 19:53
1
answer

Format date and time and list according to the current date

This application has two tables: Students and Occurrences. To show the occurrences I can calmly ... But now I have a new business rule: Show the occurrences by date. So basically it would be the following, I would have to show the most current o...
asked by 12.08.2014 / 16:47
1
answer

Time difference in Linq

I'm using Entity Framework, and I have a condition that has not worked very well: .Where(x => ((DateTime.Now - (x.DataInicio.Value == null ? DateTime.Now : x.DataInicio.Value)).TotalMinutes) < x.Item.MinutosMaximo) Types : x.D...
asked by 27.10.2015 / 12:45
1
answer

Why can not I display the MessageBoxButtons if it is not a string?

Why am I not able to display MessageBoxButtons if it is not a string? static void Main() { string texto = "Minha primeira MessageBox"; MessageBoxButtons botao = MessageBoxButtons.OKCancel; DialogResult result; result = M...
asked by 20.11.2015 / 01:15
1
answer

How does Unity use C # on Android?

Recently I started to get interested in game development (initially for the Android platform) and that's why I met the engine Unity. I've never programmed in Java, native language of Android. However I know the C # language. When I read mor...
asked by 21.11.2017 / 13:36
3
answers

Run Python and C # together

How can I in C # import, that is, execute some script in another language (Python)? Example: If you write "R" in a program in C #, it executes a file named ApertouR.py .     
asked by 27.12.2017 / 13:59
2
answers

Managing and releasing memory

1) When I create an object, where it has arrays and large variables, setting them to null , will it help with the reduction? Within a method Dispose() - being that before they were with some value. 2) When I call a Dispose()...
asked by 02.12.2017 / 02:13
1
answer

Shuffling playing cards

I need to make a kind of "Mini-Pife", but I can not create the method to shuffle the cards, can anyone help me? public class Baralho { public Carta[] Cartas { get; private set; } public Baralho() { this.Cartas = new Carta[...
asked by 07.12.2017 / 18:00
2
answers

Get previous element in foreach

Is it possible to take an element from the previous position to the current position using the foreach loop? For example, whenever I need to pick up an element earlier than the current loop position, I use the for loop as follow...
asked by 24.01.2018 / 14:47
1
answer

Pass arguments to the property getter

VB.NET allows you to declare parameters in the property getter Public ReadOnly Property Propriedade(param As String) As String Get Return param & "!" End Get End Property It's a strange feature and in C # it does not work. What...
asked by 26.10.2017 / 20:04