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

Testing an MMO server

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 ...
1
vote
1answer
120 views

Java-Like 'throws'-information in method signature C#

From Java I know that the signatures of methods that can throw exceptions contain a throws block, that contains the Exception(s) that might be thrown. In C# there is no such thing and it is also not ...
-5
votes
0answers
30 views

how to disable copy paste option in web page [on hold]

In a particular web site how to disable copy paste option in a particular textbox and body also not allow to access mouse right option?
-1
votes
2answers
117 views

Keeping large class level objects out of memory [on hold]

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 ...
1
vote
0answers
42 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 ...
2
votes
1answer
106 views

how to process document state transition?

Imagine there is an application (ASP.NET MVC) that processes some documents. The document must be revised several times by different group of users. state/role rules: simple user can only publish ...
0
votes
1answer
94 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
73 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
135 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 ...
2
votes
3answers
789 views

Architecture strategies for a complex competition scoring system

Competition description: There are about 10 teams competing against each other over a 6-week period. Each team's total score (out of a 1000 total available points) is based on the total of its ...
2
votes
2answers
118 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 ...
-3
votes
0answers
46 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 ...
0
votes
0answers
32 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
52 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 ...
-1
votes
0answers
72 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 ...
2
votes
2answers
247 views

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

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
0answers
45 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 ...
65
votes
17answers
10k views

Coding Guideline : Methods shouldn't contain more than 7 statements?

I was looking through the AvSol Coding Guidelines for C# and I agree with nearly everything but I'm really curious to see what other think of one specific rule. AV1500 Methods should not ...
2
votes
3answers
305 views

invoking methods within a conditional expression

In an oft-cited (if dated) reference for C# coding standards (pdf; from Lance Hunt), the statement is made, 33. Avoid invoking methods within a conditional expression. I've not seen this ...
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 ...
0
votes
1answer
397 views

Database Context and Singleton injection with IoC

All of the below relates to a ASP.NET c# app. I have a Singleton Settings MemoryCache that reads values from database on first access and caches these, then invalidates them using SQL Service Broker ...
-3
votes
2answers
85 views

Maintaining sequence number for the day while creating file from windows service [on hold]

I have a windows service which invokes a dll periodically and creates files. The file names should be in sequence. Example files will be myfile1.txt, myfile2.txt....mfilen.txt. The number will ...
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
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 ...
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 ...
4
votes
2answers
129 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
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 ...
1
vote
2answers
460 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 ...
-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
2answers
161 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 ...
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
126 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
113 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
26 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 ...
0
votes
0answers
173 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 ...
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 ...
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
223 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 ...
3
votes
5answers
235 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
67 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.
1
vote
2answers
211 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 ...