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

Passing Anonymous Type to a Bound Control

Generally speaking, I'm fairly opposed to the use of anonymous types in real-world code (except in LINQ and some other specific scenarios), but I'm looking right now at a situation where I need to ...
-1
votes
2answers
86 views

Keeping large class level objects out of memory

So far my program is taking 1.5 GB of RAM to run and I am afraid the hospital client that have old computers might get out of RAM issues or super slow performance. Well actually if it takes 3 hours to ...
0
votes
1answer
84 views

Effective Repository in C# - Where to put methods?

I'm trying to build a new application using the Repository pattern for the first time and I'm a little confused about using a Repository. Suppose I have the following classes: public class Ticket { ...
-3
votes
1answer
63 views

How to assign null to Datetime in C#? [on hold]

How to assign null to Datetime? DateTime dt = new DateTime(); Both are not working dt=null?? dt = (DateTime)null;??
2
votes
2answers
122 views

Is there anything inherently bad about mixing paradigms in an application?

I am currently in the process of writing a (custom) Minecraft server application in C#. I figured it's a good way to teach me a lot of important things like concurrency and especially memory ...
-3
votes
0answers
43 views

Improve my OOP development skills [on hold]

I would like to improve my OOP development skills. OOP has been a big obstacle for me during interviews, but I try reading, but I still tend to miss some of the interview questions. I want to ...
-2
votes
0answers
10 views

c# Directory and GetFileName Problem [migrated]

I have a problem and I think you can help me I have this Code: string[] A1 = Directory.GetFileSystemEntries(textbox2_f2.Text, "*", SearchOption.AllDirectories).Select(System.IO.Path.GetFileName); ...
-3
votes
1answer
52 views

Please help, I'm trying to open a dialog box using ajax inside kendoGrid row double click but I've encountered error [on hold]

Here's the complete javascript: <script type="text/javascript"> var gridReadUrl = '@Url.Action("LoadServices")'; var getServiceUrl = '@Url.Action("GetAService")'; var GridExample = function ...
2
votes
2answers
117 views

Implementation strategies for atomic counter

I basically have a counter variable that is decremented and frequently polled. There are three options to implement that, that I can think of: Number 1: private volatile int count; public void ...
0
votes
0answers
31 views

ISerializable vs WCF attributes

In C# .NET there is two main possibilities to serialize and object. Implementing the ISerializable interface? Using the [DataContract/DataMember] serialization attribute of WCF? What are the ...
0
votes
1answer
51 views

Inheriting from Abstract class vs Enum Types for custom exceptions

I am creating an interface and would like the implementer(s) of this interface to throw exceptions in the case that something goes wrong. Let's call the implementer a plugin. I have a director which ...
0
votes
0answers
44 views

c# WPF Compare two directories and show how to make it identically [on hold]

Let’s presume we’ve got two directories, each one contains several subdirectories and files. Each subdirectory again contains directories and files (... and so on). My task is to write an application ...
0
votes
1answer
107 views

Testing an MMO server [on hold]

I'm working on a server for a very large (feature wise) MMO. After some bad experiences with breaking changes that caused bugs weeks down the line, we'd like to add unit/automated/regression tests to ...
2
votes
1answer
77 views

will having an event with subscribers prevent an object from being GC'ed?

I have an object, which has an event which in turn has subscribers. I know that the subscribing objects won't get GC'ed since the delegate they stored for the event is connected to them, thus keeping ...
2
votes
2answers
246 views

How a VB6 programmer can update his skills and get qualified for the current job opportunities in the USA? [on hold]

I'm going to the U.S.A. and was wondering how I can get a job there. I've been a developer for 3 years. Well, I've been working on big projects like the core banking system of one of the biggest banks ...
0
votes
1answer
36 views

Problem : Certificate for multi Clients of WCF

If My WCF service have big number of clients through the Internet,then whether should all of them share the same Client Certificate(X509)? And if their certificates should be unique , what should I ...
0
votes
1answer
62 views

Can GC.SuppressFinalize cause performance problems?

I'm being asked to implement IDisposable on objects that are 100% managed resources, which contain no streams, and no large resources. I understand the importance of properly disposing of large ...
-1
votes
0answers
71 views

Microsoft certification exams for .Net developer (microsoft has changed exam names) [closed]

I have already looked at this link. To tell the truth, I will prepare for exams on my own. I have already 2 years experience with .Net. I have read two books about C# from appress. One for ...
0
votes
2answers
58 views

Server should accumulate several requests and to retrurn response for all

For example I have a server [c#] and 4 clients. When the first client sends a request to the server I want to push a notification to the other 3 clients that they should send a request to the server ...
1
vote
1answer
60 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 ...
-2
votes
0answers
33 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
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 ...
2
votes
1answer
112 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
49 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
41 views

Writing a calculation application as services [closed]

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
25 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 ...
-4
votes
0answers
49 views

what skills require to develop a application like skype [closed]

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 ...
-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 ...
3
votes
2answers
221 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 ...
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 ...
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
221 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
54 views

C# Single Instance of a Form [closed]

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 ...
0
votes
1answer
66 views

Return tasks or expose events? [closed]

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.
-2
votes
1answer
124 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 ...
4
votes
2answers
128 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 ...
3
votes
5answers
234 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 ...
0
votes
1answer
124 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
3answers
322 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 ...
-2
votes
1answer
91 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 ...
0
votes
2answers
141 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: ...
2
votes
1answer
81 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. ...
2
votes
2answers
179 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
2answers
235 views

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

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, ...
0
votes
1answer
42 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
38 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) { } ...
1
vote
2answers
210 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
vote
2answers
113 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 ...
0
votes
1answer
88 views

What design pattern should I use for import, update, export

I need to create a simple payments validator. On the following class diagram, I tried to present the model of payments. As you can see, each payment type inherits from Payments class. Now I want ...