Code inspections
This commit is contained in:
@@ -1096,6 +1096,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("DeclinationRate", "Get - " + declination.ToString(CultureInfo.InvariantCulture));
|
||||
return declination;
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("DeclinationRate Set", "Not implemented");
|
||||
@@ -1116,6 +1117,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("DoesRefraction Get", "Not implemented");
|
||||
throw new PropertyNotImplementedException("DoesRefraction", false);
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("DoesRefraction Set", "Not implemented");
|
||||
@@ -1435,6 +1437,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("RightAscensionRate", "Get - " + rightAscensionRate.ToString(CultureInfo.InvariantCulture));
|
||||
return rightAscensionRate;
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("RightAscensionRate Set", "Not implemented");
|
||||
@@ -1455,6 +1458,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("SideOfPier Get", "Not implemented");
|
||||
throw new PropertyNotImplementedException("SideOfPier", false);
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("SideOfPier Set", "Not implemented");
|
||||
@@ -1495,6 +1499,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("SiteElevation Get", "Not implemented");
|
||||
throw new PropertyNotImplementedException("SiteElevation", false);
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("SiteElevation Set", "Not implemented");
|
||||
@@ -1609,6 +1614,7 @@ namespace ASCOM.Meade.net
|
||||
LogMessage("SlewSettleTime Get", "Not implemented");
|
||||
throw new PropertyNotImplementedException("SlewSettleTime", false);
|
||||
}
|
||||
// ReSharper disable once ValueParameterNotUsed
|
||||
set
|
||||
{
|
||||
LogMessage("SlewSettleTime Set", "Not implemented");
|
||||
|
||||
+34
-37
@@ -8,10 +8,10 @@ namespace ASCOM.Meade.net
|
||||
public class AssemblyInfo
|
||||
{
|
||||
// The assembly information values.
|
||||
public string Title = "", Description = "", Company = "",
|
||||
Product = "", Copyright = "", Trademark = "",
|
||||
AssemblyVersion = "", FileVersion = "", Guid = "",
|
||||
NeutralLanguage = "";
|
||||
public string Title = string.Empty, Description = string.Empty, Company = string.Empty,
|
||||
Product = string.Empty, Copyright = string.Empty, Trademark = string.Empty,
|
||||
AssemblyVersion, FileVersion = string.Empty, Guid = string.Empty,
|
||||
NeutralLanguage = string.Empty;
|
||||
public bool IsComVisible;
|
||||
|
||||
// Return a particular assembly attribute value.
|
||||
@@ -19,11 +19,10 @@ namespace ASCOM.Meade.net
|
||||
where T : Attribute
|
||||
{
|
||||
// Get attributes of this type.
|
||||
object[] attributes =
|
||||
assembly.GetCustomAttributes(typeof(T), true);
|
||||
object[] attributes = assembly.GetCustomAttributes(typeof(T), true);
|
||||
|
||||
// If we didn't get anything, return null.
|
||||
if ((attributes == null) || (attributes.Length == 0))
|
||||
if (attributes.Length == 0)
|
||||
return null;
|
||||
|
||||
// Convert the first attribute value into
|
||||
@@ -40,51 +39,49 @@ namespace ASCOM.Meade.net
|
||||
public AssemblyInfo(Assembly assembly)
|
||||
{
|
||||
// Get values from the assembly.
|
||||
AssemblyTitleAttribute titleAttr =
|
||||
GetAssemblyAttribute<AssemblyTitleAttribute>(assembly);
|
||||
if (titleAttr != null) Title = titleAttr.Title;
|
||||
var titleAttr = GetAssemblyAttribute<AssemblyTitleAttribute>(assembly);
|
||||
if (titleAttr != null)
|
||||
Title = titleAttr.Title;
|
||||
|
||||
AssemblyDescriptionAttribute assemblyAttr =
|
||||
GetAssemblyAttribute<AssemblyDescriptionAttribute>(assembly);
|
||||
if (assemblyAttr != null) Description =
|
||||
assemblyAttr.Description;
|
||||
var assemblyAttr = GetAssemblyAttribute<AssemblyDescriptionAttribute>(assembly);
|
||||
if (assemblyAttr != null)
|
||||
Description = assemblyAttr.Description;
|
||||
|
||||
AssemblyCompanyAttribute companyAttr =
|
||||
GetAssemblyAttribute<AssemblyCompanyAttribute>(assembly);
|
||||
if (companyAttr != null) Company = companyAttr.Company;
|
||||
var companyAttr =GetAssemblyAttribute<AssemblyCompanyAttribute>(assembly);
|
||||
if (companyAttr != null)
|
||||
Company = companyAttr.Company;
|
||||
|
||||
AssemblyProductAttribute productAttr =
|
||||
GetAssemblyAttribute<AssemblyProductAttribute>(assembly);
|
||||
if (productAttr != null) Product = productAttr.Product;
|
||||
var productAttr = GetAssemblyAttribute<AssemblyProductAttribute>(assembly);
|
||||
if (productAttr != null)
|
||||
Product = productAttr.Product;
|
||||
|
||||
AssemblyCopyrightAttribute copyrightAttr =
|
||||
GetAssemblyAttribute<AssemblyCopyrightAttribute>(assembly);
|
||||
if (copyrightAttr != null) Copyright = copyrightAttr.Copyright;
|
||||
var copyrightAttr = GetAssemblyAttribute<AssemblyCopyrightAttribute>(assembly);
|
||||
if (copyrightAttr != null)
|
||||
Copyright = copyrightAttr.Copyright;
|
||||
|
||||
AssemblyTrademarkAttribute trademarkAttr =
|
||||
GetAssemblyAttribute<AssemblyTrademarkAttribute>(assembly);
|
||||
if (trademarkAttr != null) Trademark = trademarkAttr.Trademark;
|
||||
var trademarkAttr = GetAssemblyAttribute<AssemblyTrademarkAttribute>(assembly);
|
||||
if (trademarkAttr != null)
|
||||
Trademark = trademarkAttr.Trademark;
|
||||
|
||||
var version = assembly.GetName().Version;
|
||||
AssemblyVersion = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
|
||||
|
||||
|
||||
AssemblyFileVersionAttribute fileVersionAttr =
|
||||
GetAssemblyAttribute<AssemblyFileVersionAttribute>(assembly);
|
||||
var fileVersionAttr = GetAssemblyAttribute<AssemblyFileVersionAttribute>(assembly);
|
||||
if (fileVersionAttr != null) FileVersion =
|
||||
fileVersionAttr.Version;
|
||||
|
||||
GuidAttribute guidAttr = GetAssemblyAttribute<GuidAttribute>(assembly);
|
||||
if (guidAttr != null) Guid = guidAttr.Value;
|
||||
var guidAttr = GetAssemblyAttribute<GuidAttribute>(assembly);
|
||||
if (guidAttr != null)
|
||||
Guid = guidAttr.Value;
|
||||
|
||||
NeutralResourcesLanguageAttribute languageAttr =
|
||||
GetAssemblyAttribute<NeutralResourcesLanguageAttribute>(assembly);
|
||||
if (languageAttr != null) NeutralLanguage =
|
||||
languageAttr.CultureName;
|
||||
var languageAttr = GetAssemblyAttribute<NeutralResourcesLanguageAttribute>(assembly);
|
||||
if (languageAttr != null)
|
||||
NeutralLanguage = languageAttr.CultureName;
|
||||
|
||||
ComVisibleAttribute comAttr =
|
||||
GetAssemblyAttribute<ComVisibleAttribute>(assembly);
|
||||
if (comAttr != null) IsComVisible = comAttr.Value;
|
||||
var comAttr = GetAssemblyAttribute<ComVisibleAttribute>(assembly);
|
||||
if (comAttr != null)
|
||||
IsComVisible = comAttr.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user