C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform
-5
votes
1answer
37 views
Detecting tablets using asp.net [on hold]
I am a newbie .NET developer. I have a website wherein I need to detect whether access to the website is from a TABLET. There is a mobile version of the site but my client wants it such that when the ...
1
vote
2answers
113 views
When to use [Pure] on a constructor?
I'm learning about code contracts in .NET, and I'm trying to understand the idea of pure constructors. The code contracts documentation states:
All methods that are called within a contract must ...
0
votes
2answers
76 views
Alternative to Static Abstract Property/Method
Since trying to use them will cause an error what is the workaround to get the same effect as them?
My Base Class:
public abstract class IPacket
{
public abstract int Identifier { get; set; }
...
1
vote
3answers
90 views
Passing two different types down a chain of calls because of an overload further down
I've got myself into a bit of a mess. I've got code coming from Main, through myMethod and down to OtherMethod. One of the parameters can be either an int or a string, which affects OtherMethod but ...
0
votes
2answers
204 views
using this in a constructor, why does it work?
I got two classes.
busiObj(created from ancient flat files)
key(provides means to tell busiObjs apart)
key has a c'tor that takes a busiObj
public key(busiObj foo)
{
bar = foo.someThing;
...
2
votes
4answers
1k views
Going through The C Programming Language K&R in Visual Studio
From what I have read, K&R seems to be a good place to start learning programming in general, and C programming specifically. However, I've just started the first chapter and I have a few ...
0
votes
0answers
79 views
Interface methods that take objects as parameters
The (probably unnecessary) Background
I am creating an interface that will define how information is passed over a named pipe between a background service and tray application that displays ...
1
vote
2answers
84 views
Scalable Job Handler
We have a job table that triggers a notification when a new job gets inserted.
Clients that can handle such jobs may subscribe to those notifications.
When a client receives a notification, he can ...
-3
votes
0answers
44 views
How to design graph in ASP.NET with C# [on hold]
Hello to all my friends.
I have to build such an application where I can draw this type of landscape drawing showing plots. I have to use C# and ASP.net. Now I have planned to do the job like this ...
-4
votes
0answers
34 views
Program not returning the correct info [on hold]
Can anyone help me out on why the following program is behaving the way it is? It returns all of the same letters when it loops through if I run the program without any debug breakpoints. It should ...
-2
votes
0answers
43 views
how to send email to multiple recipients in C# [closed]
In my asp.net project have a option to send newsletter to the register users. In this reason i need to create a option for sending email to multiple recipients. how can i make this??
0
votes
2answers
47 views
Maintaining sequence number for the day while creating file from windows service
I have a windows service which invokes a dll periodically and creates files. The file names should be in sequence.
Example files will be myfile1.txt, myfile2.txt....mfilen.txt.
The number will ...
-1
votes
0answers
67 views
What is the best use of a variable when required by multiple methods [closed]
I'm using XmlManager to do xml manipulations in several methods in a class.
Where I should declare XmlManager variable ?
Locally within each method and do intialization.
Declare globally and ...
-1
votes
0answers
55 views
When would I use a “memory mapped file”? [closed]
Here is some managed code that uses a memory mapped file (note it doesn't release it properly according to the comments)
What are some scenarios where I should (and shouldn't) consider using a memory ...
-2
votes
0answers
23 views
C# Stackexchange Questions API [migrated]
I need to build an web application and below is what i'm stuck with
Can I use StackExchangeAPI's with Key? do they have a "hello world" key can be used for learning purpose.
I wish to get the count ...
0
votes
0answers
52 views
How to implement port forwarding for voip system? [on hold]
I am developing a voip app in c#.
I have a server app that handles the connected clients and mange them.
The communication between the clients is direct peer to peer.
The sever just transfers the ...
1
vote
0answers
61 views
Having trouble with exposing class properties across projects
I have several projects in my solution:
Logan.Web.DBContext defines the DbContext for the database and builds the data model
Logan.Web.Objects defines the classes that will represent the tables in ...
0
votes
1answer
102 views
Approach to cover all the cases in Unit Tests [duplicate]
I am new to Unit Testing and i am able to write them but my problem is I am not sure that I have covered everything in Unit Tests. What could be the approach for testing some functionality in a code?
1
vote
1answer
122 views
Architecture of large-scale API (User Management)
We are currently designing an API that will hide different services (Product, Content, User etc) that will be used by our own website, our own apps etc. It is not a public API.
We are looking into ...
0
votes
1answer
85 views
Entity Framework 6 Conventions
I use the Entity Framework often, but I have one area of confusion I would like to understand better.
If I wanted to have a navigation property in an Entity such as
public virtual ExampleObject ...
-1
votes
0answers
49 views
Is Microsoft Azure Developer Training worth it? [closed]
I do have an Microsoft Azure Developer Training Opportunity for who I work for. My question is this worth the dollar or worth the time? I currently work as a developer mostly java, web applicaitons, ...
0
votes
2answers
111 views
How to structure REST api service that accepts POST parameters in the body
Everything I've read says to pass parameters to a REST service in the URI, whether by template, or query string:
https://www.myapp/my/login/api/authenticate/ganders/mypassword
or
...
2
votes
1answer
187 views
C# server side application 100 GB dataset + Garbage Collection
If I have server with 256 Gb of ram. I was wondering can I create a C# application which has a 100 GB of memory footprint?
I want to create a dictionary like
...
2
votes
2answers
242 views
Project based prefix for class names
My project leader uses project based prefixes for class names, lets say projects name ABC, he create User class name as ABCUser. and he says he do this becasuse if he wants to make User.aspx Users get ...
-2
votes
1answer
87 views
Step into and Step over Visual Studio C# [closed]
My problem is realy strange, im working in Visual Studio 2013 and when i just build solution and debugging has a stable value 16, but when i debugging step by step the final value is diffrent every ...
0
votes
2answers
98 views
Is there a downside to using AggressiveInlining on simple properties?
I bet I could answer that myself if I knew more about tools to analyze how C#/JIT behaves but since I don't, please bear with me asking.
I have simple code like this :
private SqlMetaData[] ...
1
vote
2answers
155 views
Best way of storing a small number of user credentials
I'm working on a messaging application, based on a server/client architecture.
Now I am thinking about the way how to store the user credentials.
It's not a huge number, just about 20 entries with ...
1
vote
2answers
187 views
Retrying a statement or call in a catch block - code smell or anti-pattern?
I'm wondering how better to perform this operation for a large amount of files. The bit I'd like some thoughts on whether this copy/paste is acceptable enough of a tradeoff.
try to write a file
if ...
0
votes
1answer
67 views
Full Text Indexing Strategy for MS Excel Documents
Background
As part of a broader application that allows users to search thousands of MS Office documents on a private network, I need to index and make searchable Microsoft Excel files.
My basic ...
0
votes
2answers
229 views
What is a typical team size for a complex half million lines-of-code C# desktop application? [closed]
Imagine the following scenario:
Codebase of 600,000 lines of code (C#)
All in a single desktop application
All written by a single developer (myself) over 8 years (3 years worth of actual coding ...
3
votes
0answers
35 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 ...
4
votes
3answers
153 views
How should I unit test a bitmap modifying method?
My Sprite class has a method:
private void updateWithBitmap(Bitmap b, int x, int y)
This will 'lay on top' the bitmap that's passed in, the top left corner of the passed in bitmap being at the x,y ...
-1
votes
1answer
86 views
How to catch DllNotFoundException in C#? [closed]
this question in my opinion straightforward.
How can I catch an DllNotFoundException in C# as it is just an attribute to some methods use like this:
[DllImport("NativeLib.dll")]
private static ...
40
votes
5answers
6k views
Why was C# made with “new” and “virtual+override” keywords unlike Java?
In Java there are no virtual, new, override keywords for method definition. So the working of a method is easy to understand. Cause if DerivedClass extends BaseClass and has a method with same name ...
1
vote
1answer
41 views
How to stop the WCF service (database queriying) running behind
I have a WCF service which will get an object with huge data from database in the form of collection.
I have a UI which has get and cancel buttons .
Get button : make service request and continue ...
2
votes
3answers
135 views
Alternatives to foreach iterators involving ref and out
I am trying to make a flexible particle system for my XNA game, and I've got these interfaces:
public interface IParticle : IUpdateable
{
bool Alive { get; }
float Percent { get; }
}
public ...
-3
votes
1answer
138 views
Can I use BOTH Java and C# in a game/application? [closed]
I am attempting to create something with friends, just a bit of debate over which language to use. This is not a debate over which is better, but can I use both in one application. And if so, how hard ...
0
votes
1answer
81 views
Constructors, Ignore Arguments
Is it possible to have a constructor in a class, that you can ignore certain arguments/parameters?
For example, I have this constructor
Car(color, make, model, wheels, type, doors)
Could I call ...
1
vote
1answer
92 views
Data Access Levels of Abstraction [closed]
I'd like to describe this situation from two perspectives.
I have a system called Accounts. This system is made up of subsystems which handle different account-based activities. For example:
...
2
votes
3answers
253 views
invoking methods within a conditional expression
In an oft-cited (if dated) reference for C# coding standards (pdf; from Lance Hunt), the statement is made,
33. Avoid invoking methods within a conditional expression.
I've not seen this ...
0
votes
1answer
204 views
static or non-static, that is the question? [duplicate]
For comparisons / evaluations of objects of the same class(and other purposes), is it better to define a static or a non-static (is this called "dynamic" by chance?) function?
Sample code:
class ...
3
votes
1answer
109 views
Showing a View from another View in MVP
This question is regarding MVP triads. Lets say I have two triads and first one has View1, Mode1 and Presenter1. Second triad has View2, Model2 and Presenter2. Now what I trying to do is, I just want ...
1
vote
1answer
27 views
Presenter accessing the value in text box using sender object
I have following method in my presenters which validates the user inputs on the UI. Basically to capture the value of the text property of the text box, it uses sender object which was passed in by ...
0
votes
0answers
35 views
UI Field validation in MVP pattern
I want to validate the details provided by the user before taking them into the processing.
My UIs have Text boxes, Combos mainly and, there are some fields that user must provide a data, in some ...
1
vote
1answer
91 views
Reference wind directions to texture space?
I have a 2D array filled with a simple class:
class Tile
{
boolean N,E,S,W;
}
I also have a tilesheet representing all possible outcomes except all false (12 + crossroad). Now i need to ...
0
votes
0answers
42 views
Using Statement lambda in exception handling
Following is a code snippet from MVP Win Forms application and this explanation would be helpful when answering the questions.
My DAL doesn't handle exceptions and it will be propagated up to the ...
1
vote
1answer
55 views
Exception handling in WIn Forms application
When handling exceptions for example in a method in my presentation logic, is it ok to catch all possible exceptions in a one catch block as follows if the only purpose here is alerting the user.
...
0
votes
0answers
17 views
I am trying to create an windows application watcher? [migrated]
I recently started coding in c #(in may this year) and well I find it best to learn by working with code. this application ...
1
vote
1answer
40 views
DAL Exception handling in a MVP application
In a MVP win forms application I'm handling exceptions as follows in DAL.
Since the user messaging is not a responsibility of DAL, I want to move it in to my Presentation class.
Could you show me a ...
0
votes
1answer
87 views
Simplifying data search using .NET
An example on the asp.net site has an example of using Linq to create a search feature on a Music album site using MVC. The code looks like this -
public ActionResult Index(string movieGenre, string ...