Skip to content

Commit 9711a76

Browse files
committed
Matches dotsettings file to WPILib and NTCore
1 parent 26a8e1d commit 9711a76

21 files changed

+153
-187
lines changed

FRC-Extension.sln.DotSettings

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=71229261_002D404c_002D4480_002D9672_002Dd4a58843c057/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Protected" Description="Protected Static Fields"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
3-
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=b73d7327_002D5826_002D45d7_002Daebd_002D0fc3da8126ce/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Protected" Description="Protected Instance Fields"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String></wpf:ResourceDictionary>
2+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ADXL/@EntryIndexedValue">ADXL</s:String>
3+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AHRS/@EntryIndexedValue">AHRS</s:String>
4+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CAN/@EntryIndexedValue">CAN</s:String>
5+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CS/@EntryIndexedValue">CS</s:String>
6+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CTR/@EntryIndexedValue">CTR</s:String>
7+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DIO/@EntryIndexedValue">DIO</s:String>
8+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DS/@EntryIndexedValue">DS</s:String>
9+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FIRST/@EntryIndexedValue">FIRST</s:String>
10+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=FPGA/@EntryIndexedValue">FPGA</s:String>
11+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HAL/@EntryIndexedValue">HAL</s:String>
12+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
13+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LSB/@EntryIndexedValue">LSB</s:String>
14+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MSB/@EntryIndexedValue">MSB</s:String>
15+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MXP/@EntryIndexedValue">MXP</s:String>
16+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PCM/@EntryIndexedValue">PCM</s:String>
17+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PDP/@EntryIndexedValue">PDP</s:String>
18+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PID/@EntryIndexedValue">PID</s:String>
19+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PWM/@EntryIndexedValue">PWM</s:String>
20+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SD/@EntryIndexedValue">SD</s:String>
21+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SP/@EntryIndexedValue">SP</s:String>
22+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SPI/@EntryIndexedValue">SPI</s:String>
23+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SRX/@EntryIndexedValue">SRX</s:String>
24+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=USB/@EntryIndexedValue">USB</s:String>
25+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UTF/@EntryIndexedValue">UTF</s:String>
26+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="aaBb" /&gt;</s:String>
27+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="aaBb" /&gt;</s:String>
28+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="aaBb" /&gt;</s:String>
29+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=71229261_002D404c_002D4480_002D9672_002Dd4a58843c057/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Internal" Description="Internal Static Fields"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
30+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=b73d7327_002D5826_002D45d7_002Daebd_002D0fc3da8126ce/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Internal" Description="Internal Instance Fields"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String></wpf:ResourceDictionary>

FRC-Extension/Buttons/AboutButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public override void ButtonCallback(object sender, EventArgs e)
1616
//TODO: Get version
1717

