LIBOMV-477 Finished UpdateNotecardAgentInventoryMessage class for Message system (Still need unit test)

LIBOMV-496 Implements new ObservableDictionary class
* Switched out KnownCaps dictionary in GridProxy to use new ObservableDictionary.
LIBOMV-495 Fixes bug while loading saved settings file in WinGridProxy.AboutBox1.resources
LIBOMV-492 Enhancements to WinGridProxy:
* All Selection and Filtering menu uptions should work properly now
* Made several setting optional in the File and Session menu
* Filter preferences can be saved and restored (ie: white/blacklist like in GridProxy)
* Work has began on WinGridProxy session searching
* Switched out CheckedListBoxes for ListViews since they have more flexibility
* Refactored WinGridProxy into multuple classes, major code cleanup
* Capabilities discovered and events sent via the EventQueue are automatically added to the Messages Filter listview


git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2630 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-04-20 06:57:07 +00:00
parent b0b7df3c8e
commit a007ec8554
14 changed files with 2409 additions and 996 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -120,9 +120,6 @@
<metadata name="contextMenuStripSessions.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>524, 17</value>
</metadata>
<metadata name="contextMenuStripMarkDropdown.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>705, 17</value>
</metadata>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>309, 17</value>
</metadata>
@@ -175,6 +172,21 @@
BQAD/wUACw==
</value>
</data>
<metadata name="contextMenuStripRemove.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>185, 54</value>
</metadata>
<metadata name="contextMenuStripSelect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 54</value>
</metadata>
<metadata name="contextMenuStripMark.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>705, 17</value>
</metadata>
<metadata name="statusStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>414, 17</value>
</metadata>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>116, 17</value>
</metadata>
<metadata name="statusStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>414, 17</value>
</metadata>
@@ -217,6 +229,27 @@
AAAAAElFTkSuQmCC
</value>
</data>
<data name="toolStripDropDownButton5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL
U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI
VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ
QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4
/g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9
cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j
3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR
dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb
NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
</value>
</data>
<metadata name="contextMenuStripCopy.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>919, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 17</value>
</metadata>
<data name="toolStripDropDownButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
@@ -262,10 +295,16 @@
s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC
</value>
</data>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>226, 17</value>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>364, 54</value>
</metadata>
<metadata name="contextMenuStripCopy.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>919, 17</value>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>492, 54</value>
</metadata>
<metadata name="saveFileDialog2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>622, 54</value>
</metadata>
<metadata name="openFileDialog2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>750, 54</value>
</metadata>
</root>

View File

