Can I develop a .NET application in Windows and deploy versions for Linux and Mac?
Is this possible with, e.g., MonoDevelop perhaps? ...
Is this possible with, e.g., MonoDevelop perhaps? ...
In my current project I need to be able to have both editable and read-only versions of classes. So that when the classes are displayed in a List or PropertGrid the user is not able to edit objects they should not be allowed to. To do this I'm following the design pattern shown in the diagram below. I start with a read-only interface (I...
I have a service that looks like this: [ServiceContract(SessionMode = SessionMode.Required)] public interface ILabListener { [OperationContract] byte[] GetChallenge(); ... ... [ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.PerSession)] class LabListener : ILabListener { ...
My current architecture is a nice fit for SOA. The services are written using WCF, and everything is .NET (no interoperability required). To start off with I was hosting the WCF services inside a Windows Service with ServiceHost. But now the number of services is growing and I am reconsidering the choice to have them as separate Windo...
There has to be an easy answer: var totalTime = TimeSpan.Zero; foreach (var timesheet in timeSheets) { //assume "time" is a correct, positive TimeSpan var time = timesheet.EndTime - timesheet.StartTime; totalTime.Add(time); } There's only o...
The following is my current query. It works the way i want it to. However, it needs some improvements so that i can 1) retrieve the SUM's of the money columns in my 'expenses' table and 2) add a WHERE clause (or HAVING?) so that all of the SUM's are year-to-date values, e.g. any amounts prior to Jan. 1, 2010 will not be totaled by the SU...
I have a ContextMenuStrip assigned to a NotifyIcon and this works with the right click fine. How may I wire up the mouse-click event to tell the NotifyIcon to show its ContextMenuStrip? private void taskbarIcon_MouseClick(object sender, MouseEventArgs e) { switch (e.Button) { case MouseButtons.Left: // What ...
<table class="\"matches \"> <thead> <tr class="\"sub-head\"> <th class="\"day\"> Day<\/th><th class="\"date\"> Date<\/th><th class="\"team team-a\"> Home team<\/th><th class="\"score-time\"> Score\/Time<\/th><th class="\"team team-b\"> ...
I have the following code: string foo = "blah".PadLeft(4, ' '); But when I check it, instead of foo being "____blah" (with 4 spaces at the start), it's just "blah". Why doesn't PadLeft do what I expect? ...
I am using the sample code to dynamically invoke a web service from this site: http://www.crowsprogramming.com/archives/66 The issue that I am facing is when I use the Class to call a web service from a web application I get the following error: "The remote host cannot be found" and the error happens at the following line of code: if (!...
At work we've got a very CPU-intensive Windows Forms application. It's running on a server with 24 cores. As the Windows Forms model involves a single GUI thread processing a message pump, it seems that a rich, complex GUI is not making good use of the capabilities of the system. Am I wrong in saying this? So my coworkers were discussi...
(As justification - I've never worked with threads so the description below is just an idea I want you to criticize) The task overview: - There is a list of some Objects - We need to check if the object has been changed in some way - If it was changed - apply some logic (for example - show notify). This is how I think it should be impl...
Using StructureMap, is it possible to have a singleton object for each value of an argument? For example, say I want to maintain a different singleton for each website in a multi-tenancy web app: For<ISiteSettings>().Singleton().Use<SiteSettings>(); I want to maintain a different singleton object corresponding to each site: ObjectFac...
I like to overload methods to support more and more default cases. What is the performance impact of method overloading? From your experience, is it advisable to overload methods? What is the limit? What are the workarounds? ...
Had there been no System.Random class, how would have you generated a random number? Are there any known algorithms or have you guys ever designed one? ...
Hey everybody, I once again need some help. I'm using the .net Compact Framework and the programming language C# to develop for mobile devices that are running WinCE 5.0. What I want to accomplish is to programmatically mount a network drive. To do so, the app runs the following code in a background thread: ProcessStartInfo startInfo...
I have the following construct, which shows a DataBound ListBox and a Button inside a StackPanel, which again is placed inside a ScrollViewer: <ScrollViewer VerticalScrollBarVisibility="Visible" Height="400"> <StackPanel Orientation="Vertical" MaxHeight="400"> <ListBox x:Name...
I have project creating with WPF and for database O/RM using LINQ to SQL, when i finish my project some people want to use MySQL as database, so can I change my Linq to MySQL without change any source code (maybe just change the connection string) Regards ...
I have developed a solution in Visual Studio 2008 C# WPF! I'm using a service-base SQL database (I've created and managed using Microsoft Visual Studio Sever Explorer), now I'm going to publish it but the problem is that when I install .NET Framework 4.0 and SQLEXPRESS 2005 on other systems, my application doesn't launch! :-( What compon...
Just now find it by chance, Add(T) is defined in ICollection<T>, instead of IEnumerable<T>. And extension methods in Enumerable.cs don't contain Add(T), which I think is really weird. Since an object is enumerable, it must "looks like" a collection of items. Can anyone tell me why? ...