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

4
votes
3answers
123 views

How can I add properties to subclasses and access them without casting from a superclass?

I'm trying to model a multi-dimensional point class in C#. I have about eight different types of points, and there may be more in the future. Right now, I have a superclass (PointBase) that holds all ...
0
votes
1answer
28 views

Extensions on Visual Studio 2015 Express [on hold]

I used to install some extensions on VS Express 2013. We were using it to create some internal tools, one of them was Web Essentials. I wanted to start using VS Express 2015 so I could use the new C# ...
14
votes
3answers
2k views

Class with members that are mutable during creation but immutable afterwards

I have an algorithm which creates a collection of objects. These objects are mutable during creation, since they start out with very little, but then they are populated with data in different places ...
2
votes
0answers
57 views

How do I test with multiple input combinations?

I have a piece of code that I need to test, which is layered in three parts: Web API Controller Persistence/Logic Layer System calls for persistence It's the basic GET/POST/PUT/DELETE call system. ...
4
votes
1answer
94 views

Dependency Management in the real world?

Most of the examples i've see when watching anything on dependency management hit what i consider to be the holy grail in that the only dependencies on classes are interfaces that the IOC container ...
3
votes
2answers
276 views

Integration testing and database connection string in app.config

I am working on a project where SqlConnection is created via a static method, lets say it's DatabaseAccess.GetSqlConnection(). This method reads the .config file to get the connection string and ...
1
vote
2answers
307 views

Strategy for creating a websocket relay?

I own a Raspberry Pi and would like to use it as some sort of websocket relay, so that all people who visit a specific webpage would be able to communicate with each other. The key thing about this is ...
10
votes
3answers
1k views

Why does C# have both out and ref?

C# have out and ref, why these two are required. I don't have depth knowledge of C#. Why out and ref parameters are required?
1
vote
0answers
54 views

Could there be a use case for C# style auto-properties in Python

I've been doing a lot of work in C# recently (my primary language is Python) and I love that I can do something like public string MyProperty{ get; set; } Going back to Python I miss that sort of ...
0
votes
0answers
10 views

Integrating legacy application with new functionality

We have a legacy application with, among other things, the ability to create instances classes within VB6 DLLs dynamically and call methods with varying signatures. We have no way of accessing the ...
0
votes
0answers
30 views

Building a house automation server [on hold]

My current project involves house automation with extensive use of media. I am now tasked with programming a central control server. This server will take input via an android application and other ...
-2
votes
0answers
16 views

XML (de)serialization invalid characters in c#? [on hold]

I have a person class with CDataContent and it may have invalid XML characters. So have created a class to help the (de)serialization, however it does not handle the XML Invalid characters in ...
2
votes
1answer
135 views

What does “Stateful” means in Stateful ViewModel in MVVM

I was reading about some XAML patterns, and there was the Stateful ViewModel, according to what I read it has nothing different than what we as just the "ViewModel". Here's a description for example ...
0
votes
2answers
75 views

How can I show and hide a single field across my web application through a checked value?

Let's say I have a field called "FooName" and I have "FooName" in several places across my web application (ASP.NET MVC4). I have a check box that allows me to turn "FooName" on and off across the ...
0
votes
1answer
409 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 ...
8
votes
2answers
929 views

Unit Testing with massive lookup tables?

