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

0
votes
1answer
18 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 ...
0
votes
1answer
42 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 ...
1
vote
1answer
26 views

Down Sides to Using Properties as Opposed to Method Variables

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
25 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?
1
vote
1answer
132 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
0answers
41 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 ...
-1
votes
1answer
103 views

How to selecting Teams with Minimum Difference between Knowledge Levels

For the below challenge from a programming site, I am bit confused. Problem Statement: A Professor of Physics gave projects to the students of his class. The students have to form a team of two for ...
0
votes
0answers
45 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
881 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
58 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
104 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
vote
2answers
109 views

Technique to synchronize error codes in a same-project-API

In the project I am working right now, we have some python and some C# code. At some point, I call from python a subprocess which starts a C# executable. This C# code returns an error code, which has ...
-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 ...
7
votes
6answers
1k views

Algorithm to generate N random numbers between A and B which sum up to X

This problem seemed like something which should be solvable with but a few lines of code. Unfortunately, once I actually started to write the thing, I've realized it's not as simple as it sounds. ...
9
votes
5answers
18k views

Best way to load application settings

A simple way to keep the settings of a Java application is represented by a text file with ".properties" extension containing the identifier of each setting associated with a specific value (this ...
-1
votes
0answers
55 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 ...
1
vote
1answer
103 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 ...
0
votes
1answer
67 views

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

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
1answer
683 views

Data transfer between “main” site and secured virtual subsite

I am currently working on a C# ASP.Net 3.5 website I wrote some years ago which consists of a "main" public site, and a sub-site which is our customer management application, using forms-based ...
1
vote
1answer
233 views

What is better repository design?

I have tables that I insert, delete and update, but I read from views. At times, I may read from the tables as well. What is a better generic interface for a Repository: public interface ...
-2
votes
0answers
20 views

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

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 ...
0
votes
3answers
490 views

Manage ClickOnce releases for different parties

I'm struggling with release management of a piece of software. First some general information: It is a ClickOnce application I follow the release often practice There are about 30 parties served ...
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 [on hold]

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
41 views

MVC Best practices: Do error message modals need a controller method?

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
27 views

transfer data from android device to pc via Bluetooth [on hold]

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
0answers
74 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
25 views

Creating Dynamic Odata Feeds at runtime, c# [on hold]

We have a program that exposes authorized sql tables to the user and allows them to select from the available tables and some fields. The program then returns a file with a bunch of sql statements. ...
34
votes
4answers
3k views

Why are structs and classes separate concepts in C#?

While programming in C#, I stumbled upon a strange language design decision that I just can't understand. So, C# (and the CLR) has two aggregate data types: struct (value-type, stored on the stack, ...
2
votes
3answers
135 views

Accessing shared data without blocking in TPL

I am writing a class that contains data. It exposes methods that allow to query the data, while the data is also being updated from an external source (web service, for example). All the methods ...
0
votes
1answer
255 views

Organizing Business and Presentation entities

Background I am developing a WPF project. This is the basic structure: User Interface (WPF Project); Interfaces (class library, contains all the interfaces and the entities used by the ...
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?
-4
votes
0answers
24 views

Generate Charts in Excel by passing data from MVC 4 C# controller using report viewer [closed]

Am current doing reporting in Excel and PDF formats using Report viewer ,I wanted to generate some interactive charts in my reports. But as far I researched report viewer doesn't allow interactive ...
8
votes
3answers
787 views

Is 'using' appropriate in a context where there is nothing to dispose?

In C#, using statement is used to dispose in a deterministic manner the resources without waiting for garbage collector. For example, it may be used to: Dispose SQL commands or connections, Close ...
0
votes
1answer
136 views

How can I decouple query and context in a “query object” scenario?

I'm using a query object pattern (similar to this) to manage disparate queries while avoiding bloaded facades/repositories. A query object takes a number of constructor parameters, representing query ...
0
votes
0answers
32 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
118 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 ...
156
votes
9answers
10k 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 ...
0
votes
2answers
77 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 ...
2
votes
1answer
46 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 ...
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 ...
13
votes
3answers
2k views

Could a singleton type replace static methods and classes? [duplicate]

Possible Duplicate: What is the difference between all-static-methods and applying a singleton pattern? In C# Static methods has long served a purpose allowing us to call them without ...
0
votes
2answers
358 views

How are the tiles in WORDAMENT organized?

I'm trying to create a word game, just like WORDAMENT, in my spare time. In order to present a new round, I need to create a board with 16 letters organized in a 4*4 grid. Currently, I'm generating ...
1
vote
1answer
90 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
vote
2answers
725 views

Tree View Children condition indicator on topmost un-expanded parent

I am using a tree view in c# and i am creating custom icons for the nodes. Let say this is my hierarchy with a node that satisfies a certain condition: Root1 |_Ax |_Bx1 |_Bx2 |_Cx1 ...
0
votes
3answers
1k views

how are virtual methods slower in C#

I was reading the that virtual calls make the code slower than calling non-virtual call in C#. However the IL instruction for both are the same callvirt except in cases where base.somemethod() is ...
-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 ...