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

Doubts about architectural pattern for customizable standard enterprise application

My company needs to build an application to be rolled out for a lot of clients. This software will have many modules and functionalities, but some of these will need specific adjustments for some ...
3
votes
1answer
262 views

Pattern to use to relate multiple data sources to different user data widgets

I have an client x server intranet application the basically gets data from the server, format it and send that data to the client for display. At the server we are using ASP.NET C# running on IIS ...
0
votes
1answer
44 views

Simple TimeZones

I need to send out emails based on a timestamp. But the timestamp must be what the user expects it to be. The timestamp is set by the user submitting an object. E.g Al from L.A in the U.S saves an ...
0
votes
0answers
80 views

How is CancellationToken.IsCancellationRequested updated?

I've been doing some refactoring today and I encountered one interesting thing. I've extracted a method from a code which uses a cancellation token passed to it in order to check if the user did not ...
9
votes
1answer
4k views

Understanding Visitor Pattern

I have a hierarchy of classes that represents GUI controls. Something like this: Control->ContainerControl->Form I have to implement a series of algoritms that work with objects doing various ...
0
votes
2answers
230 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 ...
2
votes
1answer
72 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
4answers
138 views

When to make a method part of an interface or a concrete implementation?

I create an interface for database access to a MySQL database. Currently, this is the only way to access day, but to make it easier to test and in the event that the data access might change, I used ...
1
vote
2answers
90 views

C# Subject Observer Architecture question

I'm making a C# application using the Subject Observer design pattern in a slightly different way. I am passing the Provider Class, implementing IObservable (this has the OnNext() method that ...
-3
votes
0answers
48 views

Dropdown search function in WPF/C#? [on hold]

Is there anyway to implement dropdown (Combo box) search function in WPF/C# ? I want to implement search function similar to facebook. When I type a word or sentence similar records should appear in ...
2
votes
2answers
137 views

Abstract classes and constants

I have two classes that share a lot of code and are conceptually variations on a common class. So I want an abstract class that contains all their common code and then they can each inherit from it ...
0
votes
1answer
85 views

Should I initialize a member variable in declaration when it is initialized by a constructor parameter?

Which is recommended for initialization of class fields in C#: class Foo { public X x = new X(); // or any default value... public Foo(X _x) { x = _x; } } Or class Foo { ...
3
votes
1answer
189 views

Tracing an object

Suppose I want an object with a list of strings and every method that this object gets passed to adds its name to the list of strings. Basically it's a stack trace, except unlike a stack trace it ...
2
votes
3answers
166 views

Concurrent collections, should read methods allow multiple threads at one time?

