Skip to content

Commit 4b03934

Browse files
author
lextm
committed
Switched back to Team Explorer from SVN. The bindings are added and the build is now fixed.
--HG-- extra : convert_revision : svn%3A0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5%4039338
1 parent 6fb20b1 commit 4b03934

41 files changed

Lines changed: 336 additions & 21 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Browser/Browser.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<IsWebBootstrapper>false</IsWebBootstrapper>
4040
<UseApplicationTrust>false</UseApplicationTrust>
4141
<BootstrapperEnabled>true</BootstrapperEnabled>
42+
<SccProjectName>SAK</SccProjectName>
43+
<SccLocalPath>SAK</SccLocalPath>
44+
<SccAuxPath>SAK</SccAuxPath>
45+
<SccProvider>SAK</SccProvider>
4246
</PropertyGroup>
4347
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
4448
<OutputPath>bin\Debug\</OutputPath>

Browser/Browser.csproj.vspscc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}

Browser/FormProfile.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,18 @@ private void FormProfile_Load(object sender, EventArgs e)
8686

8787
txtIP.Text = _profile.Agent.Address.ToString();
8888
txtIP.ReadOnly = true;
89-
txtGet.Text = _profile.GetCommunity;
90-
txtSet.Text = _profile.SetCommunity;
9189
txtName.Text = _profile.Name;
9290
cbVersionCode.SelectedIndex = (int)_profile.VersionCode;
91+
92+
var normal = _profile as NormalAgentProfile;
93+
txtGet.Text = normal == null ? string.Empty : normal.GetCommunity;
94+
txtSet.Text = normal == null ? string.Empty : normal.SetCommunity;
95+
9396
// TODO: load and save profile v3.
94-
txtAuthentication.Text = _profile.AuthenticationPassphrase;
95-
txtPrivacy.Text = _profile.PrivacyPassphrase;
96-
cbAuthentication.SelectedIndex = (_profile.AuthenticationMethod == "MD5") ? 0 : 1;
97+
var secure = _profile as SecureAgentProfile;
98+
txtAuthentication.Text = secure == null ? string.Empty : secure.AuthenticationPassphrase;
99+
txtPrivacy.Text = secure == null ? string.Empty : secure.PrivacyPassphrase;
100+
cbAuthentication.SelectedIndex = secure == null ? 0 : (secure.AuthenticationMethod == "MD5") ? 0 : 1;
97101
cbPrivacy.SelectedIndex = 0;
98102
txtUserName.Text = _profile.UserName;
99103
}

Browser/FormTable.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Globalization;
44
using System.Threading;
55
using System.Windows.Forms;
6-
using Lextm.SharpSnmpLib.Mib;
76
using Lextm.SharpSnmpLib.Messaging;
87
using Microsoft.Practices.Unity;
98

@@ -126,7 +125,12 @@ private void RefreshTable()
126125
break;
127126
}
128127

129-
AgentProfile prof = registry.DefaultProfile;
128+
NormalAgentProfile prof = registry.DefaultProfile as NormalAgentProfile;
129+
if (prof == null)
130+
{
131+
break;
132+
}
133+
130134
IList<Variable> list = new List<Variable>();
131135
Thread.Sleep(Convert.ToInt32(textBoxRefresh.Text, CultureInfo.CurrentCulture) * 1000);
132136
int rows = Messenger.Walk(prof.VersionCode, prof.Agent, new OctetString(prof.GetCommunity), new ObjectIdentifier(_definition.GetNumericalForm()), list, 1000, WalkMode.WithinSubtree);

Browser/NormalAgentProfile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public NormalAgentProfile(Guid id, VersionCode version, IPEndPoint agent, string
1515
SetCommunity = setCommunity;
1616
}
1717

18-
private string GetCommunity { get; set; }
19-
private string SetCommunity { get; set; }
18+
internal string GetCommunity { get; set; }
19+
internal string SetCommunity { get; set; }
2020

2121
internal override void Get(Manager manager, string textual)
2222
{

Browser/ProfileRegistry.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,29 +125,31 @@ public void SaveProfiles()
125125
writer.WriteStartAttribute("version");
126126
writer.WriteValue((int)(_profiles[k]).VersionCode);
127127
writer.WriteEndAttribute();
128-
128+
129+
var normal = _profiles[k] as NormalAgentProfile;
129130
writer.WriteStartAttribute("getCommunity");
130-
writer.WriteString(_profiles[k].GetCommunity);
131+
writer.WriteString(normal == null ? string.Empty : normal.GetCommunity);
131132
writer.WriteEndAttribute();
132133

133134
writer.WriteStartAttribute("setCommunity");
134-
writer.WriteString(_profiles[k].SetCommunity);
135+
writer.WriteString(normal == null ? string.Empty : normal.SetCommunity);
135136
writer.WriteEndAttribute();
136137

138+
var secure = _profiles[k] as SecureAgentProfile;
137139
writer.WriteStartAttribute("authenticationPassphrase");
138-
writer.WriteString(_profiles[k].AuthenticationPassphrase);
140+
writer.WriteString(secure == null ? string.Empty : secure.AuthenticationPassphrase);
139141
writer.WriteEndAttribute();
140142

141143
writer.WriteStartAttribute("privacyPassphrase");
142-
writer.WriteString(_profiles[k].PrivacyPassphrase);
144+
writer.WriteString(secure == null ? string.Empty : secure.PrivacyPassphrase);
143145
writer.WriteEndAttribute();
144146

145147
writer.WriteStartAttribute("autheticationMethod");
146-
writer.WriteString(_profiles[k].AuthenticationMethod);
148+
writer.WriteString(secure == null ? string.Empty : secure.AuthenticationMethod);
147149
writer.WriteEndAttribute();
148150

149151
writer.WriteStartAttribute("privacyMethod");
150-
writer.WriteString(_profiles[k].PrivacyMethod);
152+
writer.WriteString(secure == null ? string.Empty : secure.PrivacyMethod);
151153
writer.WriteEndAttribute();
152154

153155
writer.WriteStartAttribute("userName");

Browser/SecureAgentProfile.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.Net;
@@ -17,10 +17,10 @@ public SecureAgentProfile(Guid id, VersionCode version, IPEndPoint agent, string
1717
PrivacyMethod = privacyMethod;
1818
}
1919

20-
private string AuthenticationPassphrase { get; set; }
21-
private string PrivacyPassphrase { get; set; }
22-
private string AuthenticationMethod { get; set; }
23-
private string PrivacyMethod { get; set; }
20+
internal string AuthenticationPassphrase { get; set; }
21+
internal string PrivacyPassphrase { get; set; }
22+
internal string AuthenticationMethod { get; set; }
23+
internal string PrivacyMethod { get; set; }
2424

2525
internal override void Get(Manager manager, string textual)
2626
{

Compiler/Compiler.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
<IsWebBootstrapper>false</IsWebBootstrapper>
4141
<UseApplicationTrust>false</UseApplicationTrust>
4242
<BootstrapperEnabled>true</BootstrapperEnabled>
43+
<SccProjectName>SAK</SccProjectName>
44+
<SccLocalPath>SAK</SccLocalPath>
45+
<SccAuxPath>SAK</SccAuxPath>
46+
<SccProvider>SAK</SccProvider>
4347
</PropertyGroup>
4448
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
4549
<OutputPath>bin\Debug\</OutputPath>

Compiler/Compiler.csproj.vspscc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
""
2+
{
3+
"FILE_VERSION" = "9237"
4+
"ENLISTMENT_CHOICE" = "NEVER"
5+
"PROJECT_FILE_RELATIVE_PATH" = ""
6+
"NUMBER_OF_EXCLUDED_FILES" = "0"
7+
"ORIGINAL_PROJECT_FILE_PATH" = ""
8+
"NUMBER_OF_NESTED_PROJECTS" = "0"
9+
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10+
}

Parser/Parser.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<IsWebBootstrapper>false</IsWebBootstrapper>
3636
<UseApplicationTrust>false</UseApplicationTrust>
3737
<BootstrapperEnabled>true</BootstrapperEnabled>
38+
<SccProjectName>SAK</SccProjectName>
39+
<SccLocalPath>SAK</SccLocalPath>
40+
<SccAuxPath>SAK</SccAuxPath>
41+
<SccProvider>SAK</SccProvider>
3842
</PropertyGroup>
3943
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
4044
<OutputPath>bin\Debug\</OutputPath>

0 commit comments

Comments
 (0)