C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

learn more… | top users | synonyms

1
vote
1answer
39 views

What does “Stateful” means in Stateful ViewModel in MVVM

I was reading about some XAML patterns, and there was the Stateful ViewModel, according to what I read it has nothing different than what we as just the "ViewModel". Here's a description for example ...
-3
votes
0answers
21 views

C# Thread Abort hanging in .NET 4.0 but not in .NET 3.5 [on hold]

In VS2013, C#, in Win8, this simple line of code thrListener.Abort(); was just fine in .NET 3.5 but now just hangs indefinitely in .NET 4.0. (I'm a beginner when it comes to multithreading.) I can ...
-3
votes
0answers
15 views

TreeView Selection [on hold]

I am using a Server Side TreeView Control. I want to get the values after the selection of the items present in the treeview. Actually I can't able to differentiate between the selected items that ...
2
votes
2answers
55 views

Sharing info objects between objects?

I'm making a game and I have several cards that are created during the game. Each card needs some info, which is shared between cards of the same type. So I have a class CardInfo, which holds a name ...
1
vote
1answer
43 views

Down Sides to Using Properties as Opposed to Method Variables [on hold]

I am debating the pros and cons of a couple of utility classes I have. The classes have a couple of properties which are set prior to calling the class methods. However, I was wondering if there are ...
-3
votes
1answer
34 views

Is it possible to use C and C sharp together? [on hold]

I have tried reshearching this question but couldnt find ant luck. Is it possible to start a project using C Sharp and C together?
0
votes
1answer
52 views

How can I avoid an SDK requirement for an end-user unless he uses a specific function? C#

One of the modes of my program uses Microsoft Kinect but the user may never decide use that mode. I want to make it so the libraries for that functionality are only looked for and loaded if he uses ...
0
votes
0answers
48 views

what are the most important coding standards in c# [on hold]

I am a college student creating a C# program for the 3rd year project. In my project coding standard is a main concern. But I do not have a better understanding about C# coding standards to follow ...
0
votes
1answer
69 views

C#/.NET multithreaded application design