I have custom collection and I want to add wrapper to allow concurrent access. public class MyConcurrentCollection<T> { private MyCollection _collection; // passed in constructor ...
-6
votes
0answers
30 views

Get info to your site from another site [on hold]

can anyone help me to find a way to get UserKey from TrueCaller ! And.. How can i build a code in C#,to get informations from another site An exampel.. i need to get info about a certain phonenumber ...
0
votes
1answer
54 views

Create a Winforms Flowchart Control when performance matters: Set of controls / Handle everything manually (painting, user interactions, etc.) [on hold]

I am currently trying to create a Flowchart / Diagram Control (e.g. NShape) and I am struggling about what to use to manage the primitives (rectangle, rounded rectangle, square, circle, arrows, etc) ...
-2
votes
0answers
27 views

How to code a Data Scrapper [on hold]

I’m a javaScript beginner. For a practice project, I want to create a Page Scraper that will list of all classical musicians, (say from classicalmusic.com), and then have that data returned in a ...
0
votes
1answer
45 views

Any good data structure to perform efficient lookup and modification operations about what are the shapes containing the current cursor position

I think I'm facing a pretty common issue but cannot remember which solution is the most suitable one. Let's put it that way: I can, in a, certain, given, language get some events anytime the user is ...
1
vote
2answers
77 views

Is storing data that rarely changes in-memory a good candidate for a singleton/cache?

I have a class called DataPoint that is defined like the following. Currently, it goes through each property on an object and based on the DataPoint, it does some formatting like padding, trimming, ...
-1
votes
0answers
17 views

WebAPI to source Location Satellite Images [on hold]

I am developing an ASP.NET web application that calculates a percent score of an algal bloom from a satellite image. I'm looking for a WebAPI that will allow me to access a recent satellite image ...
0
votes
0answers
73 views

To KISS or not when coding? [duplicate]

I don't consider myself "ninja" but I don't think I'm bad dev either. Anyway, after many years of development I tend to keep it simple more ofthen than before. For small projects there is no need to ...
0
votes
0answers
14 views

Is the ProtectedData class still an acceptable method to store passwords? [migrated]

I'm writing a piece of software which will have to store a users password to allow authentication with a 3rd Party service. Unfortunately, this service currently requires the use of a password rather ...
2
votes
1answer
181 views

When designing a data structure, should I implement very inefficient operations for convenience?

(I've added the .NET tags because the data structures are for .NET, and this question should be considered in the context of the conventions for that platform.) I'm writing a library of immutable and ...
1
vote
2answers
87 views

Technique to synchronize error codes in a same-project-API

In the project I am working right now, we have some python and some C# code. At some point, I call from python a subprocess which starts a C# executable. This C# code returns an error code, which has ...
2
votes
0answers
436 views

Best Practice Method for Including Images in a DataGrid using MVVM

All, I have a WPF DataGrid. This DataGrid shows files ready for compilation and should also show the progress of my compiler as it compiles the files. The format of the DataGrid is Image|File Path ...
0
votes
0answers
132 views

Dependency Injection with EF - is mapping required?

I'm implementing the Repository pattern with using DI and EF6. I created the database (that inherits from DbContext) object with the Visual Studio wizard ADO.NET Entity Data Model I have a generic ...
1
vote
0answers
171 views

What architecture is suitable for players matchmaking?

The system should match players to game rooms. When the room is ready it moves to a game server. Each game start request can have a list of prefered game servers and specifies exactly game mode ...
3
votes
1answer
105 views

Better to write your .NET library with COM limitations in mind, or separate your .NET library from Interop?

I came across this interesting article: How I Came to Love COM Interoperability on CodeProject, which got me thinking... The author argues that they do not want any COM-ities in their .NET library ...
-5
votes
0answers
81 views

What are the basics of software engeneering [closed]

I want to be a software engineer what is the process where to start I want everything to be online.
2
votes
1answer
102 views

How do you separate view from logic in a Winform application?

I know there are patterns like MVC to separate view from logic, however, I don't know how common they are in Winform applications. For a C# Winform application, I may start with a Form and gradually ...
-3
votes
0answers
26 views

Should one devote efforts to learning C# in lieu of VBA, for practical purposes in Excel? [closed]

I am a data analyst by trade and have background in RDBS, sql, ms server and excel is an everyday tool as well. I have OOP background (Java, python) but have never approached any .NET. Heard from a ...
1
vote
1answer
98 views

How to handle custom logic for multiple customers

We got a project where we have to process certain requests which the customer sends. The request is either in a generic format or in a customer format (all xml) which is then converted to the generic ...
-2
votes
2answers
92 views

Null object pattern or nullable [duplicate]

What's better for implementing null object pattern: 1) provide special state for instance or 2) use everywhere ? (Nullable) operator? And I'm thinking about structs only.
1
vote
0answers
21 views

Calling Async method in class constructor in C# [migrated]

Currently I'm developing an universal app using c#. In app I used sqlite as database and as you may now It has async methods. I have a class with some null property that I'll fill them using data I ...
-4
votes
0answers
82 views

Does C# meet my all of my needs? [closed]

TL;DR: Are there any serious issues with using C# over Java for mobile dev and would I be more likely to find jobs in game development with C++ or C#? -- At the moment I'm familiar with HTML, CSS, ...
2
votes
2answers
95 views

For a concrete SQL Repository, should I encapsulate the SQL logic inside or outside the repository methods?

If I have a concrete repository based on SQL data access, should I pass in SQL to the repository methods or encapsulate them within the methods. I feel if I pass them in, then I am coupling my ...
0
votes
3answers
462 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 ...
1
vote
1answer
151 views

What is better repository design?

I have tables that I insert, delete and update, but I read from views. At times, I may read from the tables as well. What is a better generic interface for a Repository: public interface ...
-2
votes
0answers
17 views

Where can I find the contents of FibreConnList? [migrated]

Given a block of code, if (messageType == typeof(FibreConnectorClass)) { FibreConnectorClass fibreconnect = (FibreConnectorClass)payload; fiberConnectorComboBox.Items.Clear(); foreach ...
1
vote
2answers
632 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
vote
5answers
86 views

How much data from a web service should I expose in a library?

I'm working on a personal project, a library that can access the weather forecasts and other weather related data from it. However, a lot of the returned data is sometimes quite redundant or simply ...
-2
votes
1answer
77 views

How can I add more classes in C# Windows Forms project? [closed]

When you program in Java, you have a package, and in that package you put class files, where you write your logic, you have one main file, and you spread your code in the rest of the classes, for ...
-1
votes
0answers
10 views

C# dataGridView image column link to file [migrated]

I am working with an image column on dataGridView: As shown in the attached picture, when I click on 'browse' I can choose a file from the dialog window. What I want... is to make the image on the ...
1
vote
2answers
113 views

Asp.net caching strategy/pattern

In my WebApi controller I have the following (pseudo) code that receives update notifications from Instagrams real-time API: [HttpPost] public void Post(InstagramUpdate instagramUpdate) { var ...
1
vote
3answers
115 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 ...
3
votes
4answers
182 views

Filling the gap between Conception and Unit Test

I am stuck trying to do TDD. I'd rather seek the counsel of others who have gone before rather than waste time with trial and error. QUESTION: What diagrams / exercises / development processes can ...
3
votes
2answers
132 views

In WPF, should I base my converters on types or use-cases?

I'm looking for some advice on how to write my WPF value converters. The way I'm currently writing them, they are very specific, like (bool?,bool) => Brush, i.e. I'm writing each converter for a ...
0
votes
1answer
238 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 ...
0
votes
0answers
59 views

What is the design pattern name for a class that handles 2nd level caching? [duplicate]

I have a system where I want to start introducing some 2nd level caching. I want to abstract data access a bit and allow some type of other class to do the dirty work of fetching a DTO; it will check ...
5
votes
6answers
1k views

What is the best way to prove that in-code documentation is greater than extensive external documentation?

What is the best way to prove to my boss that in code documentation is greater than extensive external documents containing documentation and screenshots of code/ui? We have a group in the company ...