Moving examples, mapgenerator, and VisualParamGenerator to Programs folder (SVN is seriously ruined still, don't check out yet)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1961 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2008-07-22 23:21:49 +00:00
parent ef71c02528
commit f2dde3daae
153 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace OpenMetaverse.GUITestClient
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmTestClient());
}
}
}

View File

@@ -0,0 +1,100 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9E0EE72D-AAA7-42EC-8E59-2C3EA5ED6D98}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GUITestClient</RootNamespace>
<AssemblyName>GUITestClient</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-docs|AnyCPU' ">
<OutputPath>bin\Release-docs\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleAssemblies>C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\\rules</CodeAnalysisRuleAssemblies>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Interfaces\MinimapInterface.cs" />
<Compile Include="Interfaces\TeleportInterface.cs" />
<Compile Include="frmTestClient.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmTestClient.Designer.cs">
<DependentUpon>frmTestClient.cs</DependentUpon>
</Compile>
<Compile Include="Interface.cs" />
<Compile Include="GUITestClient.cs" />
<Compile Include="Interfaces\HeightmapInterface.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmTestClient.resx">
<SubType>Designer</SubType>
<DependentUpon>frmTestClient.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\OpenMetaverse.csproj">
<Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
<Name>OpenMetaverse</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,23 @@
using System;
using System.Windows.Forms;
using System.Collections.Generic;
namespace OpenMetaverse.GUITestClient
{
public abstract class Interface
{
public string Name;
public string Description;
public GridClient Client;
public TabPage TabPage;
public abstract void Initialize();
public abstract void Paint(object sender, PaintEventArgs e);
/// <summary>
/// When set to true, think will be called.
/// </summary>
public bool Active;
}
}

View File

@@ -0,0 +1,86 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;
using OpenMetaverse;
namespace OpenMetaverse.GUITestClient
{
public class HeightmapInterface : Interface
{
private PictureBox[,] Boxes = new PictureBox[16, 16];
public HeightmapInterface(frmTestClient testClient)
{
Name = "Heightmap";
Description = "Displays a graphical heightmap of the current simulator";
}
public override void Initialize()
{
Client.Terrain.OnLandPatch += new TerrainManager.LandPatchCallback(Terrain_OnLandPatch);
Client.Settings.STORE_LAND_PATCHES = true;
for (int y = 0; y < 16; y++)
{
for (int x = 0; x < 16; x++)
{
Boxes[x, y] = new System.Windows.Forms.PictureBox();
PictureBox box = Boxes[x, y];
((System.ComponentModel.ISupportInitialize)(box)).BeginInit();
box.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
box.Name = x + "," + y;
box.Location = new System.Drawing.Point(x * 16, y * 16);
box.Size = new System.Drawing.Size(16, 16);
box.Visible = true;
//box.MouseUp += new MouseEventHandler(box_MouseUp);
((System.ComponentModel.ISupportInitialize)(box)).EndInit();
TabPage.Controls.Add(box);
}
}
}
public override void Paint(object sender, PaintEventArgs e)
{
;
}
void Terrain_OnLandPatch(Simulator simulator, int x, int y, int width, float[] data)
{
if (x >= 16 || y >= 16)
{
Console.WriteLine("Bad patch coordinates, x = " + x + ", y = " + y);
return;
}
if (width != 16)
{
Console.WriteLine("Unhandled patch size " + width + "x" + width);
return;
}
Bitmap patch = new Bitmap(16, 16, PixelFormat.Format24bppRgb);
for (int yp = 0; yp < 16; yp++)
{
for (int xp = 0; xp < 16; xp++)
{
float height = data[yp * 16 + xp];
int colorVal = Helpers.FloatToByte(height, 0.0f, 60.0f);
int lesserVal = (int)((float)colorVal * 0.75f);
Color color;
if (height >= simulator.WaterHeight)
color = Color.FromArgb(lesserVal, colorVal, lesserVal);
else
color = Color.FromArgb(lesserVal, lesserVal, colorVal);
patch.SetPixel(xp, yp, color);
}
}
Boxes[x, y].Image = (System.Drawing.Image)patch;
}
}
}

View File