1818
// Show a Message Box to prove we were here
19-
IVsUIShell uiShell = (IVsUIShell)m_package.PublicGetService(typeof(SVsUIShell));
19+
IVsUIShell uiShell = (IVsUIShell)Package.PublicGetService(typeof(SVsUIShell));
2020
Guid clsid = Guid.Empty;
2121
int result;
2222
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(

FRC-Extension/Buttons/ButtonBase.cs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.ComponentModel.Design;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
73
using Microsoft.VisualStudio.Shell;
84

95
namespace RobotDotNet.FRC_Extension.Buttons
106
{
117
public abstract class ButtonBase
128
{
13-
protected readonly OutputWriter m_output;
9+
protected readonly OutputWriter Output;
1410

15-
protected readonly Frc_ExtensionPackage m_package;
11+
protected readonly Frc_ExtensionPackage Package;
1612

17-
protected readonly OleMenuCommand m_oleMenuItem;
13+
protected readonly OleMenuCommand OleMenuItem;
1814

1915
protected ButtonBase(Frc_ExtensionPackage package, bool buttonNeedsQuery, Guid commandSetGuid, int pkgCmdIdOfButton)
2016
{
21-
m_output =OutputWriter.Instance;
22-
m_package = package;
17+
Output =OutputWriter.Instance;
18+
Package = package;
2319

24-
OleMenuCommandService mcs = m_package.PublicGetService(typeof(IMenuCommandService)) as OleMenuCommandService;
20+
OleMenuCommandService mcs = Package.PublicGetService(typeof(IMenuCommandService)) as OleMenuCommandService;
2521
if (mcs != null)
2622
{
2723
CommandID commandId = new CommandID(commandSetGuid, pkgCmdIdOfButton);
28-
m_oleMenuItem = new OleMenuCommand(ButtonCallback, commandId);
24+
OleMenuItem = new OleMenuCommand(ButtonCallback, commandId);
2925
if (buttonNeedsQuery)
3026
{
31-
m_oleMenuItem.BeforeQueryStatus += QueryCallback;
27+
OleMenuItem.BeforeQueryStatus += QueryCallback;
3228
}
33-
mcs.AddCommand(m_oleMenuItem);
29+
mcs.AddCommand(OleMenuItem);
3430
}
3531
}
3632

FRC-Extension/Buttons/DeployDebugButton.cs

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,41 @@
55
using EnvDTE80;
66
using Microsoft.VisualStudio.Shell;
77
using Renci.SshNet.Common;
8+
using RobotDotNet.FRC_Extension.RoboRIOCode;
89
using VSLangProj;
910

1011
namespace RobotDotNet.FRC_Extension.Buttons
1112
{
1213
public class DeployDebugButton : ButtonBase
1314
{
14-
protected readonly bool m_debugButton;
15-
protected static bool s_deploying = false;
16-
protected static readonly List<OleMenuCommand> s_deployCommands = new List<OleMenuCommand>();
15+
protected readonly bool DebugButton;
16+
protected static bool Deploying;
17+
protected static readonly List<OleMenuCommand> DeployCommands = new List<OleMenuCommand>();
1718

18-
private Project m_robotProject = null;
19+
private Project m_robotProject;
1920

2021
public DeployDebugButton(Frc_ExtensionPackage package, int pkgCmdIdOfButton, bool debug) : base(package, true, GuidList.guidFRC_ExtensionCmdSet, pkgCmdIdOfButton)
2122
{
22-
m_debugButton = debug;
23-
s_deployCommands.Add(m_oleMenuItem);
23+
DebugButton = debug;
24+
DeployCommands.Add(OleMenuItem);
2425
}
2526

2627
private void DisableAllButtons()
2728
{
28-
foreach (var oleMenuCommand in s_deployCommands)
29+
foreach (var oleMenuCommand in DeployCommands)
2930
{
3031
oleMenuCommand.Enabled = false;
3132
}
32-
s_deploying = true;
33+
Deploying = true;
3334
}
3435

3536
private void EnableAllButtons()
3637
{
37-
foreach (var oleMenuCommand in s_deployCommands)
38+
foreach (var oleMenuCommand in DeployCommands)
3839
{
3940
oleMenuCommand.Enabled = true;
4041
}
41-
s_deploying = false;
42+
Deploying = false;
4243
}
4344

4445
public override async void ButtonCallback(object sender, EventArgs e)
@@ -48,42 +49,35 @@ public override async void ButtonCallback(object sender, EventArgs e)
4849
{
4950
return;
5051
}
51-
if (!s_deploying)
52+
if (!Deploying)
5253
{
5354
try
5455
{
55-
m_output.ProgressBarLabel = "Deploying Robot Code";
56+
Output.ProgressBarLabel = "Deploying Robot Code";
5657
OutputWriter.Instance.Clear();
5758
SettingsPageGrid page;
58-
string teamNumber = m_package.GetTeamNumber(out page);
59+
string teamNumber = Package.GetTeamNumber(out page);
5960

6061
if (teamNumber == null) return;
6162

6263
//Disable the deploy buttons
6364
DisableAllButtons();
64-
DeployManager m = new DeployManager(m_package.PublicGetService(typeof (DTE)) as DTE);
65-
bool success = await m.DeployCode(teamNumber, page, m_debugButton, m_robotProject);
65+
DeployManager m = new DeployManager(Package.PublicGetService(typeof (DTE)) as DTE);
66+
bool success = await m.DeployCode(teamNumber, page, DebugButton, m_robotProject);
6667
EnableAllButtons();
67-
if (success)
68-
{
69-
m_output.ProgressBarLabel = "Robot Code Deploy Successful";
70-
}
71-
else
72-
{
73-
m_output.ProgressBarLabel = "Robot Code Deploy Failed";
74-
}
68+
Output.ProgressBarLabel = success ? "Robot Code Deploy Successful" : "Robot Code Deploy Failed";
7569
}
7670
catch (SshConnectionException)
7771
{
78-
m_output.WriteLine("Connection to RoboRIO lost. Deploy aborted.");
72+
Output.WriteLine("Connection to RoboRIO lost. Deploy aborted.");
7973
EnableAllButtons();
80-
m_output.ProgressBarLabel = "Robot Code Deploy Failed";
74+
Output.ProgressBarLabel = "Robot Code Deploy Failed";
8175
}
8276
catch (Exception ex)
8377
{
84-
m_output.WriteLine(ex.ToString());
78+
Output.WriteLine(ex.ToString());
8579
EnableAllButtons();
86-
m_output.ProgressBarLabel = "Robot Code Deploy Failed";
80+
Output.ProgressBarLabel = "Robot Code Deploy Failed";
8781
}
8882

8983
}
@@ -94,12 +88,12 @@ public override void QueryCallback(object sender, EventArgs e)
9488
var menuCommand = sender as OleMenuCommand;
9589
if (menuCommand != null)
9690
{
97-
var dte = m_package.PublicGetService(typeof(DTE)) as DTE;
91+
var dte = Package.PublicGetService(typeof(DTE)) as DTE;
9892

9993
bool visable = false;
10094
m_robotProject = null;
10195

102-
SettingsPageGrid grid = (SettingsPageGrid) m_package.PublicGetDialogPage(typeof (SettingsPageGrid));
96+
SettingsPageGrid grid = (SettingsPageGrid) Package.PublicGetDialogPage(typeof (SettingsPageGrid));
10397

10498
if (grid.DebugMode)
10599
{
@@ -111,7 +105,7 @@ public override void QueryCallback(object sender, EventArgs e)
111105
{
112106
string project = ((Array) sb.StartupProjects).Cast<string>().First();
113107
Project startupProject = dte.Solution.Item(project);
114-
var vsproject = startupProject.Object as VSLangProj.VSProject;
108+
var vsproject = startupProject.Object as VSProject;
115109
if (vsproject != null)
116110
{
117111
//If we are an assembly, and its named WPILib, enable the deploy
@@ -137,7 +131,7 @@ public override void QueryCallback(object sender, EventArgs e)
137131
{
138132
continue;
139133
}
140-
var vsproject = project.Object as VSLangProj.VSProject;
134+
var vsproject = project.Object as VSProject;
141135

142136
if (vsproject != null)
143137
{
@@ -156,7 +150,7 @@ public override void QueryCallback(object sender, EventArgs e)
156150
}
157151
}
158152

159-
if (s_deploying)
153+
if (Deploying)
160154
visable = false;
161155

162156
menuCommand.Enabled = visable;

FRC-Extension/Buttons/DownloadMonoButton.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
using System;
22
using System.Globalization;
3-
using System.IO;
43
using System.Net;
54
using System.Threading.Tasks;
65
using Microsoft.VisualStudio.Shell;
76
using Microsoft.VisualStudio.Shell.Interop;
87
using RobotDotNet.FRC_Extension.MonoCode;
8+
using RobotDotNet.FRC_Extension.RoboRIOCode;
99

1010
namespace RobotDotNet.FRC_Extension.Buttons
1111
{
1212
public class DownloadMonoButton : ButtonBase
1313
{
1414
private readonly MonoFile m_monoFile;
15-
private bool m_downloading = false;
15+
private bool m_downloading;
1616
private readonly InstallMonoButton m_installButton;
1717

1818
public DownloadMonoButton(Frc_ExtensionPackage package, MonoFile monoFile, InstallMonoButton installButton)
@@ -38,7 +38,7 @@ public override async void ButtonCallback(object sender, EventArgs e)
3838

3939
m_downloading = true;
4040
menuCommand.Visible = false;
41-
if (!(await CheckForInternetConnection()))
41+
if (!await CheckForInternetConnection())
4242
{
4343
m_downloading = false;
4444
menuCommand.Visible = true;
@@ -51,23 +51,23 @@ public override async void ButtonCallback(object sender, EventArgs e)
5151

5252
if (downloadNew)
5353
{
54-
m_output.ProgressBarLabel = "Downloading Mono";
55-
await m_monoFile.DownloadMono(m_output);
54+
Output.ProgressBarLabel = "Downloading Mono";
55+
await m_monoFile.DownloadMono(Output);
5656

5757
//Verify Download
5858
bool verified = m_monoFile.CheckFileValid();
5959

6060
if (verified)
6161
{
6262
// Show a Message Box to prove we were here
63-
IVsUIShell uiShell = (IVsUIShell)m_package.PublicGetService(typeof(SVsUIShell));
63+
IVsUIShell uiShell = (IVsUIShell)Package.PublicGetService(typeof(SVsUIShell));
6464
Guid clsid = Guid.Empty;
6565
int result;
6666
uiShell.ShowMessageBox(
6767
0,
6868
ref clsid,
6969
"Mono Successfully Downloaded. Would you like to install it to the RoboRIO?",
70-
string.Format(CultureInfo.CurrentCulture, "", this.ToString()),
70+
string.Format(CultureInfo.CurrentCulture, "", ToString()),
7171
string.Empty,
7272
0,
7373
OLEMSGBUTTON.OLEMSGBUTTON_YESNO,
@@ -84,14 +84,14 @@ public override async void ButtonCallback(object sender, EventArgs e)
8484
else
8585
{
8686
// Show a Message Box to prove we were here
87-
IVsUIShell uiShell = (IVsUIShell)m_package.PublicGetService(typeof(SVsUIShell));
87+
IVsUIShell uiShell = (IVsUIShell)Package.PublicGetService(typeof(SVsUIShell));
8888
Guid clsid = Guid.Empty;
8989
int result;
9090
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
9191
0,
9292
ref clsid,
9393
"Mono Download Failed. Please Try Again",
94-
string.Format(CultureInfo.CurrentCulture, "", this.ToString()),
94+
string.Format(CultureInfo.CurrentCulture, "", ToString()),
9595
string.Empty,
9696
0,
9797
OLEMSGBUTTON.OLEMSGBUTTON_OK,
@@ -105,14 +105,14 @@ public override async void ButtonCallback(object sender, EventArgs e)
105105
else
106106
{
107107
// Show a Message Box to prove we were here
108-
IVsUIShell uiShell = (IVsUIShell)m_package.PublicGetService(typeof(SVsUIShell));
108+
IVsUIShell uiShell = (IVsUIShell)Package.PublicGetService(typeof(SVsUIShell));
109109
Guid clsid = Guid.Empty;
110110
int result;
111111
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox(
112112
0,
113113
ref clsid,
114114
"Mono Already Downloaded",
115-
string.Format(CultureInfo.CurrentCulture, "", this.ToString()),
115+
string.Format(CultureInfo.CurrentCulture, "", ToString()),
116116
string.Empty,
117117
0,
118118
OLEMSGBUTTON.OLEMSGBUTTON_OK,
@@ -124,7 +124,7 @@ public override async void ButtonCallback(object sender, EventArgs e)
124124
}
125125
catch (Exception ex)
126126
{
127-
m_output.WriteLine(ex.ToString());
127+
Output.WriteLine(ex.ToString());
128128
m_downloading = false;
129129
menuCommand.Visible = true;
130130
}
@@ -139,13 +139,13 @@ private class TimeoutWebClient : WebClient
139139

140140
public TimeoutWebClient(int timeout)
141141
{
142-
this.m_timeout = timeout;
142+
m_timeout = timeout;
143143
}
144144

145145
protected override WebRequest GetWebRequest(Uri address)
146146
{
147147
var result = base.GetWebRequest(address);
148-
result.Timeout = this.m_timeout;
148+
result.Timeout = m_timeout;
149149
return result;
150150
}
151151
}

0 commit comments

Comments
 (0)