@@ -0,0 +1,256 @@
namespace WinGridProxy
{
partial class FormSessionSearch
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.textBoxFind = new System.Windows.Forms.TextBox();
this.labelMarkColor = new System.Windows.Forms.Label();
this.checkBoxMatchCase = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panelColor = new System.Windows.Forms.Panel();
this.buttonPickColor = new System.Windows.Forms.Button();
this.checkBoxUnmark = new System.Windows.Forms.CheckBox();
this.checkBoxSelectMatches = new System.Windows.Forms.CheckBox();
this.label3 = new System.Windows.Forms.Label();
this.comboBoxPacketsOrMessages = new System.Windows.Forms.ComboBox();
this.checkBoxSearchSelected = new System.Windows.Forms.CheckBox();
this.buttonClose = new System.Windows.Forms.Button();
this.buttonFind = new System.Windows.Forms.Button();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.groupBox1.SuspendLayout();
this.panelColor.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(30, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Find:";
//
// textBoxFind
//
this.textBoxFind.Location = new System.Drawing.Point(48, 12);
this.textBoxFind.Name = "textBoxFind";
this.textBoxFind.Size = new System.Drawing.Size(231, 20);
this.textBoxFind.TabIndex = 1;
this.textBoxFind.TextChanged += new System.EventHandler(this.textBoxFind_TextChanged);
//
// labelMarkColor
//
this.labelMarkColor.AutoSize = true;
this.labelMarkColor.BackColor = System.Drawing.Color.Transparent;
this.labelMarkColor.Location = new System.Drawing.Point(27, 7);
this.labelMarkColor.Name = "labelMarkColor";
this.labelMarkColor.Size = new System.Drawing.Size(72, 13);
this.labelMarkColor.TabIndex = 3;
this.labelMarkColor.Text = "Mark Results:";
//
// checkBoxMatchCase
//
this.checkBoxMatchCase.AutoSize = true;
this.checkBoxMatchCase.Location = new System.Drawing.Point(9, 46);
this.checkBoxMatchCase.Name = "checkBoxMatchCase";
this.checkBoxMatchCase.Size = new System.Drawing.Size(83, 17);
this.checkBoxMatchCase.TabIndex = 4;
this.checkBoxMatchCase.Text = "Match Case";
this.checkBoxMatchCase.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.panelColor);
this.groupBox1.Controls.Add(this.checkBoxUnmark);
this.groupBox1.Controls.Add(this.checkBoxSelectMatches);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.comboBoxPacketsOrMessages);
this.groupBox1.Controls.Add(this.checkBoxSearchSelected);
this.groupBox1.Controls.Add(this.checkBoxMatchCase);
this.groupBox1.Location = new System.Drawing.Point(15, 38);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(271, 145);
this.groupBox1.TabIndex = 5;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Options";
//
// panelColor
//
this.panelColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
this.panelColor.Controls.Add(this.buttonPickColor);
this.panelColor.Controls.Add(this.labelMarkColor);
this.panelColor.Location = new System.Drawing.Point(10, 111);
this.panelColor.Name = "panelColor";
this.panelColor.Size = new System.Drawing.Size(255, 28);
this.panelColor.TabIndex = 11;
//
// buttonPickColor
//
this.buttonPickColor.BackColor = System.Drawing.SystemColors.ButtonFace;
this.buttonPickColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.buttonPickColor.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.buttonPickColor.Location = new System.Drawing.Point(134, 3);
this.buttonPickColor.Name = "buttonPickColor";
this.buttonPickColor.Size = new System.Drawing.Size(66, 21);
this.buttonPickColor.TabIndex = 10;
this.buttonPickColor.Text = "Pick Color";
this.buttonPickColor.UseVisualStyleBackColor = false;
this.buttonPickColor.Click += new System.EventHandler(this.button1_Click);
//
// checkBoxUnmark
//
this.checkBoxUnmark.AutoSize = true;
this.checkBoxUnmark.Checked = true;
this.checkBoxUnmark.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxUnmark.Location = new System.Drawing.Point(144, 92);
this.checkBoxUnmark.Name = "checkBoxUnmark";
this.checkBoxUnmark.Size = new System.Drawing.Size(120, 17);
this.checkBoxUnmark.TabIndex = 9;
this.checkBoxUnmark.Text = "Unmark Old Results";
this.checkBoxUnmark.UseVisualStyleBackColor = true;
//
// checkBoxSelectMatches
//
this.checkBoxSelectMatches.AutoSize = true;
this.checkBoxSelectMatches.Location = new System.Drawing.Point(9, 92);
this.checkBoxSelectMatches.Name = "checkBoxSelectMatches";
this.checkBoxSelectMatches.Size = new System.Drawing.Size(100, 17);
this.checkBoxSelectMatches.TabIndex = 8;
this.checkBoxSelectMatches.Text = "Select Matches";
this.checkBoxSelectMatches.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 22);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 13);
this.label3.TabIndex = 7;
this.label3.Text = "Search:";
//
// comboBoxPacketsOrMessages
//
this.comboBoxPacketsOrMessages.FormattingEnabled = true;
this.comboBoxPacketsOrMessages.Items.AddRange(new object[] {
"Both",
"Messages",
"Packets"});
this.comboBoxPacketsOrMessages.Location = new System.Drawing.Point(84, 19);
this.comboBoxPacketsOrMessages.Name = "comboBoxPacketsOrMessages";
this.comboBoxPacketsOrMessages.Size = new System.Drawing.Size(180, 21);
this.comboBoxPacketsOrMessages.TabIndex = 6;
this.comboBoxPacketsOrMessages.Text = "Both";
//
// checkBoxSearchSelected
//
this.checkBoxSearchSelected.AutoSize = true;
this.checkBoxSearchSelected.Enabled = false;
this.checkBoxSearchSelected.Location = new System.Drawing.Point(9, 69);
this.checkBoxSearchSelected.Name = "checkBoxSearchSelected";
this.checkBoxSearchSelected.Size = new System.Drawing.Size(168, 17);
this.checkBoxSearchSelected.TabIndex = 5;
this.checkBoxSearchSelected.Text = "Search only selected sessions";
this.checkBoxSearchSelected.UseVisualStyleBackColor = true;
//
// buttonClose
//
this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonClose.Location = new System.Drawing.Point(15, 195);
this.buttonClose.Name = "buttonClose";
this.buttonClose.Size = new System.Drawing.Size(75, 23);
this.buttonClose.TabIndex = 6;
this.buttonClose.Text = "Close";
this.buttonClose.UseVisualStyleBackColor = true;
this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
//
// buttonFind
//
this.buttonFind.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonFind.Enabled = false;
this.buttonFind.Location = new System.Drawing.Point(166, 195);
this.buttonFind.Name = "buttonFind";
this.buttonFind.Size = new System.Drawing.Size(120, 23);
this.buttonFind.TabIndex = 7;
this.buttonFind.Text = "Find Sessions";
this.buttonFind.UseVisualStyleBackColor = true;
this.buttonFind.Click += new System.EventHandler(this.buttonFind_Click);
//
// colorDialog1
//
this.colorDialog1.Color = System.Drawing.Color.Yellow;
this.colorDialog1.FullOpen = true;
//
// FormSessionSearch
//
this.AcceptButton = this.buttonFind;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonClose;
this.ClientSize = new System.Drawing.Size(298, 230);
this.Controls.Add(this.buttonFind);
this.Controls.Add(this.buttonClose);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.textBoxFind);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormSessionSearch";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Find Sessions";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panelColor.ResumeLayout(false);
this.panelColor.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textBoxFind;
private System.Windows.Forms.Label labelMarkColor;
private System.Windows.Forms.CheckBox checkBoxMatchCase;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button buttonClose;
private System.Windows.Forms.Button buttonFind;
private System.Windows.Forms.CheckBox checkBoxUnmark;
private System.Windows.Forms.CheckBox checkBoxSelectMatches;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox comboBoxPacketsOrMessages;
private System.Windows.Forms.CheckBox checkBoxSearchSelected;
private System.Windows.Forms.Button buttonPickColor;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.Panel panelColor;
}
}

