Code inspections

This commit is contained in:
2019-09-29 19:51:19 +01:00
parent 272fdb58d1
commit 0e0ea2d2b0
22 changed files with 195 additions and 160 deletions
@@ -1,4 +1,5 @@
using System;
using System.Reflection;
using ASCOM;
using ASCOM.DeviceInterface;
using ASCOM.Meade.net;
@@ -239,7 +240,7 @@ namespace Meade.net.Focuser.UnitTests
[Test]
public void DriverVersion_Get()
{
Version version = System.Reflection.Assembly.GetAssembly(typeof(ASCOM.Meade.net.Focuser)).GetName().Version;
Version version = Assembly.GetAssembly(typeof(ASCOM.Meade.net.Focuser)).GetName().Version;
string exptectedDriverInfo = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
@@ -1,4 +1,5 @@
using System;
using System.Reflection;
using ASCOM;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.DeviceInterface;
@@ -45,8 +46,8 @@ namespace Meade.net.Telescope.UnitTests
_sharedResourcesWrapperMock.Setup(x => x.ReadProfile()).Returns(() =>_profileProperties);
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Action>())).Callback<Action>(action => { action(); });
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Func<ASCOM.Meade.net.Telescope.TelescopeDateDetails>>())).Returns<Func<ASCOM.Meade.net.Telescope.TelescopeDateDetails>>( (func) => func());
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Func<AltitudeData>>())).Returns<Func<AltitudeData>>((func) => func());
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Func<ASCOM.Meade.net.Telescope.TelescopeDateDetails>>())).Returns<Func<ASCOM.Meade.net.Telescope.TelescopeDateDetails>>( func => func());
_sharedResourcesWrapperMock.Setup(x => x.Lock(It.IsAny<Func<AltitudeData>>())).Returns<Func<AltitudeData>>(func => func());
_connectionInfo = new ConnectionInfo {Connections = 1, SameDevice = 1};
@@ -243,7 +244,7 @@ namespace Meade.net.Telescope.UnitTests
{
ConnectTelescope();
string parameters = $"unknown";
string parameters = "unknown";
var exception = Assert.Throws<InvalidValueException>(() => { _telescope.Action("site", parameters); });
Assert.That(exception.Message, Is.EqualTo($"Site parameters {parameters} not known"));
@@ -514,7 +515,7 @@ namespace Meade.net.Telescope.UnitTests
[Test]
public void DriverVersion_Get()
{
Version version = System.Reflection.Assembly.GetAssembly(typeof(ASCOM.Meade.net.Telescope)).GetName().Version;
Version version = Assembly.GetAssembly(typeof(ASCOM.Meade.net.Telescope)).GetName().Version;
string exptectedDriverInfo = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
@@ -1183,7 +1184,7 @@ namespace Meade.net.Telescope.UnitTests
var exception = Assert.Throws<InvalidValueException>(() => { _telescope.MoveAxis(TelescopeAxes.axisTertiary, testRate); });
Assert.That(exception.Message, Is.EqualTo($"Can not move this axis."));
Assert.That(exception.Message, Is.EqualTo("Can not move this axis."));
}
[Test]
@@ -2190,8 +2191,7 @@ namespace Meade.net.Telescope.UnitTests
slewCounter++;
if (slewCounter <= iterations)
return "|";
else
return "";
return "";
});
_telescope.SlewToTarget();
@@ -2259,8 +2259,7 @@ namespace Meade.net.Telescope.UnitTests
slewCounter++;
if (slewCounter <= iterations)
return "|";
else
return "";
return "";
});
_telescope.SlewToCoordinates(rightAscension, declination);
@@ -2330,7 +2329,7 @@ namespace Meade.net.Telescope.UnitTests
_astroMathsMock
.Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(),
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates(){ Declination = declination, RightAscension = rightAscension });
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = rightAscension });
_sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
@@ -2364,7 +2363,7 @@ namespace Meade.net.Telescope.UnitTests
_astroMathsMock
.Setup(x => x.ConvertHozToEq(It.IsAny<DateTime>(), It.IsAny<double>(), It.IsAny<double>(),
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates() { Declination = declination, RightAscension = rightAscension });
It.IsAny<HorizonCoordinates>())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = rightAscension });
_sharedResourcesWrapperMock.Setup(x => x.SendChar(":MS#")).Returns("0");
@@ -2375,8 +2374,7 @@ namespace Meade.net.Telescope.UnitTests
slewCounter++;
if (slewCounter <= iterations)
return "|";
else
return "";
return "";
});
_telescope.SlewToAltAz( azimuth, altitude);
@@ -2500,4 +2498,3 @@ namespace Meade.net.Telescope.UnitTests
}
}
}
;
+25 -19
View File
@@ -8,10 +8,16 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -19,27 +25,27 @@ namespace ASCOM.Meade.net.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[DebuggerNonUserCode()]
[CompilerGenerated()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
if (ReferenceEquals(resourceMan, null)) {
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -50,8 +56,8 @@ namespace ASCOM.Meade.net.Properties {
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture {
get {
return resourceCulture;
}
@@ -63,20 +69,20 @@ namespace ASCOM.Meade.net.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ASCOM {
internal static Bitmap ASCOM {
get {
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
return ((Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon DefaultIcon {
internal static Icon DefaultIcon {
get {
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
return ((System.Drawing.Icon)(obj));
return ((Icon)(obj));
}
}
+8 -4
View File
@@ -8,14 +8,18 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.Configuration;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
[CompilerGenerated()]
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
public static Settings Default {
get {
+3 -3
View File
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using ASCOM.DeviceInterface;
using System.Collections;
using System.Collections;
using System.Runtime.InteropServices;
using System.Threading;
using ASCOM.DeviceInterface;
namespace ASCOM.Meade.net
{
+35 -33
View File
@@ -1,16 +1,18 @@
#define Telescope
using System;
using System.Runtime.InteropServices;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.Utilities;
using ASCOM.DeviceInterface;
using System.Collections;
using System.Globalization;
using System.Reflection;
using System.Runtime.InteropServices;
using ASCOM.Astrometry;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.Astrometry.NOVAS;
using ASCOM.DeviceInterface;
using ASCOM.Meade.net.AstroMaths;
using ASCOM.Meade.net.Properties;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
using ASCOM.Utilities.Interfaces;
namespace ASCOM.Meade.net
@@ -538,7 +540,7 @@ namespace ASCOM.Meade.net
if (site < 1)
throw new ArgumentOutOfRangeException(nameof(site),site,Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
else if (site > 4)
if (site > 4)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
_sharedResourcesWrapper.SendBlind($":W{site}#");
@@ -553,7 +555,7 @@ namespace ASCOM.Meade.net
if (site < 1)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
else if (site > 4)
if (site > 4)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
string command = String.Empty;
@@ -607,7 +609,7 @@ namespace ASCOM.Meade.net
if (site < 1)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_lower_than_1);
else if (site > 4)
if (site > 4)
throw new ArgumentOutOfRangeException(nameof(site), site, Resources.Telescope_SelectSite_Site_cannot_be_higher_than_4);
switch (site)
@@ -831,7 +833,7 @@ namespace ASCOM.Meade.net
UtcDateTime = UTCDate,
SiteLongitude = SiteLongitude,
SiteLatitude = SiteLatitude,
EquatorialCoordinates = new EquatorialCoordinates()
EquatorialCoordinates = new EquatorialCoordinates
{
RightAscension = RightAscension,
Declination = Declination
@@ -866,7 +868,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("AtHome", "Get - " + false.ToString());
LogMessage("AtHome", "Get - " + false);
return false;
}
}
@@ -885,7 +887,7 @@ namespace ASCOM.Meade.net
public IAxisRates AxisRates(TelescopeAxes axis)
{
LogMessage("AxisRates", "Get - " + axis.ToString());
LogMessage("AxisRates", "Get - " + axis);
return new AxisRates(axis);
}
@@ -915,14 +917,14 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanFindHome", "Get - " + false.ToString());
LogMessage("CanFindHome", "Get - " + false);
return false;
}
}
public bool CanMoveAxis(TelescopeAxes axis)
{
LogMessage("CanMoveAxis", "Get - " + axis.ToString());
LogMessage("CanMoveAxis", "Get - " + axis);
switch (axis)
{
case TelescopeAxes.axisPrimary: return true; //RA or AZ
@@ -936,7 +938,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanPark", "Get - " + true.ToString());
LogMessage("CanPark", "Get - " + true);
return true;
}
}
@@ -945,7 +947,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanPulseGuide", "Get - " + true.ToString());
LogMessage("CanPulseGuide", "Get - " + true);
return true;
}
}
@@ -954,7 +956,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetDeclinationRate", "Get - " + false.ToString());
LogMessage("CanSetDeclinationRate", "Get - " + false);
return false;
}
}
@@ -967,7 +969,7 @@ namespace ASCOM.Meade.net
var canSetGuideRate = IsGuideRateSettingSupported();
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate.ToString());
LogMessage("CanSetGuideRates", "Get - " + canSetGuideRate);
return canSetGuideRate;
}
}
@@ -976,7 +978,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetPark", "Get - " + false.ToString());
LogMessage("CanSetPark", "Get - " + false);
return false;
}
}
@@ -985,7 +987,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetPierSide", "Get - " + false.ToString());
LogMessage("CanSetPierSide", "Get - " + false);
return false;
}
}
@@ -994,7 +996,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetRightAscensionRate", "Get - " + false.ToString());
LogMessage("CanSetRightAscensionRate", "Get - " + false);
return false;
}
}
@@ -1003,7 +1005,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSetTracking", "Get - " + true.ToString());
LogMessage("CanSetTracking", "Get - " + true);
return true;
}
}
@@ -1012,7 +1014,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlew", "Get - " + true.ToString());
LogMessage("CanSlew", "Get - " + true);
return true;
}
}
@@ -1021,7 +1023,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlewAltAz", "Get - " + true.ToString());
LogMessage("CanSlewAltAz", "Get - " + true);
return true;
}
}
@@ -1030,7 +1032,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlewAltAzAsync", "Get - " + true.ToString());
LogMessage("CanSlewAltAzAsync", "Get - " + true);
return true;
}
}
@@ -1039,7 +1041,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSlewAsync", "Get - " + true.ToString());
LogMessage("CanSlewAsync", "Get - " + true);
return true;
}
}
@@ -1048,7 +1050,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSync", "Get - " + true.ToString());
LogMessage("CanSync", "Get - " + true);
return true;
}
}
@@ -1057,7 +1059,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanSyncAltAz", "Get - " + false.ToString());
LogMessage("CanSyncAltAz", "Get - " + false);
return false;
}
}
@@ -1066,7 +1068,7 @@ namespace ASCOM.Meade.net
{
get
{
LogMessage("CanUnpark", "Get - " + false.ToString());
LogMessage("CanUnpark", "Get - " + false);
return false;
}
}
@@ -1131,7 +1133,7 @@ namespace ASCOM.Meade.net
get
{
EquatorialCoordinateType equatorialSystem = EquatorialCoordinateType.equTopocentric;
LogMessage("DeclinationRate", "Get - " + equatorialSystem.ToString());
LogMessage("DeclinationRate", "Get - " + equatorialSystem);
return equatorialSystem;
}
}
@@ -1473,13 +1475,13 @@ namespace ASCOM.Meade.net
{
// Now using NOVAS 3.1
double siderealTime = 0.0;
using (var novas = new Astrometry.NOVAS.NOVAS31())
using (var novas = new NOVAS31())
{
var jd = _utilities.DateUTCToJulian(DateTime.UtcNow);
novas.SiderealTime(jd, 0, novas.DeltaT(jd),
Astrometry.GstType.GreenwichApparentSiderealTime,
Astrometry.Method.EquinoxBased,
Astrometry.Accuracy.Reduced, ref siderealTime);
GstType.GreenwichApparentSiderealTime,
Method.EquinoxBased,
Accuracy.Reduced, ref siderealTime);
}
// Allow for the longitude
@@ -2096,7 +2098,7 @@ namespace ASCOM.Meade.net
LogMessage("TrackingRates", "Get - ");
foreach (DriveRates driveRate in trackingRates)
{
LogMessage("TrackingRates", "Get - " + driveRate.ToString());
LogMessage("TrackingRates", "Get - " + driveRate);
}
return trackingRates;
}
+4 -4
View File
@@ -1,13 +1,13 @@
#define Focuser
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using ASCOM.Utilities;
using ASCOM.DeviceInterface;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using ASCOM.DeviceInterface;
using ASCOM.Meade.net.Wrapper;
using ASCOM.Utilities;
using ASCOM.Utilities.Interfaces;
namespace ASCOM.Meade.net
+25 -19
View File
@@ -8,10 +8,16 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -19,27 +25,27 @@ namespace ASCOM.Meade.net.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[DebuggerNonUserCode()]
[CompilerGenerated()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
if (ReferenceEquals(resourceMan, null)) {
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -50,8 +56,8 @@ namespace ASCOM.Meade.net.Properties {
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture {
get {
return resourceCulture;
}
@@ -63,20 +69,20 @@ namespace ASCOM.Meade.net.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ASCOM {
internal static Bitmap ASCOM {
get {
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
return ((Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon DefaultIcon {
internal static Icon DefaultIcon {
get {
object obj = ResourceManager.GetObject("DefaultIcon", resourceCulture);
return ((System.Drawing.Icon)(obj));
return ((Icon)(obj));
}
}
}
+8 -4
View File
@@ -8,14 +8,18 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.Configuration;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
[CompilerGenerated()]
[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.0.0.0")]
internal sealed partial class Settings : ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
private static Settings defaultInstance = ((Settings)(Synchronized(new Settings())));
public static Settings Default {
get {
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Resources;
using System.Runtime.InteropServices;
namespace ASCOM.Meade.net
{
+1 -2
View File
@@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Collections;
using System.Runtime.InteropServices;
namespace ASCOM.Meade.net
{
@@ -204,7 +204,6 @@ namespace ASCOM.Meade.net
if (riid == IidIDispatch)
{
ppvObject = Marshal.GetIDispatchForObject(Activator.CreateInstance(_mClassType));
return;
}
else if (riid == IidIUnknown)
{
+10 -8
View File
@@ -12,17 +12,19 @@
// Modified by Chris Rowland and Peter Simpson to allow use with multiple devices of the same type March 2011
//
//
using System;
using System.IO;
using System.Windows.Forms;
using System.Collections;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Threading;
using System.Windows.Forms;
using ASCOM.Utilities;
using Microsoft.Win32;
using System.Threading;
using System.Security.Principal;
using System.Diagnostics;
namespace ASCOM.Meade.net
{
@@ -109,7 +111,7 @@ namespace ASCOM.Meade.net
#region Private Data
private static int _objsInUse; // Keeps a count on the total number of objects alive.
private static int _serverLocks; // Keeps a lock count on this application.
private static FrmMain _sMainForm = null; // Reference to our main form
private static FrmMain _sMainForm; // Reference to our main form
private static ArrayList _sComObjectAssys; // Dynamically loaded assemblies containing served COM objects
private static ArrayList _sComObjectTypes; // Served COM object types
private static ArrayList _sClassFactories; // Served COM object class factories
@@ -293,7 +295,7 @@ namespace ASCOM.Meade.net
Verb = "runas"
};
try { Process.Start(si); }
catch (System.ComponentModel.Win32Exception)
catch (Win32Exception)
{
MessageBox.Show($"The {DriverName} was not {(arg == "/register" ? "registered" : "unregistered")} because you did not allow it.", DriverName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
+2 -2
View File
@@ -1,7 +1,7 @@
using System.Globalization;
using System.Threading;
using System.Resources;
using System.Reflection;
using System.Resources;
using System.Threading;
namespace ASCOM.Meade.net.Localization
{
+1 -1
View File
@@ -23,4 +23,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: ComVisibleAttribute(false)]
[assembly: ComVisible(false)]
+23 -17
View File
@@ -8,10 +8,16 @@
// </auto-generated>
//------------------------------------------------------------------------------
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;
namespace ASCOM.Meade.net.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -19,27 +25,27 @@ namespace ASCOM.Meade.net.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[DebuggerNonUserCode()]
[CompilerGenerated()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
private static CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
if (ReferenceEquals(resourceMan, null)) {
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -50,8 +56,8 @@ namespace ASCOM.Meade.net.Properties {
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
[EditorBrowsable(EditorBrowsableState.Advanced)]
internal static CultureInfo Culture {
get {
return resourceCulture;
}
@@ -63,10 +69,10 @@ namespace ASCOM.Meade.net.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ASCOM {
internal static Bitmap ASCOM {
get {
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
return ((Bitmap)(obj));
}
}
}
+4 -2
View File
@@ -1,6 +1,8 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO.Ports;
using System.Runtime.InteropServices;
using System.Windows.Forms;
@@ -33,7 +35,7 @@ namespace ASCOM.Meade.net
{
try
{
System.Diagnostics.Process.Start("http://ascom-standards.org/");
Process.Start("http://ascom-standards.org/");
}
catch (Win32Exception noBrowser)
{
@@ -51,7 +53,7 @@ namespace ASCOM.Meade.net
chkTrace.Checked = profileProperties.TraceLogger;
// set the list of com ports to those that are currently available
comboBoxComPort.Items.Clear();
comboBoxComPort.Items.AddRange(System.IO.Ports.SerialPort
comboBoxComPort.Items.AddRange(SerialPort
.GetPortNames()); // use System.IO because it's static
// select the current port if possible
if (comboBoxComPort.Items.Contains(profileProperties.ComPort))
+17 -14
View File
@@ -1,3 +1,6 @@
using System.ComponentModel;
using System.Windows.Forms;
namespace ASCOM.Meade.net
{
partial class SetupDialogForm
@@ -5,7 +8,7 @@ namespace ASCOM.Meade.net
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
/// <summary>
/// Clean up any resources being used.
@@ -162,18 +165,18 @@ namespace ASCOM.Meade.net
#endregion
private System.Windows.Forms.Button cmdOK;
private System.Windows.Forms.Button cmdCancel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.PictureBox picASCOM;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.CheckBox chkTrace;
private System.Windows.Forms.ComboBox comboBoxComPort;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtGuideRate;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblPercentOfSiderealRate;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox cboPrecision;
private Button cmdOK;
private Button cmdCancel;
private Label label1;
private PictureBox picASCOM;
private Label label2;
private CheckBox chkTrace;
private ComboBox comboBoxComPort;
private Label label3;
private TextBox txtGuideRate;
private Label label4;
private Label lblPercentOfSiderealRate;
private Label label5;
private ComboBox cboPrecision;
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
+5 -4
View File
@@ -13,9 +13,11 @@
// Written by: Bob Denny 29-May-2007
// Modified by Chris Rowland and Peter Simpson to hamdle multiple hardware devices March 2011
//
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Forms;
using ASCOM.Utilities;
namespace ASCOM.Meade.net
@@ -218,7 +220,7 @@ namespace ASCOM.Meade.net
// or call a different dialog if connected
if (Connections > 0)
{
System.Windows.Forms.MessageBox.Show("Already connected, please disconnect before altering settings");
MessageBox.Show("Already connected, please disconnect before altering settings");
return;
}
@@ -234,7 +236,7 @@ namespace ASCOM.Meade.net
}
var result = f.ShowDialog();
if (result == System.Windows.Forms.DialogResult.OK)
if (result == DialogResult.OK)
{
profileProperties = f.GetProfile();
@@ -354,8 +356,7 @@ namespace ASCOM.Meade.net
{
if (ConnectedDevices.ContainsKey(deviceId))
return ConnectedDevices[deviceId].Count > 0;
else
return false;
return false;
}
#endregion
+4 -3
View File
@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace ASCOM.Meade.net
{
@@ -7,7 +8,7 @@ namespace ASCOM.Meade.net
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
private IContainer components = null;
/// <summary>
/// Clean up any resources being used.
@@ -56,7 +57,7 @@ namespace ASCOM.Meade.net
#endregion
private System.Windows.Forms.Label label1;
private Label label1;
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
+3 -2
View File
@@ -9,6 +9,7 @@
#define UseChooser
using System;
using ASCOM.DriverAccess;
namespace ASCOM.Meade.net
{
@@ -19,11 +20,11 @@ namespace ASCOM.Meade.net
// Uncomment the code that's required
#if UseChooser
// choose the device
string id = DriverAccess.Telescope.Choose("ASCOM.MeadeGeneric.Telescope");
string id = Telescope.Choose("ASCOM.MeadeGeneric.Telescope");
if (string.IsNullOrEmpty(id))
return;
// create this device
DriverAccess.Telescope device = new DriverAccess.Telescope(id);
Telescope device = new Telescope(id);
#else
// this can be replaced by this code, it avoids the chooser and creates the driver class directly.
ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");