.NET is a software framework supporting a multi-language paradigm and supporting language interoperability. .NET applications are executed in a virtual machine (CLR) which provides a few important services: security, memory management and exception handling.

learn more… | top users | synonyms

3
votes
1answer
31 views

TCP server implementation in .NET

I wrote a couple programs in the past that use VB6's Winsock to achieve TCP communications, but still I'm kinda new to socket programming in .NET. I needed the same functionality of the Winsock to ...
3
votes
1answer
71 views

Enum string parse and get custom attribute assign to array

I wrote a code which: - parse string to my enum - get description from enum - assign to string[] array ...
2
votes
2answers
144 views

Get persons full name from their First and Surname

My Person class has two properties; name and surname, and a function that returns the first name and the surname together. Is there anything that can be done ...
0
votes
1answer
22 views

Caling AJAX Method for multiple hidden ids aspx

I am calling a ajax method for a number of hidden client ids on an aspx page. The ajax method returns some html to a div provided. So the code looks like below: ...
1
vote
2answers
113 views

Parallel process interest in C#

In web api controller: I am a newer in parallel and Async&Task programming. Need someone help me code review. ...
3
votes
1answer
56 views

Weaving through the MIST

Original post here: MIST - auto-implemented, attribute-driven .NET notification mechanism I've developed (and use) an IL "weaving" solution for auto-implementing property change notification in ....
3
votes
1answer
98 views

Concurrent non-blocking update of cached list of on-line users

I have following problem: My server (ASP.MVC WebAPI) is tracking, when client application ("Agent") is on-line. It's storing this inf on following table: ...
7
votes
3answers
174 views

MIST - auto-implemented, attribute-driven .NET notification mechanism

I have a component that I've used myself for quite some time, the short story is that it automagically implements a property change notification mechanism (very useful for implementing ...
1
vote
0answers
41 views

Implementation of custom config section

i recently wrote my first custom config section. I have a collection of index files, each has a path and a savetime: ...
0
votes
2answers
137 views

Returning a byte array from a method [closed]

