background preloader

.NET

Facebook Twitter

Visual Studio Tips & Tricks by Moshfegh Hamedani. Have you ever wondered how professional programmers write code fast?

Visual Studio Tips & Tricks by Moshfegh Hamedani

VS 2012 migration – neither a trek nor a joyride. Lately, my team and I worked on migrating our entire codebase to Visual Studio 2012.

VS 2012 migration – neither a trek nor a joyride

I would like to share with you some of my thoughts on the process, and some tips you may find very helpful if you are thinking of upgrading your application, even if you are already under way. Creating graphs in WPF using OxyPlot. For one of our projects we had to retrieve data from an external source and store them in a database.

Creating graphs in WPF using OxyPlot

One of the requests from the client was to see the retrieved data in a graph. Furthermore, he wanted to see a live update every second of the retrieved data in that graph. After some searching I found the OxyPlot library. This library can be used in WPF, Silverlight, Windows Forms and even in Windows Store apps. The are now working on a alpha release for Mono. Although the package is already downloaded more then 10 000 times there are not so many blog posts to find about implementing the library.

The easiest way to include OxyPlot in you application is by using the Nuget package manager in Visual Studio. Open op Visual Studio and start with creating a new WPF project. After the project is created open up the Package Manager Console and type following commands at the prompt and hit enter (after every command): Install-Package Oxyplot.Core Install-Package Oxyplot.Wpf. Example Browser. WPF Example. This example shows how to create a WPF application where the content of the plot is defined in XAML.

WPF Example

Oxyplot.org. Dynamic Splash Screens in WPF. There's a lot going on when an EliteForm PowerTracker starts up.

Dynamic Splash Screens in WPF

Some of it isn't our code, but some of it is. Here's a high-level list of what happens: Load PowerTrackerLoad environment fileRegister eventsInitialize background workersInitialize queuesRetrieve saved user optionsCheck internet connectivityFetch team data and icons from the server or cacheRegister Coach's Tablet (if enabled)Set up periodic health checksInitialize camerasInitialize views and view models The PowerTracker is usually running when an athlete steps up to the rack so they usually never see the splash screen we display when all of the above events occur. Prism EventAggregator Sample. Download source code - 71 KB Introduction I was very frustrated by how difficult it was to understand the Prism Event Aggregator from information available on the Internet.

Prism EventAggregator Sample

Patterns & practices: Prism - Home. Dynamic Splash Screens in WPF.

DB

Test. Archi. Ninject - Open source dependency injector for .NET. ExcelPackage: Office Open XML Format file creation - Home. GemBox.Spreadsheet .NET Excel Component Purchasing Information. Prices for GemBox.Spreadsheet product include: Royalty-free deployment (no server or OEM licenses)2 years of free technical support (response within one business day)2 years of free bug fixes / quick fixes To see a price in other currencies, click on “Buy now” link and select your currency. * distinct physical location is defined as location that has a unique postal address.

GemBox.Spreadsheet .NET Excel Component Purchasing Information

To read more about licenses visit Knowledgebase Licensing questions section or contact our sales department. Purchase policy We use Electronic Software Delivery (ESD), so you will be able to work with the full version of our product after sales transaction is completed. Some credit cards require additional authorization from FastSpring staff. Before installing, you will have to agree with our product EULA (End User License Agreement). Product upgrade policy. ExcelPackage: Office Open XML Format file creation - Home. A complete Impersonation Demo in C#.NET. Download Impersonate.zip - 4.5 KB Under some scenarios, we need to impersonate another Windows account and do some work under that user’s session, for example: An enterprise ASP.NET web application provides server administrators’ ability to access the server under some specific privilege set; Server admin inputs their NT account information (domain\account + password) on the page, we need to get WinNT Access Token and then impersonate this server user, so that we acquire its specific privilege and do the things ONLY THIS ACCOUNT CAN DO.

A complete Impersonation Demo in C#.NET

We developed a Windows Service which needs internet access periodically, but a specific user sets an Sock5 proxy to access internet, then your Windows Service needs to know the Socks proxy information so that it could access internet, you must impersonate this user and read the settings. Impersonation Definition Impersonation is the ability of a thread to execute using different security information than the process that owns the thread. Functionality. Basic Authentication <basicAuthentication> Overview The <basicAuthentication> element contains configuration settings for the Internet Information Services (IIS) 7 Basic authentication module.

Basic Authentication <basicAuthentication>

You configure this element to enable or disable Basic authentication, identify the realm and default logon domain, and determine the logon method the module uses. The Basic authentication scheme is a widely used, industry-standard method for collecting user name and password information. Basic authentication transmits user names and passwords across the network in an unencrypted form. You can use SSL encryption in combination with Basic authentication to help secure user account information transmitted across the Internet or a corporate network. Compatibility Setup The default installation of IIS 7 does not include the Basic authentication role service.

To install the Basic authentication role service, use the following steps.

Active directory