regions

Hiding the regions in Visual Studio

I know VS code folding issues are an old chestnut, but I haven't been able to find this in all the other discussions I have browsed through: We have a team of C# guys, some love regions and others hate them and we don't seem to have much middle ground to work with. Is there a plug- or add-in for VS that will just 'hide' the regions? S...

Would you use regions within long switch/enum declarations?

I've recently found myself needing (yes, needing) to define absurdly long switch statements and enum declarations in C# code, but I'm wondering what people feel is the best way to split them into logical subsections. In my situation, both the enum values and the cases (which are based on the enum values) have fairly clear groupings, yet ...

Nested menu regions in Composite WPF application

Is it possible to have nested regions in a Composite WPF application? I want modules to be able to inject new menus, and also be able to inject menu items into an existing menu. Using the following code the RegionManager throws an exception saying "The region manager does not contain the MainFileMenuRegion region": <Menu cal:RegionMana...

how to organize the code similar to #region/#endregion in .NET?

Hi, While the code is growing big it is getting harder and harder to keep everything well organized. One thing I liked very much the time I developed in .NET was #region/#endregion which enabled to organize the code in logical groups and made further organization much easier. Does anyone know whether there is any similar code organizat...

How to change the color of a #region in Visual Studio's 2008

I maybe going mad, but for the life of me I can't find the option to change the colour of collapsed region's in VS2008. For example if I have the following code: '#region Test Region CallSomeCode(); '#endregion If I now collapse that region it has the title "Test Region" in a grey text color with a grey box around it. ...

How to change the color of expanded regions' titles in VS2008?

I would like to know if is there a way to change the color of expanded regions' titles in VS2008. Even by using a third part plug-in. #region My Region Title //I want this text to be in a customized color public void Foo() { //Bla bla bla } #endregion Does anyone know how to do it? ...

How to get [#]region structure from (Document, ProjectItem, FileCodeModel in EnvDTE)

Hi to all, I'm developing the integrated Package which show structure of code (C#, VB) in TreeView of my control window. I found a SourceCodeOutliner project in (http://www.codeplex.com/SourceCodeOutliner) and translate it to C#. I'd learn how to get a project structure for file, but at now I want to add into my treeView [#]regions s...

Converting vector-contoured regions (borders) to a raster map (pixel grid)

I have a map that is cut up into a number of regions by borders (contours) like countries on a world map. Each region has a certain surface-cover class S (e.g. 0 for water, 0.03 for grass...). The borders are defined by: what value of S is on either side of it (0.03 on one side, 0.0 on the other, in the example below) how many points t...

SSRS multiple data regions in one report

I'm trying to use SSRS to print a "batch" of 1-page invoices. The invoice has a "header" that lays out well in a list data region linked to dataset1. The "detail" section lays out well in a table data region linked to adataset2. Dataset 2 have a FK reference field to dataset1. I've tried using parameters to pass the values of the "...

MVVM Prism Nested Regions Can't Find Child Regions

I have a Menu (Telerik RadMenu) that has nested regions defined in the Shell. In my modules I will register the modules menu or toolbar items with these regions. Everything works fine for the root regions, but when I try and add something to a child region, such as the File region on the Menu, I get the error "The exception message was: ...

Any .NET '#region directive' convention ideas ?

I really appreciate the possibility to define regions in your code, as it improves the readability insanely. Anyways, I'd like to have everyone using the same convention in all classes (with the predefined order of all regions) like: Private Fields Constructors Class Properties Event Handlers etc... Do you have any proposition how ...

How to avoid coupling when using regions in Composite WPF

I have an application designed using Microsoft's Composite Application Library. My shell has several regions defined so that I can inject content from separate modules. I'm looking for a design pattern that will reduce the coupling that these regions introduce. In all examples I have seen, regions are defined and accessed using a string...

Is it possible get the functionality of namespaces inside a class?

I have the following code: Public Class Form1 Private Function Step1_Execute() As Boolean Return Step1_Verify() End Function Private Function Step1_Verify() As Boolean Return True End Function Private Function Step2_Execute() As Boolean Return Step2_Verify() End Function Private Function Step2_Verify() As Boolean Retu...

Is it possible to modify the Navigation Bar in Visual Studio, or to otherwise add a similar graphical element to the code editor?

I like the grouping and browsability that regions provide in C# code but don't like the manual process of maintaining them (even auto-formatting tools are not perfect as they take awhile for large files), and other developers don't like them at all, so a better solution would be one that is done automatically by the IDE and without touch...

CSS editor with collapsable regions

Is there any way to get Visual Studio to put collapsable regions in CSS files? Or can someone recommend an alternative (free) editor that offers this? ...

is it OK to use begin/end in Ruby the way I would use #region in C#?

I've recently moved from C# to Ruby, and I find myself missing the ability to make collapsible, labelled regions of code. It just occurred to me that it ought to be OK to do this sort of thing: class Example begin # a group of methods def method1 .. end def method2 .. end end def method3 .. e...

CoreLocation: monitor only certain regions at a time

In my iPhone app I'd like to monitor if the user enters some particular geographycal regions at a time and act consequently. I now saw that with the new iOS 4 it is possible to register some interest regions (CLRegion) to a CLLocationManager, so it would do some job for me, but... I'd also need to dynamically change the set of the regio...

Prism, Regions, Magic strings and refactoring : am I missing something here ?

Hello, chaps. To build a composite application view in my application, with different regions, untill now, I've always used content presenter and used DataBinding to set its content. If I wanted to change its content, I would just have to use an event aggregator, publish a ViewZoneChangedEvent, subscribe to it in the "shell" window, an...

SQL: list of points to rectangle

I have two tables: regions <id> points <region_id, x, y> Assuming there are exactly 4 points per region, and these points describe a rectangle -- is there an SQL query that will bring me this view: rectangular_regions <region_id, x1, y1, x2, y2> ? ...

Country/State/City Database?

Ok, this one is a non technical question. I am creating a business directory and I'd like to categorize listings by location. Instead of giving users an option to enter the location, I am going to provide them with a list of locations which follow a Country/State/City format. I tried GeoWorldMap by GeoBytes. It looked promising in the be...