public abstract class Element { // Removed for verbosity ... protected abstract byte[] GetBytes(); } I'm attempting to create an engine that can create a ...
14
votes
5answers
782 views

Reusable implementation of IComparable<T>

I often find myself implementing IComparable{T} in different classes for sorting in a very similar fashion: Values meeting criteria X and Y should be sorted to ...
3
votes
4answers
190 views

Property caching

Trying to figure out how to efficiently cache property calculations with dependency tracking to invalidate the cache. Here is the syntax I have at the moment (one ...
3
votes
2answers
474 views

Web crawler in F#

I have been writing a web crawler in F# that downloads pages with stylesheets and scripts. Can somebody give me suggestions on improving this code, please? Would appreciate any feedback that could ...
3
votes
1answer
63 views

Serializing objects to delimited files

For a new project I'm going to need to be able to serialize random types to TSV or CSV files, so I write a class which can be used to serialize any object to a TSV, CSV or any other _SV file you can ...
3
votes
1answer
146 views

WPF/MVVM with Entity Framework, Repository and Unit of Work pattern

I'm building WPF/MVVM application and I'm struggling implementing Unit of work pattern. The part, about which I'm not sure is UnitOfWork class. Here is my thought: ...
6
votes
1answer
88 views

Creating interactive tours for WPF applications

I am developing a WPF component that can be used to create interactive tours for WPF applications. To further improve the API in terms of usability and intuitiveness, the input of other developers is ...
0
votes
0answers
27 views

Prefered way to Inject a object with default properties using Ninject

I've introduced Ninject to an application, and want to understand if what we are running is as in line with best practice as can be. I have a simple config which is required by a service. I want to ...
1
vote
0answers
62 views

Tracking which entity properties have changed

There are a number of topics pertaining to entity change tracking. All the ones I've seen involve either 1) notifying when a property has changed or 2) merely determining whether or not an entity is ...
1
vote
2answers
75 views

Using session wrapper for accessing session data

When users log in to our website, we store some information in a session to retrieve it across the site. We created a few wrappers to help with data retrieval/storage to lessen duplication of code. I'...
3
votes
2answers
37 views

Reg expression for finding expression in sentence

I have a regular expression that match the string that contains the word "duration", followed by a < or > operator and ...
12
votes
1answer
125 views

.NET 4.5 licensing subsystem using RSA-4096 strong name key, SHA256 signed XML, and assembly signature enforcing

Abstract For the past week I have been looking at taking advantage of the .NET 4.5 improvements to code signing and XML signing to produce a licensing subsystem I can use to license my own products. ...
4
votes
1answer
53 views

Minimize the console window to tray

I have a small console application that runs a very long task and I would like to hide the console window when I click on the minimize button but keep a notify icon in the system tray so that I would ...
3
votes
0answers
30 views

Event-driven UDP listener wrapper

I wrote this wrapper around the UdpClient,using events for new datagrams: ...
1
vote
1answer
56 views

Extension method to format properties that are not null and not empty

I'm trying to work with the following class, which is inside a library I currently cannot change: ...
8
votes
2answers
178 views

Can I stop validating email addresses now please?

Writing code to validate emails is a thing I don't like. It's usually pretty pointless as there's there is actually no right solution, so it leaves me with a certain sense of existential dread. I've ...
2
votes
1answer
67 views

Inheritence Cleanup

I have the following interface ...
3
votes
1answer
101 views

Extended WebBrowser control

I needed the ability to do a few extra things with a WebBrowser control on a .NET Windows Forms Form, and I found it needed some updates. So, I made a few. I added ...
0
votes
1answer
80 views

Data model decomposition into key value pairs using reflection and attributes

I'm trying to change how our system generates PDF files. Currently I have a class for each PDF that goes through the model for the PDF and fills in the properties. I want to change that to a self ...
1
vote
1answer
53 views

XSD Schema for optical media

I recently wrote my first XSD Schema: ...
36
votes
3answers
3k views

Benchmarking things in C#

I needed a better way to benchmark code, because, well, rewriting the same benchmarking code every time I need it is just...well...unpleasant. So, here's a class which does just that, it runs an <...
8
votes
1answer
101 views

Accessing the Stack Exchange API

Part of a project I'm getting started on requires access to the Stack Exchange API for certain data, as a result I built a .NET implementation to interact with it. The implementation is pretty simple,...
4
votes
4answers
244 views

Converting the DateTime to and from Unix epoch times

I'm currently working on a thing I needed this feature for. Essentially, these are two methods to convert DateTime objects to and from the Unix epoch time (two ...
5
votes
2answers
90 views

Indexed Property implementation

I have a class that encapsulates a PowerShell Runspace object which, among many other things, has methods for getting and setting variables in the session state. ...
1
vote
1answer
56 views

Copy a stream to a file using Universal .NET

I have answered to a question on Stackoverflow where Andy struggled to cancel a Stream copy to file operation using the Universal .NET Framework: Apparently, cancelling the cts CancelOperation token ...
1
vote
0answers
39 views

Current .NET session username injection in SQL Server stored procedures

I have a legacy WCF service that is ported from a security model using database logins and roles to a custom security. One effect of this change is that stored procedure are no longer executed using ...
0
votes
2answers
83 views
1
vote
1answer
36 views

Scoping resources per HTTP request

I am using this code in an MVC application to manage objects that should only have one instance per request. ...
5
votes
1answer
106 views

MVVM: Am I doing it right?

I read a lot of articles recently concerning XAML, WPF, data binding and MVVM. I also watched some MVVM tutorials and downloaded some MVVM samples. I finally got my first MVVM sample to work, but ...
3
votes
3answers
149 views

Performing parallel processing on a file

I have some code that reads a file and then does some parallel processing of the data. There are millions of lines in the file and this section of the code is the bottleneck in my program. Any ...
1
vote
1answer
61 views

Disposing of an SQL dataset

I am getting a compiler warning when running my code analysis. It is CA2202. It is saying that I have not properly disposed my dataset through all exception paths. Here is the code: ...
2
votes
0answers
43 views

Add transactional Units of Work to incorrect NHibernate usage (microsessions, single object actions)

This code is part of a quite huge repository using NHibernate in a wrong way: no units of work, but microsessions for every object loading and saving (ignorant of Persistence Ignorance, coded like ...
1
vote
0answers
48 views

UI code-behind for managing employees

I have a form code behind and it has what are called "Common Utilities". Basically the original author made a super class that is embedded into the main form code behind. What is the best way to ...
0
votes
1answer
58 views

Using EF 6.1 for updating objects and their children

I have an application that allows a user to create a poll that includes questions and answer choices as part of the poll. The hierarchy is a poll has one or more questions, a question has one or more ...
2
votes
1answer
49 views

Processor that would process an Object (say a message you received)

Sorry for being a little abstract but I have attempted to concoct something simple but it seems to spiral out of control. So I was thinking maybe I am taking the wrong approach. Here's what I am ...
2
votes
1answer
36 views

Property validation

I require that the Feature set of my Licence to have a non-empty intersection with a set of features that the module I am loading contains. I expect other lists in my License to form similar ...