.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Need access to Env.DTE from a property value editor.

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :WPF

Hi to all!

I have created a custom property value editor based on PropertyValueEditor. I've attached it to my property type through design-time assembly and my property editor is shown in Property window when I select my control.

The problem is that in the property editor I need to list the names of all those files included in the actual solution that have a specific extension.

How can I do that?

In Winform Property Editors (extending UITypeEditor) I have access to IServiceProvider and I could manage to get Env.DTE and solve the problem, but in WPF or SL I couldn't.




View Complete Post

More Related Resource Links

Access the SQL Command Query Value Property from the OLEDB Container within a Script Task

Hello, I'd like to Access the SQL Command Query Value Property from the OLEDB Container within a Script Task so I can audit the queries which are executing. What is the syntax for this or does anyone have a sample on how to do this? Thank you

Generic Casting to access Text property


I have a situation where I'm iterating through all the controls on a form, specifically looking out for any of these three types of controls:  Labels, TextBoxes, CheckBoxes

I can, of course, get the type of the control and then use a Switch-Case construct to cast labels as Labels, textboxes as TextBoxes, and checkboxes as CheckBoxes.

But I'm wondering if there's a way to do something with one or two lines of code to gain access to the Text property of each of these controls?

I'm guessing this isn't possible but thought I'd ask to be sure,


Problem with property editor of a web user control



I created an asp.net user control with a property named 'TabList' , the property is visible when I place my control on a page, the default editor for this property was a simple text box, but I needed a DropDownList for editing the TabList property of my control, so I added following code to implement it:

<Category("Navigation Bar"), Editor(GetType(DropDownList), GetType(System.Drawing.Design.UITypeEditor)), Description("List of Tabs"), DefaultValue("SHISHIR WAHI")> Public Property TabList() As String
            Return _tablist
        End Get

        Set(ByVal value As String)
            _tablist = value
        End Set
    End Property

The Category() and DefaultValue() are working fine but Editor() and Description() are not, what could be the problem?

Please help.

WF4.0 Custom Activity - Property Editor or TypeConverter



As part of my custom activity development, I have a requirement to change the value of one property acording to another property's value.

For example, I have two properties- Position and Qualification in my custom activity. Once I select a position, the qualification should change according to the selected position value. Both, Position and Qualification  are string properties and the value of Position is populated with a TypeConverter. 

I tried with TypeConverter for Qualification property too. Issue is how to refresh the Qualification values on change of Position property?

I tried with PropertyEditor also. But not sure how to pass the data from my ActivityDesigner to PropertyEditor. I am handling the ModelItem.PropertyChanged event and getting the Qualification values. How to pass this values either to my TypeConverter or to My PropertyEditor?

PropertyEditor Code is as follows


How can i access claaes Property values in xml file ?



actually i am creating sitemap.sitemap is actually an xml file.And i have stored each page's url  of my project as Public shared property of a class.Now while creating sitemap xml file i want to get access to those property on my class, so that url should not be hardcoded.How can i do that ?

Please help .

Unable to access custom extended property


When I try to access the .ExtendedProperties["RequestChangeRequired"].ToString() in the onTaskChanged_Invoked method on a workflow I get the error:  "Object Not Set To Instance of an Object".

I have a custom content type on a task list in a custom workflow.  I want to set my Task to either Approved, Major Change or Minor Change.  So i have 3 buttons on the .aspx page for the content type when the users edit the task.  If they click the Minor button the following code is executed:

public void BtnMinor_Click(object sender, EventArgs e)
            Hashtable taskHash = new Hashtable();
            taskHash["RequestReviewerComment"] = RequestReviewerComment.Text;
            taskHash["RequestApproved"] = "false";
            taskHash["RequestChangeRequired"] = "minor";
            taskHash["Approved"] = "false";
            taskHash["Status"] = "complete";
            SPWorkflowTask.AlterTask(m_task, taskHash, true);

            SPUtility.Redirect(List.DefaultViewUrl, SPRedirectFlags.UseSource, HttpContext.Current);

Then in my onTaskChanged_Invoked method the following code is executed but it fals when it tries to access the "RequestChangeRequired

How to access property values in the model that you are binding to? - Help!


From within a custom modelBinder (derived from DefaultModelBinder), how do I access the existing values of properties in the model into which the new values are being injected?

Thanks in advance for your help!

