Skip to content

Commit

Permalink
PropertyEditor is easier to customize now
Browse files Browse the repository at this point in the history
The Configure() method is now called from Initialize() instead of from
the constructor. This will allow derived classes to use parameters from
their constructors in their override of Configure().
  • Loading branch information
Ron2 committed Oct 30, 2014
1 parent 0ff57f7 commit a944cc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions Framework/Atf.Gui.WinForms/Applications/PropertyEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Sce.Atf.Applications
public class PropertyEditor : IInitializable, IControlHostClient, IDisposable
{
/// <summary>
/// Constructor with paramters</summary>
/// Constructor with parameters</summary>
/// <param name="commandService">ICommandService</param>
/// <param name="controlHostService">IControlHostService</param>
/// <param name="contextRegistry">IContextRegistry</param>
Expand All @@ -35,11 +35,6 @@ public class PropertyEditor : IInitializable, IControlHostClient, IDisposable
CommandService = commandService;
ControlHostService = controlHostService;
ContextRegistry = contextRegistry;

Configure(out m_propertyGrid, out m_controlInfo);

m_propertyGrid.PropertyGridView.ContextRegistry = ContextRegistry;
m_propertyGrid.MouseUp += propertyGrid_MouseUp;
}

/// <summary>
Expand All @@ -57,7 +52,7 @@ protected virtual void Configure(out PropertyGrid propertyGrid, out ControlInfo
}

/// <summary>
/// Gets the internal property grid</summary>
/// Gets the internal property grid. Is available after Initialize() and Configure() are called.</summary>
public PropertyGrid PropertyGrid
{
get { return m_propertyGrid; }
Expand All @@ -81,6 +76,11 @@ public SelectionPropertyEditingContext DefaultPropertyEditingContext
/// Finishes initializing component by subscribing to event, registering control, and setting up Settings Service</summary>
public virtual void Initialize()
{
Configure(out m_propertyGrid, out m_controlInfo);

m_propertyGrid.PropertyGridView.ContextRegistry = ContextRegistry;
m_propertyGrid.MouseUp += propertyGrid_MouseUp;

ContextRegistry.ActiveContextChanged += contextRegistry_ActiveContextChanged;

ControlHostService.RegisterControl(m_propertyGrid, m_controlInfo, this);
Expand Down Expand Up @@ -222,8 +222,8 @@ private IPropertyEditingContext GetContext()
[ImportMany]
private IEnumerable<Lazy<IContextMenuCommandProvider>> m_contextMenuCommandProviders;

private readonly PropertyGrid m_propertyGrid;
private readonly ControlInfo m_controlInfo;
private PropertyGrid m_propertyGrid;
private ControlInfo m_controlInfo;
private SelectionPropertyEditingContext m_defaultContext = new SelectionPropertyEditingContext();
}
}
2 changes: 1 addition & 1 deletion wws_atf.component
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://www.ship.scea.com/wws_sdk/component/v1 http://www.ship.scea.com/wws_sdk/component/v1.xsd">

<readablename>Authoring Tools Framework</readablename>
<version>3.8.0.8</version>
<version>3.8.0.9</version>
<owner>rlittle</owner>
<platforms>PC</platforms>
<category>Component</category>
Expand Down

0 comments on commit a944cc5

Please sign in to comment.