@@ -0,0 +1,145 @@
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing.Imaging;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenMetaverse;
using System.Net;
using System.Diagnostics;
namespace OpenMetaverse.GUITestClient
{
public class MinimapInterface : Interface
{
//A magic number to calculate index sim y coord from actual coord
private const int GRID_Y_OFFSET = 1279;
//Base URL for web map api sim images
private const String MAP_IMG_URL = "http://secondlife.com/apps/mapapi/grid/map_image/";
private PictureBox world = new PictureBox();
private Button cmdRefresh = new Button();
private System.Drawing.Image mMapImage = null;
private string oldSim = String.Empty;
public MinimapInterface(frmTestClient testClient)
{
Name = "Minimap";
Description = "Displays a graphical minimap of the current simulator";
}
private void map_onclick(object sender, System.EventArgs e)
{
;
}
private void cmdRefresh_onclick(object sender, System.EventArgs e)
{
printMap();
}
public void printMap()
{
Bitmap map = new Bitmap(256, 256, PixelFormat.Format32bppRgb);
Font font = new Font("Tahoma", 8, FontStyle.Bold);
Pen mAvPen = new Pen(Brushes.GreenYellow, 1);
Brush mAvBrush = new SolidBrush(Color.Green);
String strInfo = String.Empty;
// Get new background map if necessary
if (mMapImage == null || oldSim != Client.Network.CurrentSim.Name)
{
oldSim = Client.Network.CurrentSim.Name;
mMapImage = DownloadWebMapImage();
}
// Create in memory bitmap
using (Graphics g = Graphics.FromImage(map))
{
// Draw background map
g.DrawImage(mMapImage, new Rectangle(0, 0, 256, 256), 0, 0, 256, 256, GraphicsUnit.Pixel);
// Draw all avatars
Client.Network.CurrentSim.AvatarPositions.ForEach(
delegate(LLVector3 pos)
{
Rectangle rect = new Rectangle((int)Math.Round(pos.X, 0) - 2, 255 - ((int)Math.Round(pos.Y, 0) - 2), 4, 4);
g.FillEllipse(mAvBrush, rect);
g.DrawEllipse(mAvPen, rect);
}
);
// Draw self ;)
Rectangle myrect = new Rectangle((int)Math.Round(Client.Self.SimPosition.X, 0) - 3, 255 - ((int)Math.Round(Client.Self.SimPosition.Y, 0) - 3), 6, 6);
g.FillEllipse(new SolidBrush(Color.Yellow), myrect);
g.DrawEllipse(new Pen(Brushes.Goldenrod, 1), myrect);
// Draw region info
strInfo = string.Format("Sim {0}/{1}/{2}/{3}\nAvatars {4}", Client.Network.CurrentSim.Name,
Math.Round(Client.Self.SimPosition.X, 0),
Math.Round(Client.Self.SimPosition.Y, 0),
Math.Round(Client.Self.SimPosition.Z, 0),
Client.Network.CurrentSim.AvatarPositions.Count);
g.DrawString(strInfo, font, Brushes.DarkOrange, 4, 4);
}
// update picture box with new map bitmap
world.BackgroundImage = map;
}
public override void Initialize()
{
((System.ComponentModel.ISupportInitialize)(world)).BeginInit();
world.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
world.Size = new System.Drawing.Size(256, 256);
world.Visible = true;
world.Click += new System.EventHandler(this.map_onclick);
((System.ComponentModel.ISupportInitialize)(world)).EndInit();
//((System.ComponentModel.ISupportInitialize)(cmdRefresh)).BeginInit();
cmdRefresh.Text = "Refresh";
cmdRefresh.Size = new System.Drawing.Size(80, 24);
cmdRefresh.Left = world.Left + world.Width + 20;
cmdRefresh.Click += new System.EventHandler(this.cmdRefresh_onclick);
cmdRefresh.Visible = true;
//((System.ComponentModel.ISupportInitialize)(world)).EndInit();
TabPage.Controls.Add(world);
TabPage.Controls.Add(cmdRefresh);
}
// Ripped from "Terrain Sculptor" by Cadroe with minors changes
// http://spinmass.blogspot.com/2007/08/terrain-sculptor-maps-sims-and-creates.html
private System.Drawing.Image DownloadWebMapImage()
{
HttpWebRequest request = null;
HttpWebResponse response = null;
String imgURL = "";
GridRegion currRegion;
Client.Grid.GetGridRegion(Client.Network.CurrentSim.Name, GridLayerType.Terrain, out currRegion);
try
{
//Form the URL using the sim coordinates
imgURL = MAP_IMG_URL + currRegion.X.ToString() + "-" +
(GRID_Y_OFFSET - currRegion.Y).ToString() + "-1-0";
//Make the http request
request = (HttpWebRequest)HttpWebRequest.Create(imgURL);
request.Timeout = 5000;
request.ReadWriteTimeout = 20000;
response = (HttpWebResponse)request.GetResponse();
return System.Drawing.Image.FromStream(response.GetResponseStream());
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "Error Downloading Web Map Image");
return null;
}
}
public override void Paint(object sender, PaintEventArgs e)
{
;
}
}
}

View File

