Modified:
trunk/Theminds/App.cs
trunk/Theminds/AppControls.cs
trunk/Theminds/Buffer interfaces.cs
trunk/Theminds/Buffer.cs
trunk/Theminds/Filters/NamesFilter.cs
trunk/Theminds/Tests/MockApp.cs
trunk/Theminds/Theminds.csproj
Log:
TabKey -> Room rename
Modified: trunk/Theminds/App.cs
==============================================================================
--- trunk/Theminds/App.cs (original)
+++ trunk/Theminds/App.cs Sat Jun 9 08:28:32 2007
@@ -15,7 +15,7 @@
public static Ideas Lion = new Ideas(@"lion.txt");
- Buffer buffer; Quirk quirk;
+ Buffer buffer; Quirk quirk; Users users;
public App() {
this.SetUpForm(); // SetUpForm.cs
@@ -26,6 +26,7 @@
quirk = new Quirk(mozNet);
this.buffer = new Buffer(this);
+ this.users = new Users();
quirk.NewLine += new Quirk.NewLineDel(Buffer.AddLine);
App.LoadAttributeLovers(
typeof(DesiresAppControlsAttribute), this);
Modified: trunk/Theminds/AppControls.cs
==============================================================================
--- trunk/Theminds/AppControls.cs (original)
+++ trunk/Theminds/AppControls.cs Sat Jun 9 08:28:32 2007
@@ -9,6 +9,7 @@
Tabber Tabber { get; }
Quirk Connection { get;}
Buffer Buffer { get;}
+ Users Users { get;}
UserList UserList { get;}
InputBox InputBox { get;}
string CurrentChannel { get; set;}
@@ -44,6 +45,10 @@
public Buffer Buffer {
get { return buffer; }
+ }
+
+ public Users Users {
+ get { return users; }
}
public void SwitchLogBox(LogBox l) {
Modified: trunk/Theminds/Buffer interfaces.cs
==============================================================================
--- trunk/Theminds/Buffer interfaces.cs (original)
+++ trunk/Theminds/Buffer interfaces.cs Sat Jun 9 08:28:32 2007
@@ -2,12 +2,15 @@
using Color = System.Drawing.Color;
namespace Theminds {
- public struct TabKey {
+ // Essentially captures the necessary information
+ // to pinpoint a single channel, in preparation
+ // for multiserver days.
+ public struct Room {
public Quirk Connection;
public string Channel;
public LogBox LogBox;
- public TabKey(Quirk c, string channel, LogBox l) {
+ public Room(Quirk c, string channel, LogBox l) {
this.Connection = c;
this.Channel = channel;
this.LogBox = l;
@@ -20,8 +23,8 @@
public override bool Equals(object obj) {
if (obj == null) return false;
- if (!(obj is TabKey)) return false;
- TabKey o = (TabKey)obj;
+ if (!(obj is Room)) return false;
+ Room o = (Room)obj;
return (o.Connection == this.Connection) &&
(o.Channel == this.Channel);
}
Modified: trunk/Theminds/Buffer.cs
==============================================================================
--- trunk/Theminds/Buffer.cs (original)
+++ trunk/Theminds/Buffer.cs Sat Jun 9 08:28:32 2007
@@ -15,11 +15,11 @@
IAppControls app;
// I need the two-way-osity for AddLine.
- TwoWayDictionary<ITab, TabKey> proust = new TwoWayDictionary<ITab, TabKey>(5);
+ TwoWayDictionary<ITab, Room> proust = new TwoWayDictionary<ITab, Room>(5);
public Buffer(IAppControls app) {
this.app = app;
- TabKey id = new TabKey(app.Connection, null, app.LogBox);
+ Room id = new Room(app.Connection, null, app.LogBox);
proust[app.Tabber.Current] = id;
// Page.Buffering events.
@@ -43,7 +43,7 @@
if (data.BroadcastId != null)
broadcastHelper(data.Line, data.Color);
else {
- TabKey tab = new TabKey(app.Connection, data.Channel, null);
+ Room tab = new Room(app.Connection, data.Channel, null);
if (!proust.ContainsKey(tab))
app.Invoke((M)delegate { AddChannel(tab); });
@@ -57,19 +57,19 @@
}
private void broadcastHelper(string line, Color color) {
- List<TabKey> tabs = proust.Values;
+ List<Room> tabs = proust.Values;
Broadcast(ref tabs);
app.BeginInvoke((M)delegate {
- tabs.ForEach((Action<TabKey>)delegate(TabKey tab) {
+ tabs.ForEach((Action<Room>)delegate(Room tab) {
tab.LogBox.AddLine(line, color);
});
});
}
public void AddChannel() {
- AddChannel(new TabKey(app.Connection, null, null));
+ AddChannel(new Room(app.Connection, null, null));
}
- public void AddChannel(TabKey tab) {
+ public void AddChannel(Room tab) {
app.CurrentChannel = tab.Channel;
ITab newTab = app.Tabber.Add(tab.Channel);
tab.LogBox = new LogBox();
@@ -84,7 +84,7 @@
public void MoveToTab(ITab t) {
if (!proust.ContainsKey(t)) return;
- TabKey id = proust[t];
+ Room id = proust[t];
app.SwitchLogBox(id.LogBox);
app.CurrentChannel = id.Channel;
}
@@ -109,5 +109,5 @@
}
public delegate void LineDel(ref BufferData data);
- public delegate void BroadcastDel(ref List<TabKey> tabs);
+ public delegate void BroadcastDel(ref List<Room> tabs);
}
Modified: trunk/Theminds/Filters/NamesFilter.cs
==============================================================================
--- trunk/Theminds/Filters/NamesFilter.cs (original)
+++ trunk/Theminds/Filters/NamesFilter.cs Sat Jun 9 08:28:32 2007
@@ -16,7 +16,7 @@
public NamesFilter(IAppControls app) {
this.app = app;
app.Buffer.Line += new LineDel(filter);
- app.Buffer.Broadcast += delegate(ref List<TabKey> tabs) {
+ app.Buffer.Broadcast += delegate(ref List<Room> tabs) {
};
}
Modified: trunk/Theminds/Tests/MockApp.cs
==============================================================================
--- trunk/Theminds/Tests/MockApp.cs (original)
+++ trunk/Theminds/Tests/MockApp.cs Sat Jun 9 08:28:32 2007
@@ -35,6 +35,7 @@
public Tabber Tabber { get { return tabber; } }
public Quirk Connection { get { return quirk; } }
public Buffer Buffer { get { return buffer; } }
+ public Users Users { get { return null; } }
public UserList UserList { get { return userList; } }
public bool InvokeRequired { get { return true; } }
public void SwitchLogBox(LogBox c) { }
Modified: trunk/Theminds/Theminds.csproj
==============================================================================
--- trunk/Theminds/Theminds.csproj (original)
+++ trunk/Theminds/Theminds.csproj Sat Jun 9 08:28:32 2007
@@ -70,6 +70,7 @@
<Compile Include="Tests\MockApp.cs" />
<Compile Include="Tests\NamesFilter.cs" />
<Compile Include="Tests\PrivmsgFilter.cs" />
+ <Compile Include="Users.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Plainclothes\lion.txt" />