Our system is structured in such a way that we get a lot of key info for our calculations and other such logic from lookup type tables. Examples would be all kinds of different rates (like interest ...
-1
votes
0answers
4 views

(C#) sending hex over serial [migrated]

So I'm trying to send a (string?) of hex that looks like this "7E 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 FF" over a serial port. My code looks like this: serialport.write("7E 00 00 FF 00 00 ...
1
vote
2answers
87 views

Abstracton layer to control services access to denormalized db entity

Our db is optimized for minimum join count (partially denormalized). E.g. our User entity contains account data (nickname, facebook id, etc), user numerical statistics (total games played, total wins, ...
0
votes
3answers
310 views

i++ vs i+=1 in cycles, why evaluate? [on hold]

Why do most programmers use i++ in cycles? Doesn't it mean evaluate and increment. I find more logical to use just an increment i+=1, because that's all I want. WriteLn(i++); would evaluate i and ...
-5
votes
0answers
30 views

Desktop application to access HTML files [on hold]

I am planning to design a desktop application which will access an HTML file,take data from it, then store the data after some logic in excel. I have some queries regarding that. Which language can ...
4
votes
2answers
110 views

Entity Framework Domain Object as Business Object

If I am not concerned with unit testing and switching my data access out at a later time, would using my entity framework objects as my business objects be okay? I have an existing database for which ...
4
votes
2answers
69 views

Need sorting method for coordinated, flattenned collection

I have a component which outputs an ICollection of the following type: public class CoordinatedInjectableValue { public int XOffset { get; set; } public int YOffset { get; set; } public ...
7
votes
6answers
6k views

Is Razor or XSLT better for my project? [closed]

I'm in the early stages in the design of a system that will essentially be split into two parts. One part is a service and the other is an interface with the service providing data through something ...
2
votes
1answer
59 views

Is there a standard way to handle assigning and managing tasks for users/groups in asp.net?

Take for example what I would assume to be a fairly standard process flow, where certain users are assigned a role which allows them to create requests, but another group (or subset) are assigned a ...
0
votes
0answers
30 views

SignalR UI updates and group managing

I'm working on a web application and I have 2 specific questions regarding SignalR I need give the UI real-time updates (both broadcast to everybody on the hub, but also just to the original caller) ...
18
votes
4answers
4k views

How do I handle setters on immutable fields?

I have a class with two readonly int fields. They are exposed as properties: public class Thing { private readonly int _foo, _bar; /// <summary> I AM IMMUTABLE. </summary> ...
2
votes
1answer
113 views

Managing Massive Updates with Resource Access

I have a number of data servers that are pushing data to a main server as in this kind of architecture: These data points (points for short) are updated randomly from each server. On the server, ...
-1
votes
0answers
64 views

Why does internal instance become null [migrated]

I am trying to figure out why the assigner (myC.myself) become null after the line is compiled? Thanks in advance. namespace AequalsBequalsC { class Program { static void Main(string[] args) ...
-4
votes
0answers
39 views

What should I do if “velocity can't be used like a method”? [closed]

I was working in c# and I typed this line: if (Input.GetKeyDown (KeyCode.Space)) { GetComponent<Rigidbody2D>().velocity (0, jumpheight); } My computer then said that velocity can't be ...
12
votes
5answers
4k views

What are some practical uses of the “new” modifier in C# with respect to hiding?

A co-worker and I were looking at the behavior of the new keyword in C# as it applies to the concept of hiding. From the documentation: Use the new modifier to explicitly hide a member inherited ...
1
vote
3answers
138 views

Design pattern for different code behaviors according to different clients

At my company, we have a solution composed of a WinForm (multiple per client) and an API (one per client). This solution is deployed on different clients that require the solution to behave ...
1
vote
1answer
749 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
3answers
652 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
1answer
89 views

Best practice for buffering when posting to a web-service that has gone offline

If I am collecting data that needs to be posted to a web service on a regular (~5 minutes) basis, and that service has temporarily gone offline, what is the best practice to ensure we don't lose any ...
1
vote
1answer
31 views

How to model table and column objects and their relation

I'm working on a small application where I need to model tables and columns from a relational DB. I've been reading some material on nested classes, which is recommended to be used sparsely. However ...
4
votes
4answers
116 views

Instantiating class that contains methods to check some of the settings and also return values from my app.config file

I am writing a console application and have a class called ApplicationConfiguration that contains methods to check some of the settings and also return values from my app.config file. For instance ...
0
votes
0answers
68 views

Any “Gotchas” to using Entity Framework for Identity & Dapper for all other DB access in a .NET MVC application?

I'm firing up an MVC project in which I'd really like to use Dapper as my ORM, as I like to be as close to the database as possible for performance and SQL tweaking reasons, yet still have the power ...
11
votes
2answers
10k views

Webkit as GUI in .Net/Mono

I want to make a cross platform application, which will also have a website where the desktop applications (Windows, iOS, Linux) will talk to the server and keep the users data in sync. So far the ...
-3
votes
0answers
32 views

Looking for a package to visually show this [closed]

I want to be able to visualize a very long string of say 1000 characters in one line. From there the user can horizontally scroll through that long string of 1000 characters or zoom in to only see the ...
3
votes
1answer
238 views

specification regarding a text file

I have a specification I need to follow (for a little project) and I want to ask if they my way of thinking on how to tackle this spec is correct. It's regarding C#. Specification: consume a TEXT ...
1
vote
1answer
72 views

Pattern for communicating between nested usercontrols and parent form (C# / Winforms)

I'm trying to decide the best way to handle communication between a UserControl that is nested within another UserControl and the parent Form itself. I have a Form, inside the form there's a ...
2
votes
3answers
242 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 ...
1
vote
1answer
205 views

WPF and data in the cloud

I need to create a WPF app that users will use on one machine and the manager wishes to use at home in the evenings. I have already suggested a web app which they don't want to do so suggested hosting ...
0
votes
1answer
304 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 ...
4
votes
1answer
160 views

Control Start Of Program

I made a program, which was supposed to run every night as a windows scheduled task, let's say the program is just one method, called Do_Task(). Usually you need to press a button to run the Do_Task() ...
1
vote
1answer
37 views

How to model a time-based m-to-n relationship in Entity Framework using code first

I have to model and manage a time-based configuration. Typically - without an OR mapper - I would start with the database tables. Screen Color ColorScreenMapping ------------- ...
-1
votes
0answers
23 views

Multiple publishers to one subscriber: handling subscribing and unsubscribing [migrated]

I hope this isn't too general, so I apologize in advance if so. I am creating a console text adventure game. I essentially have many monsters, one per room at the moment. I also have a God ...
1
vote
2answers
144 views

Convert this abstract class to an interface

I have a security method I would like to be able to sprinkle into other classes throughout my program. It is currently an abstract class but I feel it would be more appropriate as an interface. Can ...
0
votes
1answer
211 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 ...
14
votes
0answers
3k views

Prevent Casual Piracy for Simple Utility [closed]

I've written a small utility that I wish to sell for less than $10. My primary concern is "casual piracy". The scenario that plays out in my mind is this: User buys the program, enjoys using it ...