@@ -0,0 +1,79 @@
using System;
using System.ComponentModel;
using System.Drawing.Imaging;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenMetaverse;
namespace OpenMetaverse.GUITestClient
{
class TeleportInterface : Interface
{
private System.Windows.Forms.Button cmdTeleport;
private System.Windows.Forms.TextBox txtLocation;
private System.Windows.Forms.Label lblLocation;
public TeleportInterface(frmTestClient testClient)
{
Name = "Teleport";
Description = "Teleport your's agent in SL Grid";
}
public override void Initialize()
{
txtLocation = new System.Windows.Forms.TextBox();
txtLocation.Size = new System.Drawing.Size(238, 24);
txtLocation.Top = 100;
txtLocation.Left = 12;
lblLocation = new System.Windows.Forms.Label();
lblLocation.Size = new System.Drawing.Size(238, 24);
lblLocation.Top = txtLocation.Top - 16;
lblLocation.Left = txtLocation.Left;
lblLocation.Text = "Location (eg: sim/x/y/z)";
cmdTeleport = new System.Windows.Forms.Button();
cmdTeleport.Size = new System.Drawing.Size(120, 24);
cmdTeleport.Top = 100; cmdTeleport.Left = 257;
cmdTeleport.Text = "Teleport !";
cmdTeleport.Click += new System.EventHandler(this.cmdTeleport_OnClick);
TabPage.Controls.Add(txtLocation);
TabPage.Controls.Add(lblLocation);
TabPage.Controls.Add(cmdTeleport);
}
private void cmdTeleport_OnClick(object sender, System.EventArgs e)
{
String destination = txtLocation.Text.Trim();
string[] tokens = destination.Split(new char[] { '/' });
if (tokens.Length != 4)
goto error_handler;
string sim = tokens[0];
float x, y, z;
if (!float.TryParse(tokens[1], out x) ||
!float.TryParse(tokens[2], out y) ||
!float.TryParse(tokens[3], out z))
{
goto error_handler;
}
if (Client.Self.Teleport(sim, new LLVector3(x, y, z)))
MessageBox.Show("Teleported to " + Client.Network.CurrentSim, "Teleport");
else
MessageBox.Show("Teleport failed: " + Client.Self.TeleportMessage, "Teleport");
return;
error_handler:
MessageBox.Show("Location must to be sim/x/y/z", "Teleport");
}
public override void Paint(object sender, PaintEventArgs e)
{
;
}
}
}

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("GUITestClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Metaverse Industries LLC")]
[assembly: AssemblyProduct("GUITestClient")]
[assembly: AssemblyCopyright("Copyright © Metaverse Industries LLC 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("07b6c35c-78c2-4850-8ece-d99e1284959f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GUITestClient.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GUITestClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GUITestClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@@ -0,0 +1,154 @@
namespace OpenMetaverse.GUITestClient
{
partial class frmTestClient
{
/// <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.tabControl = new System.Windows.Forms.TabControl();
this.tabLogin = new System.Windows.Forms.TabPage();
this.cmdConnect = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtLastName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.txtFirstName = new System.Windows.Forms.TextBox();
this.tabControl.SuspendLayout();
this.tabLogin.SuspendLayout();
this.SuspendLayout();
//
// tabControl
//
this.tabControl.Controls.Add(this.tabLogin);
this.tabControl.Location = new System.Drawing.Point(12, 12);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(400, 400);
this.tabControl.TabIndex = 0;
//
// tabLogin
//
this.tabLogin.Controls.Add(this.cmdConnect);
this.tabLogin.Controls.Add(this.label3);
this.tabLogin.Controls.Add(this.txtPassword);
this.tabLogin.Controls.Add(this.label2);
this.tabLogin.Controls.Add(this.txtLastName);
this.tabLogin.Controls.Add(this.label1);
this.tabLogin.Controls.Add(this.txtFirstName);
this.tabLogin.Location = new System.Drawing.Point(4, 22);
this.tabLogin.Name = "tabLogin";
this.tabLogin.Padding = new System.Windows.Forms.Padding(3);
this.tabLogin.Size = new System.Drawing.Size(392, 374);
this.tabLogin.TabIndex = 0;
this.tabLogin.Text = "Login";
this.tabLogin.UseVisualStyleBackColor = true;
//
// cmdConnect
//
this.cmdConnect.Location = new System.Drawing.Point(257, 181);
this.cmdConnect.Name = "cmdConnect";
this.cmdConnect.Size = new System.Drawing.Size(120, 24);
this.cmdConnect.TabIndex = 59;
this.cmdConnect.Text = "Connect";
this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
//
// label3
//
this.label3.Location = new System.Drawing.Point(257, 139);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(120, 16);
this.label3.TabIndex = 58;
this.label3.Text = "Password";
//
// txtPassword
//
this.txtPassword.Location = new System.Drawing.Point(257, 155);
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '*';
this.txtPassword.Size = new System.Drawing.Size(120, 20);
this.txtPassword.TabIndex = 57;
//
// label2
//
this.label2.Location = new System.Drawing.Point(138, 139);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(120, 16);
this.label2.TabIndex = 56;
this.label2.Text = "Last Name";
//
// txtLastName
//
this.txtLastName.Location = new System.Drawing.Point(138, 155);
this.txtLastName.Name = "txtLastName";
this.txtLastName.Size = new System.Drawing.Size(112, 20);
this.txtLastName.TabIndex = 55;
//
// label1
//
this.label1.Location = new System.Drawing.Point(12, 139);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(120, 16);
this.label1.TabIndex = 54;
this.label1.Text = "First Name";
//
// txtFirstName
//
this.txtFirstName.Location = new System.Drawing.Point(12, 155);
this.txtFirstName.Name = "txtFirstName";
this.txtFirstName.Size = new System.Drawing.Size(120, 20);
this.txtFirstName.TabIndex = 53;
//
// frmTestClient
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(427, 420);
this.Controls.Add(this.tabControl);
this.Name = "frmTestClient";
this.Text = "GUI Test Client";
this.Paint += new System.Windows.Forms.PaintEventHandler(this.frmTestClient_Paint);
this.tabControl.ResumeLayout(false);
this.tabLogin.ResumeLayout(false);
this.tabLogin.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.TabPage tabLogin;
private System.Windows.Forms.Button cmdConnect;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtLastName;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtFirstName;
}
}

View File

@@ -0,0 +1,136 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using OpenMetaverse;
namespace OpenMetaverse.GUITestClient
{
public partial class frmTestClient : Form
{
private GridClient Client = new GridClient();
private Dictionary<Interface, TabPage> Interfaces = new Dictionary<Interface, TabPage>();
public frmTestClient()
{
Client.Network.OnLogin += new NetworkManager.LoginCallback(Network_OnLogin);
Client.Settings.MULTIPLE_SIMS = false;
InitializeComponent();
RegisterAllPlugins(Assembly.GetExecutingAssembly());
EnablePlugins(false);
}
private void Network_OnLogin(LoginStatus login, string message)
{
if (login == LoginStatus.Success)
{
EnablePlugins(true);
}
else if (login == LoginStatus.Failed)
{
BeginInvoke(
(MethodInvoker)delegate()
{
MessageBox.Show(this, String.Format("Error logging in ({0}): {1}",
Client.Network.LoginErrorKey, Client.Network.LoginMessage));
cmdConnect.Text = "Connect";
txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
EnablePlugins(false);
});
}
}
private void cmdConnect_Click(object sender, EventArgs e)
{
if (cmdConnect.Text == "Connect")
{
cmdConnect.Text = "Disconnect";
txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
LoginParams loginParams = Client.Network.DefaultLoginParams(txtFirstName.Text, txtLastName.Text,
txtPassword.Text, "GUITestClient", "1.0.0");
Client.Network.BeginLogin(loginParams);
}
else
{
Client.Network.Logout();
cmdConnect.Text = "Connect";
txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
EnablePlugins(false);
}
}
private void EnablePlugins(bool enable)
{
tabControl.TabPages.Clear();
tabControl.TabPages.Add(tabLogin);
if (enable)
{
lock (Interfaces)
{
foreach (TabPage page in Interfaces.Values)
{
tabControl.TabPages.Add(page);
}
}
}
}
private void RegisterAllPlugins(Assembly assembly)
{
foreach (Type t in assembly.GetTypes())
{
try
{
if (t.IsSubclassOf(typeof(Interface)))
{
ConstructorInfo[] infos = t.GetConstructors();
Interface iface = (Interface)infos[0].Invoke(new object[] { this });
RegisterPlugin(iface);
}
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
}
}
private void RegisterPlugin(Interface iface)
{
TabPage page = new TabPage();
tabControl.TabPages.Add(page);
iface.Client = Client;
iface.TabPage = page;
if (!Interfaces.ContainsKey(iface))
{
lock (Interfaces) Interfaces.Add(iface, page);
}
iface.Initialize();
page.Text = iface.Name;
page.ToolTipText = iface.Description;
}
private void frmTestClient_Paint(object sender, PaintEventArgs e)
{
lock (Interfaces)
{
foreach (Interface iface in Interfaces.Keys)
{
iface.Paint(sender, e);
}
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>
</root>