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

Should Libraries Use Events or a Set Action

I'm building a small reusable library for two systems our company manages. Something that I've been caught up on is whether I should expose a set of properties of type Action<T> for events such ...
0
votes
2answers
151 views

Most efficient data structure for implementing inheritance structure without classes

I have a number of types that all relate to each other in terms of them being 'derived' from one another. I'd need a way to do is relationships, which made me initially think of classes, but I ...
0
votes
2answers
77 views

finding lowest cost path - dynamic

I have to write a dynamic algorithm for finding lowest cost path. So I have a points that I have to visit. I can jump only between points by distance - 5 I have an array of distance from 0-point for ...
2
votes
4answers
314 views

Is it bad practice to update an object in a static method?

Still learning .net and OOP and have a basic question I hope. This is an asp.net mvc app. Looking at the code below, I am most concerned with the line in CheckShippingVendor that says ...
0
votes
2answers
213 views

Algorithm to order array

Take for example this input array: [2,7,1,4,9] For this input, I need to produce an array of total 23 elements which contains two elements of 2, seven elements of 7, one element of 1, four elements ...
-4
votes
1answer
68 views

Using strings in different projects (visual studio) [closed]

Is it possible to grab a string from one project (written in VB.net) and use it in another project (written in C#) ? I understand I can use pipeline, but I'm not exactly sure how. Edit: I have a ...
0
votes
1answer
83 views

Should a class validate argument using external method/service with unit testing?

I have a class that runs as a service and returns html code of a website when supplied with a URL. The code: public interface IHtmlDownloader { IWebProxy Proxy { get; set; } string UserAgent ...
0
votes
2answers
138 views

How do I create single object that changes functionality based on programmer input?

I have several classes that all behave according to one interface. But in each class there are additional functions defined that give each class slightly different behavior. What I want to do is ...
0
votes
2answers
104 views

Push response to the user for which the request is created in Asp.Net (Chat Server)

I am working on a Chat Server Application in Asp.Net with C#. Suppose there are 5 users online say User A,B,C,D,E. Suppose A sends a message in chatbox to user B, so how the chatbox (Textbox/Textarea ...
2
votes
2answers
157 views

Pattern for multiple datasources

I've already read this question on CodeReview. I was hoping for general advice. I'm writing a service which will go to numerous data sources. Each source requires getting copious amounts of data ...
0
votes
0answers
62 views

Securely Validating Software License [duplicate]

I'm currently developing a product (in C#) that will be available for downloading for free but requires a monthly subscription in order to be used after a specific trial period. What i am intending to ...
-1
votes
2answers
250 views

C#/C++ GUI development without drag and drop? [closed]

I'm currently programming Java, I have played around with C++ before, but I have never touched GUI as I feel "cheat-like" when using its drag and drop system. I feel good and enjoy programming my own ...
2
votes
2answers
237 views

Domain Model vs View Model

I'm in the early stages of my programming career and I've been working with MVC for just about a year now. I've spent much time learning about the pattern and the concepts behind it, but as the ...
14
votes
4answers
1k views

How does persistence fit into a purely functional language?

How does the pattern of using command handlers to deal with persistence fit into a purely functional language, where we want to make IO-related code as thin as possible? When implementing ...
0
votes
3answers
111 views

Least Change Problem with Thousands of Denominations

In a hypothetical economy there are currency units that can represent thousands of different values. So, for example there might be coins worth 1c, 3c, 5c, 7c, 7.5c, 80c, 8001.5c etc. Given a list of ...
0
votes
0answers
58 views

Inputs and outputs to a method mixed in the UI

I am designing the front end of an WPF application using MVVM where basically all we are doing (for now) is calling a method with some inputs and displaying the outputs. There are two types of ...
-1
votes
1answer
297 views

Online and offline point of sales application [closed]

I am going to develop a simple Point of Sales system. Mainly all the data will be stored in a central db (mysql server). All the application are going to be winforms. Together each local client will ...
1
vote
2answers
340 views

Suggest a best practice to create Constants class

There is a debate in between my team members about declaration of Constants class. We are moving the constant variables into separate class as like below public class Contants { public const ...
1
vote
1answer
149 views

How to create a WinForms project that is “WPF-ready”

I'm a C# developer who hasn't had the privilege of learning WPF yet. However, I recently initiated the architecture phase of a new project which I expect will eventually employ WPF (probably; although ...
1
vote
3answers
229 views

How does one regrade a development team appropriately?

We have a team of 20+ developers, of mixed skills and varying levels of ability in each. Some are C#/MVC4/.Net 4.5 developers cutting new code, some are VB6-ers maintaining our critical legacy apps. ...
0
votes
3answers
181 views

2D movement of an object based on speed and new vector

I am writing a small game where a sea vessel (like a battleship) can be moved in a 2D place based on orders that it receives. I wanted to know if someone can help direct me to a post or example code ...
0
votes
1answer
179 views

Migrating old Asp.net 1.1 project to mvc 3 or 4

we have to migrate a very old project that are having more than 500 web forms and 400 tables and it is hugely depends on stored procedures, the current specification is: Asp.Net : .NET version 1.1 ...
3
votes
2answers
289 views

Help With Dependency Injection

I am still very confused as to why and when to use Dependency Injection. If anyone could explain maybe using the below example that would be great, any other explanations would be appreciated. Lets ...
1
vote
5answers
373 views

Which statement performs best?

I was faced with this question by my team leader. Statement 1 (written by me): lnkbtn1.visible = lnkbtn2.visible = lnkbtn.visible = false; Statement 2 (written by my team leader): ...
0
votes
2answers
269 views

C# Internal Class - what is most common convention for applying access modifiers to members? [closed]

Suppose I have this Internal Class in C#: internal static class DataProxy { internal static Data GetData() {..} public static Data GetData2() {..} } It doesn't make a difference if I use ...
0
votes
1answer
97 views

How can I layout this class to make it easier to use for API developers?

I have an application that allows the user to place a string of text into a PDF document. I have three different ways that they can do this: Use a Form Field. Then they have four properties to ...
0
votes
1answer
141 views

What does the implementation of .NET string.Split(char[], StringSplitOptions) look like from inside?

That is if we were to see how Microsoft wrote this method what would it look like? I'm mainly interested in the use of the StringSplitOptions enumeration with the other parameter and how they probably ...
0
votes
2answers
200 views

Where to put comments, class declaration or constructor?

For a given class, where should the comments about the purpose of the class go? /// <summary> /// <----------------- describe the class here (1)? /// </summary> public class ...
-4
votes
1answer
96 views

what is the main utility of Interface in real world programming (OOPS) [duplicate]

what is the main utility of Interface. we know that we can implement dynamic behavior using interface but i guess it is not only the utility. so i like to know when we have to write interface and when ...
1
vote
1answer
104 views

When to use Interface variable = new class variable OOP

I saw often people use this code like interface IAnimal { void die(); } class Cat : IAnimal { void die() { ... } void meow() { ... } } IAnimal anAnimal = new Cat(); Cat aCat= new ...
2
votes
4answers
219 views

What are some good ways to represent relationship among three numbers

I'm trying to find a clean, intuitive way to implement this problem. Basically, I have three numbers, and based on relationship (less than, greater than, and equal to) among these numbers would change ...
4
votes
1answer
144 views

How are atomic operations are a dynamic language feature?

I was told that atomic operations are a dynamic language feature. I was too afraid to ask in that context what this actually means because I didn't want my coworkers to think I'm stupid. But I ...
1
vote
1answer
208 views

HTML DOM in .NET: following specification vs. following language standards [closed]

Let's say we're implementing HTML DOM in C#. Naming conventions are different: HTMLCollection interface/class vs. IHtmlCollection/HtmlCollection, body attribute vs. Body property etc. Behavior is ...
1
vote
1answer
157 views

modelling a restaurant availability search

I am looking into finding an efficient way which can scale up to thousands of restaurants, for doing a reservation search. Ideally, it would be efficient to answer queries like find a restaurant ...
4
votes
3answers
359 views

What are my options for using a C++11 library in a C# WPF application? [closed]

I am writing a cross-platform (OS X and Windows) desktop application in C++11. I intend to use the same C++11 core on both platforms, utilizing native frameworks for the UI (Cocoa and Objective-C on ...
-1
votes
1answer
111 views

Live share prices for a side project [closed]

Me and some of my friends would want to start a side project which we will work at our spare time. Here is our criteria 1) A challenging project which will teach us skills which has business value in ...
0
votes
4answers
516 views

What is this design pattern called? [closed]

I have some code: /// <summary> /// Represents Record Locator class /// </summary> public class RecordLocator : IRecordLocator { /// <summary> /// The Record Locator string, ...
4
votes
3answers
495 views

Extension method naming convention [closed]

We are using some utility methods in our company to simplify programming. So we have following string extension: public static bool IsNoE(this string s) { return string.IsNullOrEmpty(s); } ...
0
votes
4answers
274 views

Multiple remote views of a C# application

I have a C# application (Desktop based application for Windows OS), which I wanted to use from Web browser. The application is a kind of analyzing tool, which takes some input values and performs set ...
0
votes
3answers
274 views

Interfaces vs Base class [duplicate]

I'm strugging to know when to use a base class with Polymorphism or an interface. Providing my object exposes DoThis() then I can't see why it matters if it's an interface of a base class. Please ...
0
votes
4answers
150 views

What is the industry norm for naming standard for gui object event handlers in C# [closed]

Lets say you have a button objects on a form with a click event (c#/.Net). How is the event handler normally named throughout the industry? fooButton_Click fooButtonClick (or if you like ...
0
votes
1answer
103 views

How to provide a custom ID to a downloadable application?

I've noticed that with remote support services, a technician usually sends you a download link to an executable. When you click on that link, it installs a software which automatically connects with ...
1
vote
2answers
256 views

What is best software design in creating methods?

I had created a extension method which extended the string type in C#. // actually checks if the string is empty or null and then looks up the default // promotion code which is set in the backend ...
0
votes
0answers
157 views

What are the shortcomings of using AuthorizeAttribute in this way in MVC?

I have ASP.Net MVC project code with custom authorization as below: public class UpdateAccrualAuthorize : AuthorizeAttribute { public override void OnAuthorization(AuthorizationContext ...
-1
votes
1answer
199 views

Better sticking with MDI or learning WPF? [closed]

I have a personal project I'm going to start working on soon. It will be database driven and have various screens that the operator may want to use. First thing I thought of was an MDI interface would ...
0
votes
2answers
103 views

How should I structure my namespace tree so that I have a Math class and Math namespace?

I don't know if this is a good or bad idea, or if it's technically even possible... but I'd like to have something of the following sort: public class Math { public int gcd(a,b) // Method for ...
-1
votes
1answer
299 views

Where do put INotifyPropertyChanged Interface in Model or ViewModel [closed]

I am new to MVVM pattern I have a window which has 3 text boxes namely Name,Address,Description ,a save button and a listview which displays the above fields Name,Address,Description respectively ...
0
votes
2answers
225 views

Model and ViewModel for View

I am new to the MVVM pattern. I have a window which has 3 text boxes (Name, Address, Description), a save button, and a listview which displays the above fields. When the save button is clicked I want ...
0
votes
1answer
154 views

ASP.NET C# and MVC - Step by Step [closed]

I am totally new and do not know where to start learning. I am exposed to the IT industry in a broad manner at work with no specific thing to learn about. I definitely want to work with c# and MVC to ...
2
votes
3answers
348 views

Coding standards for c# [duplicate]

I wanted to know if there are some default standards for writing c# code. By default I mean may be something officially from Microsoft, or any other organization. I am looking for something where I ...