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

3
votes
1answer
97 views

Deferred execution of Dispose for IDisposable objects

I'm working on an application that does lots of encryption and decryption in-application and this is probably the number-one bottleneck, so I've been spending some time making performance tweaks to ...
19
votes
6answers
2k views

“Undoing” an integer wraparound

I ran into an interesting theoretical problem a number of years ago. I never found a solution, and it continues to haunt me when I sleep. Suppose you have a (C#) application that holds some number in ...
1
vote
1answer
39 views

How to handle a Restful Call in a RESTless state?

I have a bit of a dilemma. We are choosing our DBContext using a dynamic builder. This is done because in the current database structure we have a separate server for every "Customer". All of these ...
1
vote
2answers
459 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
votes
0answers
26 views

Webapp that shows a table

I have a C# web app that shows a database table on a webpage. I am not convinced that I'm doing this the best way and am looking for people's opinion on a better way to do this. Here's what I do so ...
0
votes
2answers
158 views

Optimization ended up in casting an object at each method call

I've been doing some optimization for the following piece of code : public void DrawLine(int x1, int y1, int x2, int y2, int color) { _bitmap.DrawLineBresenham(x1, y1, x2, y2, color); } After ...
1
vote
0answers
60 views

Opinions on my application structure

I've read a lot of articles in the past few weeks and come up with an application structure which I wish to have some feedback on. MyCompany.Core [class library] Entities [folder] - interfaces ...
0
votes
0answers
28 views

Populating Google Maps with Markers from C# List [migrated]

I am trying to populate a javascript google map with a c# list of google map markers. I can get data in from public floats but not from the list. The list will be populated by the database but in this ...
0
votes
1answer
125 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 ...
-3
votes
0answers
84 views

C# Implementing filtered Iterator without using yield return [migrated]

I'm trying to display elements of a list with filter and without filter. Here, I use the filter in such a way to display the elements which are divisible by 3. I'm going to use Enumerable and ...
2
votes
1answer
95 views

Is there a way to use RAII techniques in COM?

I am caught between two conceptual models of how to construct objects, and am having trouble working out what standard I want to adopt. I prefer to program in .NET and often try to use RAII and ...
0
votes
1answer
36 views

Filtering common starting/ending characters from array/list of strings

Ok so for example I have an array of strings with each string as below: 364VMS1029 364VMSH920 364VMSH192 364VMSU839 364VMN2382 364VMR223 364VMR2X3 364VMN829 364VMN8757 364VMN831 How can I ...
0
votes
0answers
38 views

Writing a calculation application as services [on hold]

I want to write a big calculator. My calculator should post his results, people should be able to get calculations or see what an other user calculates. For that purpose I would use WCF-Services. I ...
0
votes
0answers
17 views

Encapsulate multiple properties into a single class to use as a custom DependencyProperty

My application is a WPF project implemented in C# .NET (4.5) using an MVVM architecture with no code-behind in the View. In order to eliminate the coupling between the View and the ViewModel I'm ...
-1
votes
1answer
98 views

Designing a big Web application (SPA) with .NET and javascript frameworks. How to start? [on hold]

In my company we have this desktop ERP that is the main product of the company. Ofcourse this erp is a collection of different bussiness modules (CRM, inventory managment etc.). The company wanted to ...
-3
votes
0answers
43 views

what skills require to develop a application like skype [on hold]

Hi I want to create a chat application like skype. I have no Idea about it from where I start. I want to know that what skills are require to develop application like skype. May be this is out of ...
0
votes
0answers
163 views

What's the best way to expose a Model object in a ViewModel?

In a WPF MVVM application, I exposed my model object into my viewModel by creating an instance of Model class (which cause dependency) into ViewModel. Instead of creating separate VM properties, I ...
2
votes
2answers
195 views

Why does C# allow properties in interfaces?

In C#, the following code is valid interface I{ int property{get;set;} } Which doesn't make any sense to me. This seems to break one of the most important principles of interfaces: lack of ...
1
vote
0answers
33 views

Is it improper to have an application wide source for dropdown binding

The WPF Combobox needs to bind a collection to it's ItemsSource and something to bind the selected item or value to. Until now, I've included both the collection and the selected value properties that ...
0
votes
1answer
78 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 ...
2
votes
3answers
207 views

Duck typing in statically-typed languages

Is it a fair assumption to say that an overloaded constructor for a class can be thought of as a 'duck' for duck typing? Let's say that ClassA has an overloaded constructor, it would stand to reason ...
0
votes
1answer
51 views

C# Single Instance of a Form [on hold]

I have 3 forms. Form 1 has information inserted into Form 2. After clicking a button on Form 2 to get to Form 3; on Form 3 I pull data and put it on Form 2. The problem with this is that I don't know ...
3
votes
5answers
228 views

Is it useful to keep 'definition' entities in a database vs using an enum?

In a project that I have started working on, the database has a lot of FooDefinition tables which act like an enum. It's a C# project using Entity Framework although that is not central to the ...
1
vote
1answer
60 views

Return tasks or expose events? [on hold]

What is preferable when you program an API? And I have to add that in my case there will be two events exposed in spite of everything.
-3
votes
1answer
20 views

Logical grouping of data file rows [on hold]

I am looking for an efficient way to group some values as follows: I have a tab delimited file that has some table data in a structure like: Name LastName SSN SomeID AnotherID Address ...
1
vote
2answers
209 views

Do immutable objects that constantly change impact memory/performance?

I'm writing a program that goes into a loop and keeps changing the state of some models (similar to a game). Naturally, many things are mutable. However, I'm also writing some classes that are ...
-1
votes
1answer
117 views

Implementing IEnumerator without using 'yield return' in c#

I'm new to C# programming, I was experimenting with iterators concept in C#. Here, I'm trying to display all the terms in a list, for that I'm trying different ways to obtain the results. In the below ...
2
votes
2answers
174 views

Best patterns for variable-scope disposables

I have Client which uses a disposable Connection for talking to a remote service. A Connection is somewhat expensive to set up and needs to be Dispose()d properly. I want to allow multiple methods ...
0
votes
1answer
38 views

Class and API Design suggestions [on hold]

I am looking for some good design suggestions for this scenario: I have a tab delimited file that has all the columns and data I need to import into our database. So the data is all there but in a ...
0
votes
1answer
167 views

Application use on website

Is there a good way to run a C# application on clientside in lieu of JavaScript? I have done some front end work with JavaScript and backend C# for web developing at an old job, but I am interested in ...
2
votes
3answers
309 views

What is a good design for a method that can return several logically different results?

The question title is probably too abstract, so let me provide a particular example of what I have in mind: There is a webservice that encapsulates a process of changing passwords for users of a ...
0
votes
2answers
140 views

Comparing two software versions in C#

I´m working on a mod update checker for minecraft, but there is a big problem: The modders and online database that I´m using for update checks has no standard software versions e.g.: Local: ...
0
votes
2answers
233 views

Confusion in my If Else ,Else If Condition. in C# [on hold]

I have three column as follows: Month Tech Circle According to this column I need to fetch the data. In Month Column, Data is : Jan,feb, March... and so on. In Tech Column, Data is : Gsmnqi, ...
1
vote
2answers
295 views

Correct way to inject dependencies in Business logic service?

Currently the structure of my application is as below Web App --> WCF Service (just a facade) --> Business Logic Services --> Repository -> Entity Framework Datacontext Now each of my Business logic ...
0
votes
1answer
120 views

Onion Architecture Structure

I am looking to understand and implement the Onion Architecture and have a vague idea on how to structure everything but need help to clear up some of my confusion. Based on different examples and ...
-2
votes
0answers
63 views

Program that calculates and displays resistance [on hold]

The question is as follows: This problem is to do with electrical resistors, which 'resist' the flow of electrical current through them. An analogy is a hosepipe , a thin one has a high resistance, ...
-2
votes
1answer
86 views

Should I as a junior-programmer pursuit a course in C#, even though I did Java? [closed]

I'm a junior-programmer, and at present I am pursuing a course in I.T. which involves getting to know Java and JavaScript. Should I pursuit a course in C# also? I really like programming, but I had a ...
2
votes
1answer
79 views

If the UI layer depends on the Application layer. Who starts the application/process?

This is related to DDD for a desktop application in c#...with 4 layers ui/application/domain/infrastructure. Actually 3 desktop applications sharing part of the domain and part of the infrastructure. ...
0
votes
1answer
127 views

Solution for multiple versions of one Software

I'm sorry if the title is a little hard to get. I've never built an entire big software my self, just some small apps in my free time, i was more familiar with the do-what-my-boss-told-me things. ...
0
votes
1answer
115 views

Executing user configuration settings

For an API I'm building what it does is load an XML file that is passed to it as a string, drill to the correct element, modify values, and return the modified XML. I'm doing something like this in ...
1
vote
3answers
147 views

Relative encapsulation design

Let's say I am doing a 2D application with the following design: There is the Level object that manages the world, and there are world objects which are entities inside the Level object. A world ...
0
votes
1answer
39 views

Organizing solution / project structure and classes for Line of Business Application (LOB)

The question how-do-you-organize-your-projects already has a few good answers. I would like to get a better understanding about this suggested structure: MyApp.Core MyApp.Model MyApp.Presenter ...
0
votes
0answers
20 views

Recommended reading for using C++ CLI for interops only [closed]

I am going to use C++ CLI to call a native code into my C# .Net application. I picked up a book on C++ CLI, but it feels like too much information, since the book teaches you programming in C++ CLI, ...
0
votes
1answer
126 views

Good approach for hundreds of comsumers and big files

I have several files (nearly 1GB each) with data. Data is a string line. I need to process each of these files with several hundreds of consumers. Each of these consumers does some processing that ...
1
vote
2answers
111 views

MVC/P in Desktop Application

I am developping a desktop application in C#, and have separated different layers in an MVC-ish architecture. As I have switched from GTK# to XWT, only views had to be adjusted, so the seperation of ...
2
votes
2answers
472 views

A small project but I want to use design patterns to do it right

I've got a project coming up, a very a small system, but one that needs to be extended in the future. Here's how I've designed it so far. It's 3-tier: presentation, business and data. For the ...
0
votes
0answers
32 views

TryUpdateModel vs Parameter and ModelState.IsValid

As I was originally learning about MVC, the book I was using taught the following technique for Controller actions: public ActionResult MethodName(Model model) { if (ModelState.IsValid) { } ...
3
votes
3answers
364 views

Why shouldn't an object reference have access to a static member in C#

Context of my question: I am reading C#. Trying to understand Static keyword. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class ...
1
vote
2answers
125 views

Sanity check for design pattern used with an intricate calculation model

I am working on a project that generates technical brochures in batch. The 3rd party API that is being used expects POCOs with property names that match field names used in each of the brochure ...
0
votes
0answers
11 views

filling dependency drop down list [closed]

I want to call the drop down list event selectedindexchange to fill the dependent drop down. inside the fucntion and then calling that function under button click. but its not working follow is my ...