Access property of object as session variable as declarative datasource parameter value


I am storing a custom "Organisation" object as a session variable. One of the properties of  the Organisation object is "OrganisationID" (integer).

I have a DataSource that requires a parameter value to run, and I want to use a SessionParameter to populate this. In a previous version, I stored the OrganisationID directly as a session variable. In that case, I could easily access it like this:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    SelectCommand="spGetUserJobList" SelectCommandType="StoredProcedure">
        <asp:SessionParameter Name="OrganisationID" SessionField="OrganisationID" Type="Int32" />

However, how do I now access the OrganisationID property of an "Organisation" type session variable (called "Organisation")?

 I have tried this, which does not seem to work:

<asp:SessionParameter Name="OrganisationID" SessionField="Organisation.OrganisationID" Type="Int32" />


ManagedProperty requires access to SharePoint database to set FullTextQueryable property


I have the following method below to set the FullTextQueryable property on a ManagedProperty

  public class Search
    /// <summary>
    /// Set a managed property to be both queriable and retrievable.
    /// </summary>
    /// <param name="managedProperty">The name of the property</param>
    /// <param name="makeFullTextQueriable"></param>
    public static void SetManagedPropertyFullTextQueriable(string managedProperty, bool makeFullTextQueriable)


      SearchService searchService = SearchService.Service;

      SearchServiceApplication searchApp = searchService.SearchApplications.GetValue<SearchServiceApplication>(

Toolbar Items Collection Editor: "Property editing not available" and Add disabled


I'm working on a WPF project in VS2010 and I am finding that the property editor is not behaving the way I expect (i.e. as it would for a WinForm app).

For example, I can manually edit the XAML to add items to a Toolbar, but if I open the Item Collection from the Properties window, I cannot make any changes. The Collection Editor says "Property editing not available."

If I manually add an Item, I can then edit its properties in the collection editor, but the Add option is still disabled. I could understand the first behavior since their weren't any items, but not the Add button being disabled (in both cases).

Thanks in advance.

- cawood

 blog |  twitter

Why does VS 2010's designer clear my property value editor's properties when it is dismissed?

(This started as a Connect post but I decided it seems like I should find out if I'm doing something daft before blaming .NET.  It requires a lot of code, and Connect lets you attach projects.  I see no option to do this on these forums, so I will link to a .zip file containing the project on my hosting.)

I'm experimenting with various ideas for the design-time experience for some WPF controls.  One feature I'm trying to implement is the display of a graphical preview for enumeration values.  My first attempt at this failed due to some behaviors in the design environment that I'm not certain are expected.  Here's a description of the attached project and the behaviors I don't understand.

PreviewItem is a class that represents an enumeration value; it has properties for the value and the image that represents it.PreviewItemCollection is a collection class that contains a PreviewItem for each valid enumeration value; it relies on an implementation of PreviewItemFactory.  PreviewItemFactory is responsible for generating a collection based on an enumeration that contains one PreviewItem per enumeration value. EnumPreview is a UserControl that maintains a PreviewItemCollection and displays each PreviewItem in a ComboBox.  It contains logic for representing the selected value as the enumeration value (not a PreviewItem).  To facilitate this, when the Selec

What does "property" direction of arguments editor in WF designer mean?


When you use the WF designer for managing Arguments, the direction column has several options including "in", "in/out", "out" and "property".  What does the "property" choice mean?

Thank you,


Custom inline collection property editor with ExpressionTextBox


I need to create an inline collection editor inside property grid. My custom code acvitity and argument type is as bellow.

public class WorkItemOwner
  public InArgument<string> OwnerName { get; set; }
  public WorkItemOwner()
    this.OwnerName = new InArgument<string>();

public class WorkToDo : CodeActivity
  [Editor(typeof(WorkToDoOwnerEditor), typeof(PropertyValueEditor))]
  public Collection<WorkItemOwner> WorkItemOwners { get; set; }

  public WorkToDo()
    this.WorkItemOwners = new Collection<WorkItemOwner>();

  protected override 

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

WPF / Silverlight tutorial: Visibility property and binding

Visibility property is a very powerful and yet often overlooked property available in both WPF and Silverlight. It enables you to set Visibility of certain UIElement objects to different states like: Visible, Collapsed and Hidden (not supported by Silverlight). This tutorial shows you how to use it and how to bind to Visibility property

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend