/// <summary> /// Initializes a new instance of the WizardPageDescriptor class /// </summary> /// <param name="type">The type of the WizardPage that will be desribed (The Type must implement IWizardPage)</param> public WizardPageDescriptor(Type type) { // create an attribute reader to read the metadata supplied by the type WizardPageAttributeReader reader = new WizardPageAttributeReader(type); // throw an exception if the type does not implement IWizardPage if (type.GetInterface(typeof(IWizardPage).FullName) == null) throw new ArgumentException("Type type", "The type must implement the IWizardPage interface"); // read any metadata supplied to us by the type about the wizard page contained therein _type = type; _title = reader.GetTitle(); _buttonStyles = reader.GetButtonStyleList(); // _manuallySelectsPath = reader.GetManuallySelectsPath(); }
/// <summary> /// Returns the button style list that applies to the wizard page /// </summary> /// <returns></returns> public WizardButtonStyleList GetButtonStyleList() { WizardButtonStyleList styleList = new WizardButtonStyleList(); try { object[] attributes = _type.GetCustomAttributes(typeof(WizardPageButtonStyleAttribute), false); if (attributes != null) foreach(WizardPageButtonStyleAttribute a in attributes) styleList.Add(a.Style); } catch(Exception ex) { Trace.WriteLine(ex); } return styleList; }
/// <summary> /// Initializes a new instance of the WizardPageDescriptor class /// </summary> /// <param name="type">The type of the WizardPage that will be desribed (The Type must implement IWizardPage)</param> public WizardPageDescriptor(Type type) { // create an attribute reader to read the metadata supplied by the type WizardPageAttributeReader reader = new WizardPageAttributeReader(type); // throw an exception if the type does not implement IWizardPage if (type.GetInterface(typeof(IWizardPage).FullName) == null) { throw new ArgumentException("Type type", "The type must implement the IWizardPage interface"); } // read any metadata supplied to us by the type about the wizard page contained therein _type = type; _title = reader.GetTitle(); _buttonStyles = reader.GetButtonStyleList(); // _manuallySelectsPath = reader.GetManuallySelectsPath(); }
/// <summary> /// Returns the button style list that applies to the wizard page /// </summary> /// <returns></returns> public WizardButtonStyleList GetButtonStyleList() { WizardButtonStyleList styleList = new WizardButtonStyleList(); try { object[] attributes = _type.GetCustomAttributes(typeof(WizardPageButtonStyleAttribute), false); if (attributes != null) { foreach (WizardPageButtonStyleAttribute a in attributes) { styleList.Add(a.Style); } } } catch (Exception ex) { Trace.WriteLine(ex); } return(styleList); }