View File

@@ -0,0 +1,99 @@
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WinGridProxy
{
public partial class FormSessionSearch : Form
{
private FilterOptions FilterOpts;
public FormSessionSearch(ref FilterOptions filterOptions)
{
InitializeComponent();
filterOptions.SearchText = "Foo Bar";
FilterOpts = filterOptions;
this.checkBoxSearchSelected.Enabled = filterOptions.HasSelection;
}
private void textBoxFind_TextChanged(object sender, EventArgs e)
{
buttonFind.Enabled = (textBoxFind.TextLength > 0);
}
private void buttonClose_Click(object sender, EventArgs e)
{
FilterOpts.SearchText = String.Empty;
}
private void buttonFind_Click(object sender, EventArgs e)
{
FilterOpts.HighlightMatches = panelColor.BackColor;
FilterOpts.MatchCase = checkBoxMatchCase.Checked;
FilterOpts.SearchSelected = checkBoxSearchSelected.Checked;
FilterOpts.SearchText = textBoxFind.Text;
FilterOpts.SearchWhat = comboBoxPacketsOrMessages.SelectedItem.ToString();
FilterOpts.SelectResults = checkBoxSelectMatches.Checked;
FilterOpts.UnMarkPrevious = checkBoxUnmark.Checked;
this.Close();
}
private void button1_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
panelColor.BackColor = colorDialog1.Color;
}
}
}
public class FilterOptions
{
public bool HasSelection; // set to true if SessionList has sessions selected already;
public string SearchText;
public string SearchWhat; // Both, Messages, Packets
public bool MatchCase;
public bool SearchSelected;
public bool SelectResults;
public bool UnMarkPrevious;
public Color HighlightMatches;
public FilterOptions(bool hasSelection)
{
this.HasSelection = hasSelection;
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -1,4 +1,30 @@
using System;
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
@@ -10,22 +36,90 @@ namespace WinGridProxy
public ListViewNoFlicker()
{
//Activate double buffering
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
//Activate double buffering
this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
//Enable the OnNotifyMessage event so we get a chance to filter out
// Windows messages before they get to the form's WndProc
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
}
protected override void OnNotifyMessage(Message m)
{
//Filter out the WM_ERASEBKGND message
if (m.Msg != 0x14)
{
base.OnNotifyMessage(m);
}
}
//Enable the OnNotifyMessage event so we get a chance to filter out
// Windows messages before they get to the form's WndProc
this.SetStyle(ControlStyles.EnableNotifyMessage, true);
}
protected override void OnNotifyMessage(Message m)
public class ListViewItemComparer : IComparer<object>
{
//Filter out the WM_ERASEBKGND message
if(m.Msg != 0x14)
// Initialize the variables to default
public int column = 0;
public bool bAscending = true;
// Using the Compare function of IComparer
public int Compare(object x, object y)
{
base.OnNotifyMessage(m);
// Cast the objects to ListViewItems
ListViewItem lvi1 = (ListViewItem)x;
ListViewItem lvi2 = (ListViewItem)y;
// If the column is the string columns
if (column != 2)
{
string lvi1String = lvi1.SubItems[column].ToString();
string lvi2String = lvi2.SubItems[column].ToString();
// Return the normal Compare
if (bAscending)
return String.Compare(lvi1String, lvi2String);
// Return the negated Compare
return -String.Compare(lvi1String, lvi2String);
}
// The column is the Age column
int lvi1Int = ParseListItemString(lvi1.SubItems[column].ToString());
int lvi2Int = ParseListItemString(lvi2.SubItems[column].ToString());
// Return the normal compare.. if x < y then return -1
if (bAscending)
{
if (lvi1Int < lvi2Int)
return -1;
else if (lvi1Int == lvi2Int)
return 0;
return 1;
}
// Return the opposites for descending
if (lvi1Int > lvi2Int)
return -1;
else if (lvi1Int == lvi2Int)
return 0;
return 1;
}
private int ParseListItemString(string x)
{
//ListViewItems are returned like this: "ListViewSubItem: {19}"
int counter = 0;
for (int i = x.Length - 1; i >= 0; i--, counter++)
{
if (x[i] == '{')
break;
}
return Int32.Parse(x.Substring(x.Length - counter, counter - 1));
}
}
}
}

