Skip to content

Commit

Permalink
Minor misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrazio committed Apr 19, 2019
1 parent cc904c2 commit d289a14
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 11 deletions.
29 changes: 28 additions & 1 deletion Common/Config/Storage/ASCOMProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace Common.Config.Storage
{
public class ASCOMProfile : IConfigStorage
public class ASCOMProfile : IConfigStorage, IDisposable
{
private ASCOM.Utilities.Profile Profile;
public string ProfileName { get; set; }
Expand Down Expand Up @@ -107,5 +107,32 @@ public void WriteStringToProfile(string Key, string Value, string Folder)
{
Profile.WriteValue(ProfileName, Key, Value, Folder);
}

#region IDisposable Support
private bool disposedValue = false; // To detect redundant calls

protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
if (Profile != null)
{
Profile.Dispose();
Profile = null;
}
}

disposedValue = true;
}
}

// This code added to correctly implement the disposable pattern.
public void Dispose()
{
Dispose(true);
}
#endregion
}
}
2 changes: 1 addition & 1 deletion Driver/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace ASCOM.Ardufocus.Driver
/// <summary>
/// ASCOM Focuser Driver for Ardufocus.
/// </summary>
[ComVisible(false)]
[ComVisible(true)]
public abstract class FocuserBase : ReferenceCountedObjectBase, IFocuserV3
{
protected virtual string GET_CURRENT_POS { get { return "GP"; } }
Expand Down
5 changes: 0 additions & 5 deletions HandController/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public Context()
HandController.Show();
}

~Context()
{

}

internal static void TriggerUpdateUIState()
{
HandController.Invalidate();
Expand Down
11 changes: 10 additions & 1 deletion LocalServer/GarbageCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace ASCOM.Ardufocus
/// <summary>
/// Summary description for GarbageCollection.
/// </summary>
class GarbageCollection
class GarbageCollection : IDisposable
{
protected bool m_bContinueThread;
protected bool m_GCWatchStopped;
Expand Down Expand Up @@ -71,5 +71,14 @@ public void WaitForThreadToStop()
m_EventThreadEnded.WaitOne();
m_EventThreadEnded.Reset();
}

public void Dispose()
{
if (m_EventThreadEnded != null)
{
m_EventThreadEnded.Dispose();
m_EventThreadEnded = null;
}
}
}
}
Binary file added LocalServer/GlobalSuppressions.cs
Binary file not shown.
1 change: 1 addition & 0 deletions LocalServer/LocalServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<DependentUpon>DebugForm.cs</DependentUpon>
</Compile>
<Compile Include="GarbageCollection.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="LocalServer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Forms\DebugForm.resx">
Expand Down
2 changes: 1 addition & 1 deletion LocalServer/ReferenceCountedObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace ASCOM.Ardufocus
{
[ComVisible(false)]
[ComVisible(true)]
public class ReferenceCountedObjectBase
{
public ReferenceCountedObjectBase()
Expand Down
14 changes: 12 additions & 2 deletions ardufocus-driver.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.136
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{D5207217-61C7-4E94-8097-91DBACE57D2A}"
ProjectSection(ProjectDependencies) = postProject
Expand Down Expand Up @@ -36,33 +36,43 @@ Global
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|x86.ActiveCfg = Release|x86
{D5207217-61C7-4E94-8097-91DBACE57D2A}.Release|x86.Build.0 = Release|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Debug|Any CPU.ActiveCfg = Debug|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Debug|Any CPU.Build.0 = Debug|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Debug|x86.ActiveCfg = Debug|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Debug|x86.Build.0 = Debug|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Release|Any CPU.ActiveCfg = Release|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Release|Any CPU.Build.0 = Release|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Release|x86.ActiveCfg = Release|x86
{D0E9BFCF-5EDD-4ED1-8EE5-33274DCAAA5E}.Release|x86.Build.0 = Release|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Debug|Any CPU.ActiveCfg = Debug|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Debug|Any CPU.Build.0 = Debug|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Debug|x86.ActiveCfg = Debug|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Debug|x86.Build.0 = Debug|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Release|Any CPU.ActiveCfg = Release|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Release|Any CPU.Build.0 = Release|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Release|x86.ActiveCfg = Release|x86
{2F0ADE0F-17B5-4447-A32C-0E6D542289F0}.Release|x86.Build.0 = Release|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Debug|Any CPU.ActiveCfg = Debug|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Debug|Any CPU.Build.0 = Debug|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Debug|x86.ActiveCfg = Debug|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Debug|x86.Build.0 = Debug|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Release|Any CPU.ActiveCfg = Release|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Release|Any CPU.Build.0 = Release|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Release|x86.ActiveCfg = Release|x86
{3689A2CB-94C5-4012-A5CF-7E7D1DD27143}.Release|x86.Build.0 = Release|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Debug|Any CPU.ActiveCfg = Debug|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Debug|Any CPU.Build.0 = Debug|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Debug|x86.ActiveCfg = Debug|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Debug|x86.Build.0 = Debug|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Release|Any CPU.ActiveCfg = Release|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Release|Any CPU.Build.0 = Release|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Release|x86.ActiveCfg = Release|x86
{8E8D406C-1838-4914-867D-AB602D0EAF3E}.Release|x86.Build.0 = Release|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Debug|Any CPU.ActiveCfg = Debug|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Debug|Any CPU.Build.0 = Debug|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Debug|x86.ActiveCfg = Debug|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Debug|x86.Build.0 = Debug|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Release|Any CPU.ActiveCfg = Release|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Release|Any CPU.Build.0 = Release|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Release|x86.ActiveCfg = Release|x86
{64308775-BD4A-469C-BCAB-3ED830B811AF}.Release|x86.Build.0 = Release|x86
EndGlobalSection
Expand Down

0 comments on commit d289a14

Please sign in to comment.