<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Dotnet Code on Chris McKelt - Remembering Thoughts</title><link>https://blog.smarttechventures.au/tags/dotnet-code/</link><description>Recent content in Dotnet Code on Chris McKelt - Remembering Thoughts</description><generator>Hugo -- 0.147.2</generator><language>en</language><lastBuildDate>Wed, 08 Jul 2009 00:00:00 +0800</lastBuildDate><atom:link href="https://blog.smarttechventures.au/tags/dotnet-code/index.xml" rel="self" type="application/rss+xml"/><item><title>Extensions Methods</title><link>https://blog.smarttechventures.au/articles/posts/extensions-methods/</link><pubDate>Wed, 08 Jul 2009 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/extensions-methods/</guid><description>&lt;p>All these extension methods are now contained here&lt;/p>
&lt;p>&lt;a href="https://github.com/chrismckelt/ExtensionMinder" target="_blank">https://github.com/chrismckelt/ExtensionMinder&lt;/a>&lt;/p>
&lt;p>and available on nuget at&lt;/p>
&lt;p>&lt;a href="https://www.nuget.org/packages/ExtensionMinder/" target="_blank">https://www.nuget.org/packages/ExtensionMinder/&lt;/a>&lt;/p></description></item><item><title>Winforms UI cross thread operations</title><link>https://blog.smarttechventures.au/articles/posts/winforms-ui-cross-thread-operations/</link><pubDate>Fri, 27 Feb 2009 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/winforms-ui-cross-thread-operations/</guid><description>&lt;blockquote>
&lt;pre>&lt;code>ThreadPool.QueueUserWorkItem(new WaitCallback(LoadUsers));
private void LoadUsers(Object stateInfo)
{
var site = new SPSite(testHarnessSettings.Url);
var web = site.OpenWeb();
foreach(SPUser user in web.AllUsers)
{
if (usersListBox.InvokeRequired)
{
usersListBox.Invoke(
new MethodInvoker(
delegate { usersListBox.Items.Add((user.LoginName));
}));
}
}
&lt;/code>&lt;/pre>&lt;/blockquote></description></item><item><title>How to use DB Deploy</title><link>https://blog.smarttechventures.au/articles/posts/how-to-use-db-deploy/</link><pubDate>Thu, 28 Aug 2008 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/how-to-use-db-deploy/</guid><description>&lt;p>Here is a quick example of how to use &lt;a href="http://dbdeploy.com/" title="http://dbdeploy.com/" target="_blank">DB Deploy&lt;/a>&lt;/p>
&lt;p>This example uses NANT to run DBDeploy which in turn generates the &lt;em>output.sql&lt;/em> file.  This is then run against the database causing our changes to be run in and putting an entry in the ChangeLog table to tell you which sql files have been run.&lt;/p>
&lt;p>To run this sample&lt;/p>
&lt;ol>
&lt;li>Download to a location on your computer e.g. &lt;em>C:\Examples\DBDeployExample&lt;/em>&lt;/li>
&lt;li>Create a database onyour localhost called &lt;em>DBDeployExample&lt;/em>&lt;/li>
&lt;li>In a command prompt (Or &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx" title="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx" target="_blank">PowerShell&lt;/a>) use &lt;a href="http://nant.sourceforge.net/" title="http://nant.sourceforge.net/" target="_blank">NANT&lt;/a> to build the solution &amp;ndash;(I have this setup as an environment variable setup and simply type &amp;lsquo;NANT&amp;rsquo;)&lt;/li>
&lt;li>NANT will build the default.build file and run the database changes&lt;/li>
&lt;/ol>
&lt;p>Opening the solution file looks like this&lt;/p></description></item><item><title>Impersonation in Microsoft Dot Net</title><link>https://blog.smarttechventures.au/articles/posts/impersonation-in-microsoft-dot-net/</link><pubDate>Mon, 28 Jul 2008 00:00:00 +0800</pubDate><guid>https://blog.smarttechventures.au/articles/posts/impersonation-in-microsoft-dot-net/</guid><description>&lt;p>&lt;em>&lt;strong>Usage&lt;/strong>&lt;/em>&lt;/p>
&lt;pre>&lt;code>string domain = &amp;quot;ExampleDomain&amp;quot;;
string userName = &amp;quot;ExampleUserName&amp;quot;;
string password = &amp;quot;ExamplePassword&amp;quot;;
using (Impersonation impersonation = new Impersonation(domain, userName, password))
{
// impersonation occuring in here
Console.WriteLine(System.Security.Principal.WindowsIdentity.GetCurrent().Name);
}
&lt;/code>&lt;/pre>
&lt;p>&lt;em>&lt;strong>Implementation&lt;/strong>&lt;/em>&lt;/p>
&lt;script src="https://gist.github.com/chrismckelt/846be3c45554f20263daf3c6173da2c1.js">&lt;/script></description></item></channel></rss>