Tags » Csharp

Prevent XAML designer and editor error caused by viewmodel initialization

The viewmodel’s constructor are being used by the designer to show some design time data. If the constructor has some dependencies that cannot be resolved, we can get an error in the xaml editor or designer. 234 more words

Viewmodel

Nullable comparisons are weird

One of the C# oddities I noted in my recent article was that I find it odd that creating a numeric type with less-than, greater-than, and similar operators requires implementing a lot of redundant methods, methods whose values could be deduced by simply implementing a comparator. 623 more words

C#

XML Formater

Recently, I have a large XML file (~100MB) and need to get it formatted. I have searched the internet to try to find some free tools. 56 more words

C#Sharp

Send commands to a remote device over putty/ssh - Putty send command from command line

Code:

using System;
using System.Diagnostics;
namespace playSound
{
    class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine(args[0]);
            
            Process amixerMediaProcess = new Process();
            amixerMediaProcess.StartInfo.CreateNoWindow = false;
            amixerMediaProcess.StartInfo.UseShellExecute = false;
            amixerMediaProcess.StartInfo.ErrorDialog = false;
            amixerMediaProcess.StartInfo.RedirectStandardOutput = false;
            amixerMediaProcess.StartInfo.RedirectStandardInput = false;
            amixerMediaProcess.StartInfo.RedirectStandardError = false;
            amixerMediaProcess.EnableRaisingEvents = true;

            amixerMediaProcess.StartInfo.Arguments = string.Format("{0}","-ssh username@"+args[0]+" -pw password -m commands.txt");
            amixerMediaProcess.StartInfo.FileName = "plink.exe";
            amixerMediaProcess.Start();
            
            
            Console.Write("Press any key to continue . 7 more words
CSharp

Parallel executed Tasks with isolated scopes

My current customers infrastructure is heavily dependent on external suppliers of data. Because of the nature of the data the system often have to-do the requests in real time while the end-customer is waiting for the response. 385 more words

C#

ASP.NET vNext - Identity 3.0 (beta6) in MVC 6 (beta6) Spa - Using Integer Keys Instead of Strings

After looking all over the place and not finding anything specific for Identity 3.0, I got inspired to write this blog post on how to use bigint primary keys for the Identity tables instead of nvarchar(450). 332 more words

Csharp

Bottom ten list

Hey everyone, I am finally back from my many travels this summer and looking forward to doing some blogging this autumn. I’ll post some vacation photos when I have them sorted out. 53 more words

C#