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

2
votes
1answer
84 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
35 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
35 views

Writing a calculation application as services

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
15 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 ...
-3
votes
0answers
42 views

what skills require to develop a application like skype [on hold]

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

Designing a big Web application (SPA) with .NET and javascript frameworks. How to start?

In my company we have this desktop ERP that is the main product of the company. Ofcourse this erp is a collection of different bussiness modules (CRM, inventory managment etc.). The company wanted to ...
-3
votes
1answer
84 views

C# Implementing filtered Iterator without using yield return

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
2answers
187 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
5answers
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
203 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
51 views

C# Single Instance of a Form [on hold]

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

Return tasks or expose events? [on hold]

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.
-3
votes
1answer
20 views

Logical grouping of data file rows [on hold]

I am looking for an efficient way to group some values as follows: I have a tab delimited file that has some table data in a structure like: Name LastName SSN SomeID AnotherID Address ...
-1
votes
1answer
114 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 ...
0
votes
1answer
38 views

Class and API Design suggestions [on hold]

I am looking for some good design suggestions for this scenario: I have a tab delimited file that has all the columns and data I need to import into our database. So the data is all there but in a ...
3
votes
0answers
81 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
227 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 ...
-2
votes
0answers
63 views

Program that calculates and displays resistance [on hold]

The question is as follows: This problem is to do with electrical resistors, which 'resist' the flow of electrical current through them. An analogy is a hosepipe , a thin one has a high resistance, ...
0
votes
1answer
120 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
305 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
86 views

Should I as a junior-programmer pursuit a course in C#, even though I did Java? [on hold]

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
139 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
79 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. ...
0
votes
0answers
20 views

Recommended reading for using C++ CLI for interops only [closed]

I am going to use C++ CLI to call a native code into my C# .Net application. I picked up a book on C++ CLI, but it feels like too much information, since the book teaches you programming in C++ CLI, ...
2
votes
2answers
171 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
232 views

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

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
39 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
32 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
209 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 ...
0
votes
0answers
11 views

filling dependency drop down list [closed]

I want to call the drop down list event selectedindexchange to fill the dependent drop down. inside the fucntion and then calling that function under button click. but its not working follow is my ...
-1
votes
0answers
24 views

how to send automaticaly email from asp.net web application using scheduled task [closed]

i am totally new with scheduled task, even i have never used it i just heared about this option from my friend then i post a question here. I have web application in asp.net c# using visual studio ...
1
vote
2answers
111 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
87 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 ...
1
vote
1answer
147 views

Are the over-usage of delegates a bad thing?

Good day. I have been told that a good practice for writing methods is to make the method only responsible for doing one thing. It made sense to me now that I look back upon it in retrospect. There ...
0
votes
0answers
38 views

Which one cross-platform or platform dependent [closed]

This is hard and also popular question, and I know that there is no strict answer for it, but I need your advise from your previous experiences. I'm asked to build a new software and it is for a ...
1
vote
2answers
125 views

Sanity check for design pattern used with an intricate calculation model

I am working on a project that generates technical brochures in batch. The 3rd party API that is being used expects POCOs with property names that match field names used in each of the brochure ...
2
votes
2answers
107 views

Wrapping constructor arguments

Given a base class with around 25 or so subclasses, I have found that adding an argument to the base constructor is painful. protected AbstractController(Service1 s1, Service2 s2, Service3 s3){ ... } ...
0
votes
0answers
10 views

Send users google oauth authentication to soap WCF Datalayer [migrated]

I have today a WPF application that, for sake of simplicity here, manages a few appointments, and when ready sends the appointments to a WCF datalayer for integration into a 3rd party calendar system. ...
0
votes
2answers
152 views

What is a class library? [closed]

I'm working on a lawsuit and I need a definition of a 'class library' that I can reference. Every book and all the documentation I can find seems to assume the reader already knows what a library is. ...
2
votes
2answers
121 views

Property or Method to obtain information about a collection?

Suppose I have a MyList class which extends ObservableCollection<MyObject> where MyObject has the Boolean Property Enabled. Let's say I want the number of MyObject objects that have the ...
1
vote
2answers
89 views

Setting fields with correct default value

When writing constructors, I regularly encounter a situation where some fields already have approperiate (default) values, such as false for boolean values and 0 for integers. What are reasons to ...
0
votes
0answers
39 views

How to write an Excel workbook to a MemoryStream in .NET without first saving it to the file system? [migrated]

All options within the Microsoft.Office.Interop.Excel.WorkBook save options take a filename. And not sure how to use Microsoft.Office.Tools.Excel.WorkBook. I have also found another query here which ...
0
votes
2answers
95 views

In Asp.net, how browser knows a textbox is registered with server side TextChanged event?

When I evaluate asp.net control events, I am not able to identify how the browser is aware of asp.net textbox is subscribed to serverside textchanged event or not. When I look the server generated ...
1
vote
1answer
83 views

Linking to MIT-Licensed dll

I'm currently working on some closed-source proprietary software that makes use of a library (SharpAVI) distributed with the MIT License. The SharpAVI source isn't being used directly anywhere in my ...
0
votes
0answers
98 views

Why Doesn't SMTP Mail Attachment Dispose When Client Does? [migrated]

This is an issue that I recently solved, but was wondering if somebody could help clear this up for me since I don't fully understand what exactly happened. I created a simple smtp email client and ...
1
vote
3answers
247 views

Trying to come up with a mapping convention for C# objects

so this is C# but it could apply to any OO language where different sets of objects exist across different layers of an application. We have been trying to come up with a convention within the team ...
0
votes
2answers
224 views

how to approach pharmacy software project [closed]

I would like to complete a pharmacy software proof concept. But I have a few questions I do not know. Physician information In order to refill or dispense a new RX the software needs to have access ...
-1
votes
1answer
61 views

converting WKT to GeoJSON [closed]

I am working on a library to convert Well Known Text into geoJson. For converting WKT representation of a multiPolygon would it be best to find polygons with a regular expression or by parsing the ...