Code inspections
This commit is contained in:
@@ -23,6 +23,7 @@ using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using ASCOM.Meade.net.Properties;
|
||||
using ASCOM.Utilities;
|
||||
using Microsoft.Win32;
|
||||
|
||||
@@ -259,7 +260,7 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show($"Failed to load served COM class assembly {fi.Name} - {e.Message}",
|
||||
MessageBox.Show(string.Format(Resources.Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_, fi.Name, e.Message),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return false;
|
||||
}
|
||||
@@ -297,7 +298,7 @@ namespace ASCOM.Meade.net
|
||||
try { Process.Start(si); }
|
||||
catch (Win32Exception)
|
||||
{
|
||||
MessageBox.Show($"The {DriverName} was not {(arg == "/register" ? "registered" : "unregistered")} because you did not allow it.", DriverName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
MessageBox.Show(string.Format(Resources.Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_, DriverName, (arg == "/register" ? "registered" : "unregistered")), DriverName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -358,7 +359,7 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error while registering the server:\n{ex}",
|
||||
MessageBox.Show(string.Format(Resources.Server_RegisterObjects_, ex),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return;
|
||||
}
|
||||
@@ -424,7 +425,7 @@ namespace ASCOM.Meade.net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Error while registering the server:\n{ex}",
|
||||
MessageBox.Show(string.Format(Resources.Server_RegisterObjects_, ex),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
bFail = true;
|
||||
}
|
||||
@@ -513,7 +514,7 @@ namespace ASCOM.Meade.net
|
||||
_sClassFactories.Add(factory);
|
||||
if (!factory.RegisterClassObject())
|
||||
{
|
||||
MessageBox.Show("Failed to register class factory for " + type.Name,
|
||||
MessageBox.Show(string.Format(Resources.Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_, type.Name),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Stop);
|
||||
return false;
|
||||
}
|
||||
@@ -569,7 +570,8 @@ namespace ASCOM.Meade.net
|
||||
break;
|
||||
|
||||
default:
|
||||
MessageBox.Show("Unknown argument: " + args[0] + "\nValid are : -register, -unregister and -embedding",
|
||||
MessageBox.Show(
|
||||
string.Format(Resources.Server_ProcessArguments_, args[0]),
|
||||
DriverName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
break;
|
||||
}
|
||||
|
||||
+65
-23
@@ -8,16 +8,10 @@
|
||||
// </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>
|
||||
@@ -25,27 +19,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.
|
||||
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[DebuggerNonUserCode()]
|
||||
[CompilerGenerated()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static ResourceManager resourceMan;
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static CultureInfo resourceCulture;
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static ResourceManager ResourceManager {
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (ReferenceEquals(resourceMan, null)) {
|
||||
ResourceManager temp = new ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASCOM.Meade.net.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@@ -56,8 +50,8 @@ namespace ASCOM.Meade.net.Properties {
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
internal static CultureInfo Culture {
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@@ -69,10 +63,58 @@ namespace ASCOM.Meade.net.Properties {
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static Bitmap ASCOM {
|
||||
internal static System.Drawing.Bitmap ASCOM {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("ASCOM", resourceCulture);
|
||||
return ((Bitmap)(obj));
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The {0} was not {1} because you did not allow it..
|
||||
/// </summary>
|
||||
internal static string Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed to load served COM class assembly {0} - {1}.
|
||||
/// </summary>
|
||||
internal static string Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_" +
|
||||
"", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unknown argument: {0}
|
||||
///Valid are : -register, -unregister and -embedding.
|
||||
/// </summary>
|
||||
internal static string Server_ProcessArguments_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_ProcessArguments_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed to register class factory for {0}.
|
||||
/// </summary>
|
||||
internal static string Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error while registering the server:
|
||||
///{0}.
|
||||
/// </summary>
|
||||
internal static string Server_RegisterObjects_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Server_RegisterObjects_", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,4 +121,21 @@
|
||||
<data name="ASCOM" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\ASCOM.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Server_ProcessArguments_" xml:space="preserve">
|
||||
<value>Unknown argument: {0}
|
||||
Valid are : -register, -unregister and -embedding</value>
|
||||
</data>
|
||||
<data name="Server_RegisterClassFactories_Failed_to_register_class_factory_for__0_" xml:space="preserve">
|
||||
<value>Failed to register class factory for {0}</value>
|
||||
</data>
|
||||
<data name="Server_RegisterObjects_" xml:space="preserve">
|
||||
<value>Error while registering the server:
|
||||
{0}</value>
|
||||
</data>
|
||||
<data name="Server_ElevateSelf_The__0__was_not__1__because_you_did_not_allow_it_" xml:space="preserve">
|
||||
<value>The {0} was not {1} because you did not allow it.</value>
|
||||
</data>
|
||||
<data name="Server_LoadComObjectAssemblies_Failed_to_load_served_COM_class_assembly__0_____1_" xml:space="preserve">
|
||||
<value>Failed to load served COM class assembly {0} - {1}</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user