Posts

Showing posts with the label C#

Probing element in app.config + Post build event to copy multiple files

Probing is quite good to arrange assemblies in case if you have lots of private libraries referred to your executables and which are there under a probing path mentioned under the probing element in app.config file When I started developing an executable , which demands to split its logic among several dlls and which are part of same solution and are deployed using simple xcopy method I found it quite convenent to use probing path combined with postbuild script under project properties section of the main executable file . Here in my example project, I have a dll project and an executable , which has been refered by the executable project in the same solution The following post-script build script save me from copying the required files into Binaries\Libs folder strcuture under the current selected build method(Release/Debug) . This is quite convenient in case to perform an xcopy of your binaries to the deployment folder. All the unwanted .vshost , pdb,manifest etc  files...

.NET 4.5 Beta- WPF Changes

The new Ribbon control, which enables you to implement a ribbon user interface that hosts a Quick Access Toolbar, Application Menu, and tabs. The new INotifyDataErrorInfo interface, which supports synchronous and asynchronous data validation. New features for the VirtualizingPanel and Dispatcher classes. Improved performance when displaying large sets of grouped data, and by accessing collections on non-UI threads. Data binding to static properties, data binding to custom types that implement the ICustomTypeProvider interface, and retrieval of data binding information from a binding expression. Repositioning of data as the values change (live shaping). Ability to check whether the data context for an item container is disconnected. Ability to set the amount of time that should elapse between property changes and data source updates. Improved support for implementing weak event patterns. Also, events can now accept markup extensions. http://msdn.microsoft.com/en-us/library/bb613588(v=vs...

Map more than one sitemap in asp.net webform

How to map more than one  sitemap in same asp.net webforms application ? If there are  multiple sitemap in an asp.net application eg: for your administrator you need to show entirely different set of menu compared to normal user . After adding following entry in web.config will help in using multiple sitemap, you can have 2 different sitemap files named AppDefaultMap.sitemap and AdminSitemap.sitemap (remember by default we can have only one web.sitemap file in our project)                         name="AppDefaultSiteMap"           type="System.Web.XmlSiteMapProvider"           siteMapFile="~/Application.sitemap" />                    name="AdminSitemap"           type="System.Web.XmlSiteMapProvider"           siteMapFile="~/AdminMenu.sitemap" /> --keep posting.

Swap mouse button

Code to swap the mouse button's action using System; using System.Runtime.InteropServices; using System.Windows.Forms; namespace MouseSwap /// Summary description for Class1. /// class Class1 { [DllImport("user32.dll")] static extern bool SwapMouseButton(bool fSwap); /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { bool b; using(System.Threading.Mutex m=new System.Threading.Mutex(true, "ajai_myname_is Different _guid",out b)) { if(!b) { MessageBox.Show("An Instance Already Runnig!","Error", MessageBoxButtons.OK,MessageBoxIcon.Stop); return; }    Console.WriteLine("Swapping Primary Button From {0}",System.Windows.Forms. SystemInformation.MouseButtonsSwapped?"Right to Left":"Left to Right");    SwapMouseButton(!System.Windows.Forms.SystemInformation. MouseButtonsSwapped);    Console.WriteLine("Swapped\n\a\a \t \n Developed by Ajai NP"); }} } } --keep posi...