Close the Current File in Visual Studio

יום רביעי, יולי 30, 2008

Close the Current File in Visual Studio I spend many hours a day working with Visual Studio 2008 and the Office Product. What I most like from the user experience perspective is to have the same shortcuts and key-bindings, no matter which application I am currently using. In Office Applications I use the shortcut Ctrl + W to close the current window and I have always wanted this shortcut to work inside Visual Studio. Today I created this key-binding for my self. If you want to create yours: Go...
no comments

Copy Source As Html (CopySourceAsHtml) on VPC

יום חמישי, אפריל 24, 2008

Copy Source As Html (CopySourceAsHtml) on VPC I've been using Copy Source As Html (CopySourceAsHtml) for Visual Studio 2008 RTM for a while, but recently tried to work with it on a Virtual PC (VPC). When I tried copying a code snippet to the clipboard I ran into an exception: "Requested Clipboard operation did not succeed." I found the code that I had to change in Mike Glaser's Blog, but to make thinks a little shorter: 1. Download this ZIP file that contains the add in. 2. Extract it to the following folders: ...
no comments

Compare .Net Assemblies with Framework Design Studio

יום חמישי, אפריל 17, 2008

Compare .Net Assemblies with Framework Design Studio Trying to keep up with all the Alphas, Betas and CTP's, I was looking for a tool that will help me to compare .Net assemblies so that I can easily spot what's new in each drop. Just when I didn't find a suitable tool and was about to write one for my self, I noticed Framework Design Studio, by Krzysztof Cwalina, Hongping Lim and David Fowler. From the Framework Design Studio Home Page: "Framework Design Studio is a set of tools for reusable library designers....
no comments

Linq to SQL Like Operator

יום שלישי, אוקטובר 16, 2007

Linq to SQL Like Operator As a response for customer's question, I decided to write about using Like Operator in Linq to SQL queries. Starting from a simple query from Northwind Database; var query = from c in ctx.Customers             where c.City == "London"             select c; The query that will be sent to the database will be: SELECT CustomerID, CompanyName, ...FROM    dbo.Customers WHERE  City = There are some ways to write a Linq query that reaults in using Like Operator in the SQL statement: 1. Using String.StartsWith or String.Endswith Writing the following query: var query = from c in ctx.Customers             where c.City.StartsWith("Lo")             select c; will generate this SQL statement:SELECT...

הוספת קוד לפוסטים – איך לעשות את זה נכון

יום שני, ספטמבר 3, 2007

הוספת קוד לפוסטים - איך לעשות את זה נכון פוסט זה הוא פוסט המשך בסדרה "טיפים וטריקים: כתיבת פוסטים באתר הבלוגים". באפריל האחרון פיסרמתי את הפוסט אליה וקוד בה... המדבר על הוספת קטעי קוד לפוסטים ע"י שימוש ב- Windows Live Writer. מאז השתנו מספר דברים, יצאה גירסא חדשה של Windows Live Writer וגם גירסא חדשה של Visual Studio, ולכן החלטתי לכתוב על הנושא פעם נוספת. כאשר מנסים לעשות Copy & Paste של קטע קוד מתוך Visual Studio לפוסט ב- WLW, זה יראה ככה: static void Main(){    Application.EnableVisualStyles();    Application.SetCompatibleTextRenderingDefault(false);    Application.Run(new Form1());} כלומר ללא הפורמט (צבעים + סוג פונט) שהופכים את קוד לקריא עבור מפתחים. על מנת להעתיק...

Orcas Datasets – Separate Datasets from TableAdapters

יום שבת, מאי 19, 2007

Orcas Datasets - Separate Datasets from TableAdapters In Visual Studio 2005, we were introduced to the new DataSet Designer, that also generated a TableAdapter for each DataTable in the DataSet.   Along with this great way of creating Data Access Layer for easily, there was a big problem. The Table adapters and the generated Data set are inseparatable which means that when you expose your business entities to the client side or another services, you also expose your data access layer with the connection info inside. This is both a security issue and a software engineering problem. After receiving some feedback about these problems, Visual...

VS2005 Tip: Nest files for partial classes

יום שני, ספטמבר 25, 2006

Partial classes are a great new feature in Visual Studio 2005. They allow the definition of a class, struct or interface to be split into multiple files. You usually find partial classes when using some kind of a designer, such as Windows Forms Designer, or DataSet Designer, but sometimes you just want to split your class to separate files (maybe to allow some developers work simultaneously on the same file in source control).   In order to arrange the solution a little bit, Instead of keeping all files of the same partial class in the same tree level, you can nest them...

VS2005 Tip: Open files quickly

יום רביעי, אוגוסט 23, 2006

When you have large solutions that have many files, even if you arrange your files in folders, they are sometimes very difficult to find...   If you know the full name of the file you want to open (for example Program.cs), you can go to the Find ComboBox in the Standard toolbar. (You can go directly to this combo box using Ctrl + / keystroke). Then type your file name and hit Ctrl + Shift + G. Your file will be opened in a new tab. If it is already open, it will be focused.   If the file name is too long, or...
no comments

Reflector for .NET is a great tool!

יום ראשון, יוני 18, 2006

When exploring new technologies, You often wonder what is really written in the assemblies  you reference.   Currently, exploring WF and WCF along many other exiting new technologies, I am working with a great tool that I want to share with you: Reflector for .NET. Reflector is the class browser, explorer, analyzer and documentation viewer for .NET. Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL.   So, If you want to know all about how System.Windows.Forms.Control is implemented, and how serialization works, Download this excellent yet simple tool. Enjoy!
no comments