ModuleListPageFilter Constructors

Definition

Initializes a new instance of the ModuleListPageFilter class.

Overloads

ModuleListPageFilter(String)

Initializes a new instance of the ModuleListPageFilter class with the specified filter description.

ModuleListPageFilter(String, Boolean)

Initializes a new instance of the ModuleListPageFilter class with the specified filter description and remove-filter status.

ModuleListPageFilter(String)

Initializes a new instance of the ModuleListPageFilter class with the specified filter description.

public:
 ModuleListPageFilter(System::String ^ description);
public ModuleListPageFilter (string description);
new Microsoft.Web.Management.Client.ModuleListPageFilter : string -> Microsoft.Web.Management.Client.ModuleListPageFilter
Public Sub New (description As String)

Parameters

description
String

A description of the filter.

Examples

The following example initializes a ModuleListPageFilter object with data saved in a Microsoft.Web.Management.Server.PropertyBag object.


  class DemoPage : ModuleListPage {

      public DemoPage() : base() { }
      ModuleListPageGrouping _entryTypeGrouping;
      private ModuleListPageSearchField[] _searchFields;

      // contains filter string and a ModuleListPageFilter
      private MyModuleListPageFilter _filter;
      ModuleListPageFilter _selectedFilter;
      string sDate = "8-2-07";

internal class MyModuleListPageFilter {

    ModuleListPageFilter _modListPgFilter;
    string _curSelectedFilter;

    public MyModuleListPageFilter(string description)
        : this(description, false) {
    }

    public MyModuleListPageFilter(string description, bool canRemove) {
        if ((description == null) || (description.Length == 0)) {
            throw new ArgumentNullException("description");
        }

        _modListPgFilter = new ModuleListPageFilter(description, canRemove);
    }

    public ModuleListPageFilter ModLstPgFilter {
        get { return _modListPgFilter; }
    }

    public string FilterStr {
        get { return _curSelectedFilter; }
        set { _curSelectedFilter = value; }
    }
} 
public string DefaultFilter() { return ".net"; }
void Initialize(object navigationData) {

    base.Initialize(navigationData);
    PreferencesStore store = GetPrefStore();
    LoadPreferences(store);
    string curSelectedFilter = string.Empty;

    if (navigationData != null) {
        if (navigationData is PropertyBag) {
            PropertyBag tempBag = (PropertyBag)navigationData;
            if ((string)tempBag[0] == "navigate") {
                curSelectedFilter = (string)tempBag[2];
            }
        }
    }

    if (String.IsNullOrEmpty(curSelectedFilter))
        curSelectedFilter = DefaultFilter();

    _filter = new MyModuleListPageFilter(
        "The results have been filtered by" +
          curSelectedFilter);
    _filter.FilterStr = curSelectedFilter;

} 

Applies to

ModuleListPageFilter(String, Boolean)

Initializes a new instance of the ModuleListPageFilter class with the specified filter description and remove-filter status.

public:
 ModuleListPageFilter(System::String ^ description, bool canRemove);
public ModuleListPageFilter (string description, bool canRemove);
new Microsoft.Web.Management.Client.ModuleListPageFilter : string * bool -> Microsoft.Web.Management.Client.ModuleListPageFilter
Public Sub New (description As String, canRemove As Boolean)

Parameters

description
String

A description of the filter.

canRemove
Boolean

true if the filter can be removed; otherwise, false.

Examples

The following example initializes a ModuleListPageFilter object with data saved in a Microsoft.Web.Management.Server.PropertyBag object.


  class DemoPage : ModuleListPage {

      public DemoPage() : base() { }
      ModuleListPageGrouping _entryTypeGrouping;
      private ModuleListPageSearchField[] _searchFields;

      // contains filter string and a ModuleListPageFilter
      private MyModuleListPageFilter _filter;
      ModuleListPageFilter _selectedFilter;
      string sDate = "8-2-07";

internal class MyModuleListPageFilter {

    ModuleListPageFilter _modListPgFilter;
    string _curSelectedFilter;

    public MyModuleListPageFilter(string description)
        : this(description, false) {
    }

    public MyModuleListPageFilter(string description, bool canRemove) {
        if ((description == null) || (description.Length == 0)) {
            throw new ArgumentNullException("description");
        }

        _modListPgFilter = new ModuleListPageFilter(description, canRemove);
    }

    public ModuleListPageFilter ModLstPgFilter {
        get { return _modListPgFilter; }
    }

    public string FilterStr {
        get { return _curSelectedFilter; }
        set { _curSelectedFilter = value; }
    }
} 
public string DefaultFilter() { return ".net"; }
protected override void Initialize(object navigationData) {

    base.Initialize(navigationData);
    PreferencesStore store = GetPrefStore();
    LoadPreferences(store);
    string curSelectedFilter = string.Empty;

    if (navigationData != null) {
        if (navigationData is PropertyBag) {
            PropertyBag tempBag = (PropertyBag)navigationData;
            if ((string)tempBag[0] == "navigate") {
                curSelectedFilter = (string)tempBag[2];
            }
        }
    }

    if (String.IsNullOrEmpty(curSelectedFilter))
        curSelectedFilter = DefaultFilter();

    _filter = new MyModuleListPageFilter(
        "The results have been filtered by" +
          curSelectedFilter, true);
    _filter.FilterStr = curSelectedFilter;

}

Applies to