The application to be designed serves as a bridge between two different systems. One natively speaks TCP (RS232 actually, but there's a COM->ETH server in the line of communication) - the other one is ...
9
votes
3answers
938 views

How to monitor a long-running program programmatically

What I've currently got can be summed up with this pseudo code: public static void Main(string[] args) { var listOfObjects = Database.GetObjectsToUploadToOnlineService(); ...
0
votes
0answers
69 views

C# async method on Windows Phone 8.1 (Nokia Lumia 920)

I am trying to better understand Windows Phone 8.1 app development and thought it might be smart to start with a sensor application. So, using examples from around the web, I was able to figure out ...
2
votes
1answer
107 views

Alternatives to #if when polymorphism doesn't seem possible

There are couple of places where #if seems to give you abilities that polymorphism doesn't: Conditionally specifying base class When a section contains code that is not recognised by a compiler on ...
-1
votes
0answers
22 views

Passing Textbox value to Crystal Report Parameter c# [migrated]

Could someone please help with my problem. I already have the codes for this but I can't seem to combine the two. Legend: dt1 = Dataset; crpt = Crystal Report File This is my code for loading the ...
-1
votes
0answers
56 views

Relationship between .NET for Linux and Mono [on hold]

Microsoft announced last year that .NET will be open sourced. How does this impact the relationship between Mono and .NET for Linux. Will .NET Linux supersede Mono or will parts of of Mono go into ...
2
votes
2answers
138 views

How/when to “build” a Singleton that stores configuration data

I am a junior developer (think "intern-level" experience) working at a small shop more or less alone on a project that consumes data from a database, processes it, and inserts the results into another ...
-2
votes
0answers
20 views

Can anyone tell me what will be the better for Http proxy [closed]

I have assignment based on computer networks I have to design a Http Proxy Server but I am confused that whether I should build it on java or C#. Please guide me and also explain why it is good ...
1
vote
1answer
144 views

Generics in C# Test Class

I'm learning about unit testing in C#. Languages_Service and PlaceOfWork_Service are classes for SOAP services which Microsoft Navision generated for me. There are several methods that are very ...
0
votes
1answer
70 views

Using C#-MSSQL for smartphone apps cloud back-end with large user-base? [closed]

We are going to develop a Smartphone application (Will be cross-platform in the long-term with Android,Windows and iOS front-ends) with a expected users around 500 thousands. We need a cloud back-end ...
1
vote
0answers
135 views

Dependency injection, but not into a controller [migrated]

I recently began experimenting with DI. I am using Unity Ioc to inject an EmailService from by Business Logic Layer into EmailServiceWrapper in the presentation layer which is then instantiated, my ...
-1
votes
1answer
49 views

Any library or dll to use to give a free lancers project from clients who accept your work but not pay [closed]

I've been thinking about getting into the free lance field (using sites like guru.com or freelance.com). Something I see in the FAQ's is that there's been numerous instances where the client got an ...
-1
votes
1answer
44 views

MVC Best practices: Do error message modals need a controller method? [on hold]

I am creating a ASP.NET MVC C# application were I have a modal where that takes a value and then if the value is wrong another modal would pop up displaying an error message with an "Ok" button that ...
-3
votes
0answers
29 views

transfer data from android device to pc via Bluetooth [closed]

I`m beginner in android developing , and i want to make an app on android mobile to send simultaneously words from this app to c# program that ready to receive from the app via Bluetooth . Also , I ...
1
vote
1answer
89 views

Excel worksheet population and fomatting is slow

I have written a VSTO plugin in C# which populates several worksheets. During the population process cell values or formula are added one at a time according to user-definable criteria taken from a ...
0
votes
0answers
28 views

Creating Dynamic Odata Feeds at runtime, c# [closed]

EDIT I need a dynamic odata service to which I can pass a sql query and have it return the related fields, without the use of entity framework. Obviously security is a must so I would implement some ...
1
vote
0answers
54 views

Partially Fulfilled Specification Pattern

We have a model (IPayableModel) with a boolean property indicating that a user may or may not pay for the item. A set of specifications defining criteria that would disqualify the model from payment ...
-1
votes
1answer
54 views

How to upload a C# project to Github without visual studio [closed]

I would like to know How to upload a C# project to Github without visual studio? What do i need and how would I do it?
0
votes
0answers
33 views

Using xsd2Code and custom c# classes

I am using the xsd2code class generator to generate classes based on a schema file provided by a system vendor. This vendor also provides a REST API to access data via Web Services, and I've had a ...
-3
votes
2answers
121 views

Confusion about Constructors and properties [closed]

So im doing a project with a guy and I see in His code something like this: public class Foo() { private string example; public String Example { { get; set; } } public ...
1
vote
2answers
87 views

To convert to accurate data types or maintain default type of string

Scenario: I have a web application that records and checks data against two temp tables (1 table being a temp source and the other being a destination for the application). These temp tables are ...
1
vote
2answers
135 views

How do I do SQL Server mapping with a new Desktop application written in C#? [closed]

In 2 weeks I will be starting a new job as a software developer in a company that currently does not employ any professional programmers. My first task will be to rewrite a Excel/VBA application in ...
2
votes
1answer
47 views

Two way communication between Form and plugins

I have started to develop a support tool for an old legacy system that is no longer maintained but still needed for the foreseeable future. The legacy system offers few, clunky and error prone methods ...
0
votes
2answers
80 views

Handling Business Logic/Validation Race Conditions

I'm working on a Training Enrollment web application with the following (simplified) features: Maintenance (Add, Edit, Deactivation) of Trainings Student sign-up Student enrollment to Active ...
156
votes
9answers
11k views

Why do many exception messages not contain useful details?

It seems there is a certain amount of agreement that exception messages should contain useful details. Why is it that many common exceptions from system components do not contain useful details? A ...
1
vote
1answer
91 views

Under what cirumstances would type 'System.Object' qualify for serialization?

I'm in charge of a comprehensive serialization format with support to serialize runtime objects (any derived type of Object). I can't find a sane scenario where one would choose to serialize an ...
-1
votes
1answer
113 views

override resolution behavior in c#

I tried the following piece of code public abstract class Entry3 { public abstract void Method1(); public virtual void Method2() { Console.WriteLine("Entry3.Method2"); } } public abstract ...
2
votes
1answer
86 views

Ambiguity of seemingly clear method names in APIs

(The question is language-agnostic, but to illustrate the point, I wrote the examples in C#.) Say I'm trying to model the behavior of "components" that communicate via "ports". I might model this ...
1
vote
1answer
87 views

Clarification on MVC Architecture Overview

I'm doing an MVC 4 architecture diagram for a report and since I'm relatively new to MVC,i was wondering could some one clarify with me is REST (HTTPPOST etc) between view and controller, or ...
-2
votes
1answer
54 views

pass a variable as parameter to constructor c# [closed]

pass a variable as parameter to constructor as i want to change the variable value with changeable value i'm new to c# so that i tries to implement one thing in many way i did what i want to do with ...
1
vote
1answer
37 views

Databinding When View Differs From Model

I have an entity Customer. Customer has a collection of Accounts. I have corresponding classes. The Customer class has-a List<Accounts>. I have two views. First page shows the Customer's name, ...
0
votes
0answers
55 views

Matching groups of similar lines on a generic matching algorithm

I have to write a program to search through a file containing lines and find lines that match to a degree of tolerance but are not necessarily the same. So for example the following lines would match: ...
3
votes
2answers
138 views

How do you find out what resources are unmanaged?

Looking through the .NET documentation, specifically the WebRequest class, I don't see any information indicating that I should wrap an instantiation of it in a using statement. Even the provided ...
0
votes
0answers
46 views

DDD using an ORM and a Active Directory Server for Persistence

With Domain Driven Design one would model out the domain. One would then use an ORM of some sort to take care of the persistence. Say you have a Product entity which has a Name, SKU and an Owner. This ...
10
votes
4answers
3k views

Should one use Dependency Injection even if the class is used only once? [duplicate]

During a code review I have started having a bit of a dilemma as to whether use dependency injection or not. I would like to hear your thoughts, because this is kind of an ongoing theme and would help ...
2
votes
2answers
136 views

Unit testing and reusing extracted class

Currently I have 3 service classes, they all have a similar pattern, and I need to make a 4th service class which amalgamates the functionality of the other three. Current three classes public class ...
0
votes
1answer
115 views

What's the point/Use of writing out just the method signatures for an API in .Net Web Api

I have been asked to write the signatures for and API end points GET/POST/PUT methods. I'm having a hard time wrapping my head around what the point of this is. My co-worker asked if I could do this ...
0
votes
1answer
146 views

C# Constructor and private LINQ to SQL members

I am extending an application I have developed so that it is more broadly useful for multiple jobs, rather than the single job I created it for. There are a number of tables that I get from SQL ...
24
votes
3answers
3k views

How much work should I place inside a lock statement?

I am a junior developer working on writing an update for software that receives data from a third-party solution, stores it in a database, and then conditions the data for use by another third-party ...
-2
votes
0answers
7 views

AForge Blobcounter problem -how to count splitted objects? [migrated]

I have a problem with counting small objects on the image. In example I used BlobCounter class (from AForge framework). But it doesnt recognize splitted objects. Here is the function output Here is ...
2
votes
2answers
177 views

Designing entities that should be mutable through the GUI but protected from programmer error

I have a set of entities, for now represented by very simple classes (further simplified for this example): public class Item { public string Name { get; private set; } public double ...
1
vote
1answer
95 views

C#/MonoGame - Programming enemies and levels in external script files

I'm writing a little game using C# MonoGame and I have idea of scripting enemies in external script files (not necessarily in C#, maybe in lua?). So for example I have class Enemy in C#. And I want ...