Adding groupmanager to svn

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@357 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2006-10-21 02:36:41 +00:00
parent 32e7def137
commit b1e7547aca
7 changed files with 643 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,38 @@
namespace groupmanager
{
partial class frmGroupInfo
{
/// <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.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "frmGroupInfo";
}
#endregion
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using libsecondlife;
namespace groupmanager
{
public partial class frmGroupInfo : Form
{
Group Group;
public frmGroupInfo(Group group)
{
Group = group;
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,220 @@
namespace groupmanager
{
partial class frmGroupManager
{
/// <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.groupBox = new System.Windows.Forms.GroupBox();
this.lstGroups = new System.Windows.Forms.ListBox();
this.grpLogin = new System.Windows.Forms.GroupBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
this.txtLastName = new System.Windows.Forms.TextBox();
this.cmdConnect = new System.Windows.Forms.Button();
this.txtFirstName = new System.Windows.Forms.TextBox();
this.cmdLeave = new System.Windows.Forms.Button();
this.cmdCreate = new System.Windows.Forms.Button();
this.cmdActivate = new System.Windows.Forms.Button();
this.cmdInfo = new System.Windows.Forms.Button();
this.groupBox.SuspendLayout();
this.grpLogin.SuspendLayout();
this.SuspendLayout();
//
// groupBox
//
this.groupBox.Controls.Add(this.cmdInfo);
this.groupBox.Controls.Add(this.cmdActivate);
this.groupBox.Controls.Add(this.cmdCreate);
this.groupBox.Controls.Add(this.cmdLeave);
this.groupBox.Controls.Add(this.lstGroups);
this.groupBox.Enabled = false;
this.groupBox.Location = new System.Drawing.Point(12, 12);
this.groupBox.Name = "groupBox";
this.groupBox.Size = new System.Drawing.Size(419, 214);
this.groupBox.TabIndex = 0;
this.groupBox.TabStop = false;
this.groupBox.Text = "Groups";
//
// lstGroups
//
this.lstGroups.FormattingEnabled = true;
this.lstGroups.Location = new System.Drawing.Point(19, 31);
this.lstGroups.Name = "lstGroups";
this.lstGroups.Size = new System.Drawing.Size(384, 134);
this.lstGroups.TabIndex = 0;
this.lstGroups.SelectedIndexChanged += new System.EventHandler(this.lstGroups_SelectedIndexChanged);
//
// grpLogin
//
this.grpLogin.Controls.Add(this.label3);
this.grpLogin.Controls.Add(this.label2);
this.grpLogin.Controls.Add(this.label1);
this.grpLogin.Controls.Add(this.txtPassword);
this.grpLogin.Controls.Add(this.txtLastName);
this.grpLogin.Controls.Add(this.cmdConnect);
this.grpLogin.Controls.Add(this.txtFirstName);
this.grpLogin.Location = new System.Drawing.Point(12, 232);
this.grpLogin.Name = "grpLogin";
this.grpLogin.Size = new System.Drawing.Size(419, 108);
this.grpLogin.TabIndex = 51;
this.grpLogin.TabStop = false;
//
// label3
//
this.label3.Location = new System.Drawing.Point(280, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(120, 16);
this.label3.TabIndex = 50;
this.label3.Text = "Password";
//
// label2
//
this.label2.Location = new System.Drawing.Point(152, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(120, 16);
this.label2.TabIndex = 50;
this.label2.Text = "Last Name";
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(120, 16);
this.label1.TabIndex = 50;
this.label1.Text = "First Name";
//
// txtPassword
//
this.txtPassword.Location = new System.Drawing.Point(280, 40);
this.txtPassword.Name = "txtPassword";
this.txtPassword.PasswordChar = '*';
this.txtPassword.Size = new System.Drawing.Size(120, 20);
this.txtPassword.TabIndex = 2;
//
// txtLastName
//
this.txtLastName.Location = new System.Drawing.Point(152, 40);
this.txtLastName.Name = "txtLastName";
this.txtLastName.Size = new System.Drawing.Size(112, 20);
this.txtLastName.TabIndex = 1;
//
// cmdConnect
//
this.cmdConnect.Location = new System.Drawing.Point(280, 66);
this.cmdConnect.Name = "cmdConnect";
this.cmdConnect.Size = new System.Drawing.Size(120, 24);
this.cmdConnect.TabIndex = 3;
this.cmdConnect.Text = "Connect";
this.cmdConnect.Click += new System.EventHandler(this.cmdConnect_Click);
//
// txtFirstName
//
this.txtFirstName.Location = new System.Drawing.Point(16, 40);
this.txtFirstName.Name = "txtFirstName";
this.txtFirstName.Size = new System.Drawing.Size(120, 20);
this.txtFirstName.TabIndex = 0;
//
// cmdLeave
//
this.cmdLeave.Enabled = false;
this.cmdLeave.Location = new System.Drawing.Point(313, 174);
this.cmdLeave.Name = "cmdLeave";
this.cmdLeave.Size = new System.Drawing.Size(90, 23);
this.cmdLeave.TabIndex = 7;
this.cmdLeave.Text = "Leave";
this.cmdLeave.UseVisualStyleBackColor = true;
//
// cmdCreate
//
this.cmdCreate.Location = new System.Drawing.Point(19, 174);
this.cmdCreate.Name = "cmdCreate";
this.cmdCreate.Size = new System.Drawing.Size(90, 23);
this.cmdCreate.TabIndex = 8;
this.cmdCreate.Text = "Create";
this.cmdCreate.UseVisualStyleBackColor = true;
//
// cmdActivate
//
this.cmdActivate.Enabled = false;
this.cmdActivate.Location = new System.Drawing.Point(116, 174);
this.cmdActivate.Name = "cmdActivate";
this.cmdActivate.Size = new System.Drawing.Size(90, 23);
this.cmdActivate.TabIndex = 9;
this.cmdActivate.Text = "Activate";
this.cmdActivate.UseVisualStyleBackColor = true;
//
// cmdInfo
//
this.cmdInfo.Enabled = false;
this.cmdInfo.Location = new System.Drawing.Point(216, 174);
this.cmdInfo.Name = "cmdInfo";
this.cmdInfo.Size = new System.Drawing.Size(90, 23);
this.cmdInfo.TabIndex = 10;
this.cmdInfo.Text = "Info";
this.cmdInfo.UseVisualStyleBackColor = true;
this.cmdInfo.Click += new System.EventHandler(this.cmdInfo_Click);
//
// frmGroupManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(445, 351);
this.Controls.Add(this.grpLogin);
this.Controls.Add(this.groupBox);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(453, 378);
this.MinimumSize = new System.Drawing.Size(453, 378);
this.Name = "frmGroupManager";
this.Text = "Group Manager";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmGroupManager_FormClosing);
this.groupBox.ResumeLayout(false);
this.grpLogin.ResumeLayout(false);
this.grpLogin.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox;
private System.Windows.Forms.ListBox lstGroups;
private System.Windows.Forms.GroupBox grpLogin;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.TextBox txtLastName;
private System.Windows.Forms.Button cmdConnect;
private System.Windows.Forms.TextBox txtFirstName;
private System.Windows.Forms.Button cmdInfo;
private System.Windows.Forms.Button cmdActivate;
private System.Windows.Forms.Button cmdCreate;
private System.Windows.Forms.Button cmdLeave;
}
}

View File

@@ -0,0 +1,115 @@
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using libsecondlife;
using libsecondlife.Packets;
namespace groupmanager
{
public partial class frmGroupManager : Form
{
SecondLife client;
public frmGroupManager()
{
client = new SecondLife();
client.Groups.OnGroupsUpdated += new GroupManager.GroupsUpdatedCallback(GroupsUpdatedHandler);
InitializeComponent();
}
void GroupsUpdatedHandler()
{
Invoke(new MethodInvoker(UpdateGroups));
}
void UpdateGroups()
{
lstGroups.Items.Clear();
foreach (Group group in client.Groups.Groups)
{
lstGroups.Items.Add(group);
}
}
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
frmGroupManager frm = new frmGroupManager();
frm.ShowDialog();
}
private void cmdConnect_Click(object sender, EventArgs e)
{
if (cmdConnect.Text == "Connect")
{
cmdConnect.Text = "Disconnect";
txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = false;
Hashtable loginParams = NetworkManager.DefaultLoginValues(txtFirstName.Text,
txtLastName.Text, txtPassword.Text, "00:00:00:00:00:00", "last",
"Win", "0", "groupmanager", "jhurliman@wsu.edu");
if (client.Network.Login(loginParams))
{
groupBox.Enabled = true;
}
else
{
MessageBox.Show(this, "Error logging in: " + client.Network.LoginError);
cmdConnect.Text = "Connect";
txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
groupBox.Enabled = false;
lstGroups.Items.Clear();
}
}
else
{
client.Network.Logout();
cmdConnect.Text = "Connect";
txtFirstName.Enabled = txtLastName.Enabled = txtPassword.Enabled = true;
groupBox.Enabled = false;
lstGroups.Items.Clear();
}
}
private void lstGroups_SelectedIndexChanged(object sender, EventArgs e)
{
if (lstGroups.SelectedIndex >= 0)
{
cmdActivate.Enabled = cmdInfo.Enabled = cmdLeave.Enabled = true;
}
else
{
cmdActivate.Enabled = cmdInfo.Enabled = cmdLeave.Enabled = false;
}
}
private void cmdInfo_Click(object sender, EventArgs e)
{
if (lstGroups.Items[lstGroups.SelectedIndex].ToString() != "none")
{
Group group = (Group)lstGroups.Items[lstGroups.SelectedIndex];
frmGroupInfo frm = new frmGroupInfo(group);
frm.ShowDialog();
}
}
private void frmGroupManager_FormClosing(object sender, FormClosingEventArgs e)
{
if (client.Network.Connected)
{
client.Network.Logout();
}
}
}
}

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>

View File

@@ -0,0 +1,128 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F460FAB3-0D12-4873-89EB-2696818764B8}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>App.ico</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>groupmanager</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>WinExe</OutputType>
<RootNamespace>groupmanager</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\bin\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System">
<Name>System</Name>
</Reference>
<Reference Include="System.Data">
<Name>System.Data</Name>
</Reference>
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
<Reference Include="System.Windows.Forms">
<Name>System.Windows.Forms</Name>
</Reference>
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<ProjectReference Include="..\..\libsecondlife.csproj">
<Name>libsecondlife</Name>
<Project>{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="frmGroupInfo.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmGroupInfo.Designer.cs">
<DependentUpon>frmGroupInfo.cs</DependentUpon>
</Compile>
<Compile Include="frmGroupManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmGroupManager.Designer.cs">
<DependentUpon>frmGroupManager.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="App.ico" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="frmGroupManager.resx">
<SubType>Designer</SubType>
<DependentUpon>frmGroupManager.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>