Questions tagged as 'c#'

1
answer

Using Data Annotations to validate fields in an HTML page and Web API

Someone has an example of how to create a field validation on an HTML page using Data Annotation, Web API and C #. In MVC with you, this is easily accomplished by using Wizard when creating a View.     
asked by 16.12.2014 / 19:51
1
answer

Know if a file is locked or not

How do I know if a file is locked or not? I have improved this code and would like to know if you are correct or better. Another question is if it is corrupted, is the verification below valid? public bool IsFileLocked(FileInfo file) { Fil...
asked by 05.11.2014 / 18:45
2
answers

Query by Linq and Lambda getting range of options by sub-query. How to get a result closer to the simple?

Given the following classes: MenuRaiz : public class MenuRaiz { public MenuRaiz() { Menus = new List<Menu>(); } [Key] [DatabaseGenerated(DatabaseGeneratedOption.None)] public int Id { get; set; }...
asked by 22.10.2014 / 14:45
1
answer

How to communicate a local application with a web page opened in the browser?

I have a commercial web application that runs basic operations of a restaurant. In short, a waiter accesses the 'orders' page and requests a new 'product'. These products are categorized by departments, and each department has a printer (thermal...
asked by 29.10.2014 / 17:14
1
answer

Parallel Processing Routine C #

I would like to start a data-handling method whenever I receive a String with START content through the Transceiver.ReceiveLineEventHandler () event; however this method will have a processing time because there will be timeout among other resou...
asked by 25.07.2016 / 20:35
1
answer

Unity 5 Delay in animation

I just created the animation to run and jump with unity, but I have a problem when the player returns to IdlePlayer's initial state, when I stop running or jump it continues for another 1 second, I've already tried decrease the frames but nothin...
asked by 15.06.2015 / 22:48
1
answer

c #: using threads in a "windows forms" project

In my application I have several "subprocesses". All of them issue information in which they are displayed on the Form. I used System.Windows.Forms.Timer : Class x { public Timer timer {get; set;} public void f() {...
asked by 17.06.2015 / 01:21
2
answers

Global exception handling with Web API 2

I want to use Global Error Handling with WebAPI 2. I created a new project, inside it I created the following class: ErrorLogTest.cs using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Sys...
asked by 31.05.2015 / 22:35
1
answer

Edit field within a list in ASP.NET MVC

Well, I'm developing an application that manages Courses , and I'm trying to list where the Courses displays, the Student Name > and the Approved field, where it indicates whether it is approved or not, and on this screen I have to be abl...
asked by 14.06.2015 / 06:12
1
answer

PDF formatting

I would like to format the sizes of your cells and your text for PDF export. protectedvoidExportPDF(){intcolCount=_gvConsultaRelatorio.Columns.Count-1;PdfPTabletable=newPdfPTable(colCount);table.HorizontalAlignment=0;int[]colWidths=newint[_gv...
asked by 02.06.2015 / 20:03