View File

@@ -118,9 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="InstallWelcome" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\InstallWelcome.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

View File

@@ -0,0 +1,211 @@
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Net;
using System.Collections.Generic;
using System.Text;
using GridProxy;
using Nwc.XmlRpc;
using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
namespace WinGridProxy
{
public class ProxyManager
{
public delegate void PacketLogHandler(Packet packet, Direction direction, IPEndPoint endpoint);
public static event PacketLogHandler OnPacketLog;
public delegate void MessageLogHandler(CapsRequest req, CapsStage stage);
public static event MessageLogHandler OnMessageLog;
public delegate void LoginLogHandler(object request, Direction direction);
public static event LoginLogHandler OnLoginResponse;
public delegate void CapsAddedHandler(CapInfo cap);
public static event CapsAddedHandler OnCapabilityAdded;
private string _Port;
private string _ListenIP;
private string _LoginURI;
ProxyFrame Proxy;
public ProxyManager(string port, string listenIP, string loginUri)
{
_Port = string.Format("--proxy-login-port={0}", port);
IPAddress remoteIP; // not used
if (IPAddress.TryParse(listenIP, out remoteIP))
_ListenIP = String.Format("--proxy-client-facing-address={0}", listenIP);
else
_ListenIP = "--proxy-client-facing-address=127.0.0.1";
if (String.IsNullOrEmpty(loginUri))
_LoginURI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi";
else
_LoginURI = loginUri;
string[] args = { _Port, _ListenIP, _LoginURI };
/*
help
proxy-help
proxy-login-port
proxy-client-facing-address
proxy-remote-facing-address
proxy-remote-login-uri
verbose
quiet
*/
ProxyConfig pc = new ProxyConfig("WinGridProxy", "Jim Radford", args);
Proxy = new ProxyFrame(args, pc);
Proxy.proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
Proxy.proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));
Proxy.proxy.AddCapsDelegate("EventQueueGet", new CapsDelegate(EventQueueGetHandler));
Proxy.proxy.KnownCaps.AddDelegate(OpenMetaverse.DictionaryEventAction.Add, new OpenMetaverse.DictionaryChangeCallback(KnownCapsAddedHandler));
}
public void Start()
{
Proxy.proxy.Start();
}
public void Stop()
{
Proxy.proxy.Stop();
}
public void KnownCapsAddedHandler(OpenMetaverse.DictionaryEventAction action, System.Collections.DictionaryEntry de)
{
if (OnCapabilityAdded != null)
OnCapabilityAdded((CapInfo)de.Value);
}
private void LoginRequest(XmlRpcRequest request)
{
if (OnLoginResponse != null)
OnLoginResponse(request, Direction.Outgoing);
}
private void LoginResponse(XmlRpcResponse response)
{
if (OnLoginResponse != null)
OnLoginResponse(response, Direction.Incoming);
}
internal OpenMetaverse.ObservableDictionary<string, CapInfo> GetCapabilities()
{
return Proxy.proxy.KnownCaps;
}
internal void AddCapsDelegate(string capsKey, bool add)
{
if (add)
Proxy.proxy.AddCapsDelegate(capsKey, new CapsDelegate(CapsHandler));
else
Proxy.proxy.RemoveCapRequestDelegate(capsKey, new CapsDelegate(CapsHandler));
}
private bool CapsHandler(CapsRequest req, CapsStage stage)
{
if (OnMessageLog != null)
OnMessageLog(req, stage);
return false;
}
private bool EventQueueGetHandler(CapsRequest req, CapsStage stage)
{
if (stage == CapsStage.Response)
{
OSDMap map = (OSDMap)req.Response;
OSDArray eventsArray = (OSDArray)map["events"];
for (int i = 0; i < eventsArray.Count; i++)
{
OSDMap bodyMap = (OSDMap)eventsArray[i];
if (OnMessageLog != null)
{
CapInfo capInfo = new CapInfo(req.Info.URI, req.Info.Sim, bodyMap["message"].AsString());
CapsRequest capReq = new CapsRequest(capInfo);
capReq.Request = req.Request;
capReq.Response = bodyMap;
OnMessageLog(capReq, CapsStage.Response);
}
//Console.WriteLine("[" + i + "] " + bodyMap["message"].AsString());
}
}
return false;
}
internal void AddUDPDelegate(PacketType packetType, bool add)
{
if (add)
{
Proxy.proxy.AddDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler));
Proxy.proxy.AddDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler));
}
else
{
Proxy.proxy.RemoveDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler));
Proxy.proxy.RemoveDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler));
}
}
private Packet PacketInHandler(Packet packet, IPEndPoint endPoint)
{
if (OnPacketLog != null)
OnPacketLog(packet, Direction.Incoming, endPoint);
return packet;
}
private Packet PacketOutHandler(Packet packet, IPEndPoint endPoint)
{
if (OnPacketLog != null)
OnPacketLog(packet, Direction.Outgoing, endPoint);
return packet;
}
internal void InjectPacket(string packetData, bool toSimulator)
{
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 B

View File

@@ -1,4 +1,30 @@
using System;
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse.StructuredData;
@@ -9,8 +35,11 @@ namespace WinGridProxy
class SettingsStore
{
public Dictionary<string, bool> MessageSessions;
public Dictionary<string, bool> PacketSessions;
public bool AutoScrollEnabled;
public bool StatisticsEnabled;
public bool SaveSessionOnExit;
public bool AutoCheckNewCaps;
public SettingsStore()
{
@@ -20,26 +49,37 @@ namespace WinGridProxy
public OSDMap Serialize()
{
OSDMap map = new OSDMap(2);
OSDArray messageArray = new OSDArray(MessageSessions.Count);
foreach (KeyValuePair<string, bool> kvp in MessageSessions)
OSDMap map = new OSDMap();
if (MessageSessions.Count > 0)
{
OSDMap sessionMap = new OSDMap(2);
sessionMap["Capability"] = OSD.FromString(kvp.Key);
sessionMap["Capture"] = OSD.FromBoolean(kvp.Value);
messageArray.Add(sessionMap);
OSDArray messageArray = new OSDArray(MessageSessions.Count);
foreach (KeyValuePair<string, bool> kvp in MessageSessions)
{
OSDMap sessionMap = new OSDMap(2);
sessionMap["Capability"] = OSD.FromString(kvp.Key);
sessionMap["Capture"] = OSD.FromBoolean(kvp.Value);
messageArray.Add(sessionMap);
}
map.Add("message_sessions", messageArray);
}
map["message_sessions"] = messageArray;
OSDArray packetArray = new OSDArray(PacketSessions.Count);
foreach (KeyValuePair<string, bool> kvp in PacketSessions)
if (PacketSessions.Count > 0)
{
OSDMap sessionMap = new OSDMap(2);
sessionMap["PacketName"] = OSD.FromString(kvp.Key);
sessionMap["Capture"] = OSD.FromBoolean(kvp.Value);
packetArray.Add(sessionMap);
OSDArray packetArray = new OSDArray(PacketSessions.Count);
foreach (KeyValuePair<string, bool> kvp in PacketSessions)
{
OSDMap sessionMap = new OSDMap(2);
sessionMap["PacketName"] = OSD.FromString(kvp.Key);
sessionMap["Capture"] = OSD.FromBoolean(kvp.Value);
packetArray.Add(sessionMap);
}
map.Add("packet_sessions", packetArray);
}
map["packet_sessions"] = packetArray;
map.Add("AutoScrollSessions", OSD.FromBoolean(AutoScrollEnabled));
map.Add("CaptureStatistics", OSD.FromBoolean(StatisticsEnabled));
map.Add("SaveProfileOnExit", OSD.FromBoolean(SaveSessionOnExit));
map.Add("AutoCheckNewCaps", OSD.FromBoolean(AutoCheckNewCaps));
return map;
}
@@ -49,6 +89,12 @@ namespace WinGridProxy
if (map.ContainsKey("message_sessions"))
{
AutoScrollEnabled = map["AutoScrollSessions"].AsBoolean();
StatisticsEnabled = map["CaptureStatistics"].AsBoolean();
SaveSessionOnExit = map["SaveProfileOnExit"].AsBoolean();
AutoCheckNewCaps = map["AutoCheckNewCaps"].AsBoolean();
OSDArray messageArray = (OSDArray)map["message_sessions"];
MessageSessions = new Dictionary<string, bool>(messageArray.Count);
@@ -86,14 +132,22 @@ namespace WinGridProxy
}
public void DeserializeFromFile(string fileName)
public bool DeserializeFromFile(string fileName)
{
if(File.Exists(fileName))
if (File.Exists(fileName))
{
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(File.ReadAllText(fileName));
this.Deserialize(map);
try
{
OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(File.ReadAllText(fileName));
this.Deserialize(map);
return true;
}
catch (Exception e)
{
Console.WriteLine("Exception Deserializing From File: {0} {1}", e.Message, e.StackTrace);
}
}
return false;
}
public void SerializeToFile(string fileName)