Skip to content

Commit

Permalink
Updating Code Analysis rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Nov 27, 2013
1 parent bfd34bf commit f8286b4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 12 deletions.
28 changes: 22 additions & 6 deletions Sources/Accord.Controls.Vision/FaceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Accord.Controls.Vision
/// </summary>
///
public class FaceController : Component,
IDisposable, IBindableComponent, INotifyPropertyChanged
IBindableComponent, INotifyPropertyChanged
{

private PointF rawPosition;
Expand Down Expand Up @@ -79,12 +79,14 @@ public ISynchronizeInvoke SynchronizingObject
if (this.synchronizingObject == null && base.DesignMode)
{
IDesignerHost designerHost = (IDesignerHost)this.GetService(typeof(IDesignerHost));

if (designerHost != null)
{
object rootComponent = designerHost.RootComponent;
if (rootComponent != null && rootComponent is ISynchronizeInvoke)
var rootComponent = designerHost.RootComponent as ISynchronizeInvoke;

if (rootComponent != null)
{
this.synchronizingObject = (ISynchronizeInvoke)rootComponent;
this.synchronizingObject = rootComponent;
}
}
}
Expand Down Expand Up @@ -536,7 +538,8 @@ protected virtual void OnFaceMove(FaceEventArgs args)
/// </summary>
///
/// <returns>
/// The collection of <see cref="T:System.Windows.Forms.BindingManagerBase"/> objects for this <see cref="T:System.Windows.Forms.IBindableComponent"/>.
/// The collection of <see cref="T:System.Windows.Forms.BindingManagerBase"/>
/// objects for this <see cref="T:System.Windows.Forms.IBindableComponent"/>.
/// </returns>
///
[Browsable(false)]
Expand Down Expand Up @@ -591,6 +594,19 @@ protected void OnPropertyChanged(string name)
}
#endregion

}
/// <summary>
/// Releases the unmanaged resources used by the
/// <see cref="T:System.ComponentModel.Component"/>
/// and optionally releases the managed resources.
/// </summary>
///
/// <param name="disposing">true to release both managed and unmanaged
/// resources; false to release only unmanaged resources.</param>
///
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}

}
}
25 changes: 21 additions & 4 deletions Sources/Accord.Controls.Vision/HeadController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Accord.Controls.Vision
/// </summary>
///
public class HeadController : Component,
IDisposable, IBindableComponent, INotifyPropertyChanged, IVideoSource
IBindableComponent, INotifyPropertyChanged, IVideoSource
{

private IntRange xaxisRange;
Expand Down Expand Up @@ -274,12 +274,14 @@ public ISynchronizeInvoke SynchronizingObject
if (this.synchronizingObject == null && base.DesignMode)
{
IDesignerHost designerHost = (IDesignerHost)this.GetService(typeof(IDesignerHost));

if (designerHost != null)
{
object rootComponent = designerHost.RootComponent;
if (rootComponent != null && rootComponent is ISynchronizeInvoke)
var rootComponent = designerHost.RootComponent as ISynchronizeInvoke;

if (rootComponent != null)
{
this.synchronizingObject = (ISynchronizeInvoke)rootComponent;
this.synchronizingObject = rootComponent;
}
}
}
Expand Down Expand Up @@ -908,5 +910,20 @@ private void videoSource_PlayingFinished(object sender, ReasonToFinishPlaying re

#endregion


/// <summary>
/// Releases the unmanaged resources used by the
/// <see cref="T:System.ComponentModel.Component"/>
/// and optionally releases the managed resources.
/// </summary>
///
/// <param name="disposing">true to release both managed and unmanaged
/// resources; false to release only unmanaged resources.</param>
///
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}

}
}
3 changes: 1 addition & 2 deletions Sources/Accord.NET.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Rule Id="CA1021" Action="None" />
<Rule Id="CA1026" Action="None" />
<Rule Id="CA1062" Action="None" />
<Rule Id="CA1063" Action="None" />
<Rule Id="CA1063" Action="Error" />
<Rule Id="CA1303" Action="None" />
<Rule Id="CA1305" Action="None" />
<Rule Id="CA1500" Action="None" />
Expand All @@ -19,7 +19,6 @@
<Rule Id="CA1704" Action="None" />
<Rule Id="CA1719" Action="None" />
<Rule Id="CA1726" Action="None" />
<Rule Id="CA1800" Action="None" />
<Rule Id="CA1809" Action="None" />
<Rule Id="CA1814" Action="None" />
<Rule Id="CA1819" Action="None" />
Expand Down

0 comments on commit f8286b4

Please sign in to comment.