|
From: <br...@us...> - 2008-10-23 20:38:02
|
Revision: 421
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=421&view=rev
Author: brus07
Date: 2008-10-23 20:37:56 +0000 (Thu, 23 Oct 2008)
Log Message:
-----------
Added new Plugin.
For work with SocketClient.
Added Paths:
-----------
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/Properties/
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/Properties/AssemblyInfo.cs
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.cs
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.csproj
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs
ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.resx
Property changes on: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin
___________________________________________________________________
Added: svn:ignore
+ bin
obj
Added: tsvn:logminsize
+ 5
Property changes on: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/Properties
___________________________________________________________________
Added: tsvn:logminsize
+ 5
Added: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/Properties/AssemblyInfo.cs
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/Properties/AssemblyInfo.cs (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/Properties/AssemblyInfo.cs 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,35 @@
+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("SocketClientGatePlugin")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Home")]
+[assembly: AssemblyProduct("SocketClientGatePlugin")]
+[assembly: AssemblyCopyright("Copyright © Home 2008")]
+[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("83e8447b-02bf-400f-9a0d-e51b8bdb4abb")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Copied: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs (from rev 418, ACMServer/trunk/ACMServer/Tester/Library/SocketClientGate.cs)
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,97 @@
+using System;
+using AcmContester.Library.LibraryExtention;
+using AcmContester.Library.Connector;
+using AcmContester.Library.LibraryExtention.Data;
+
+namespace AcmContester.Plugins.TesterPlugins.SocketClientGatePlugin
+{
+ class SocketClientGate: AbstractConnector
+ {
+ static SocketClientGate instance = new SocketClientGate();
+
+ SocketClientTask client;
+
+ private SocketClientGate()
+ {
+ }
+
+ public static SocketClientGate GetInstance()
+ {
+ return instance;
+ }
+
+ public void CreateClient(string IP)
+ {
+ client = new SocketClientTask(IP);
+ client.onDataArrived += new SocketClient.DataArrivedDelegate(SocketClientGate_onDataArrived);
+ client.onAddLogText += OnAddLogText;
+ client.isBusy += IsBusy;
+ }
+
+ System.Threading.Mutex mutex = new System.Threading.Mutex();
+ bool busyState = false;
+ bool IsBusy()
+ {
+ OnDataArrived(new SystemMessage("isbusy", "CheckState"));
+ if (mutex.WaitOne(200, false) == true)
+ {
+ return busyState;
+ }
+ //TODO: ne znaju tochno sho krashe povertaty u takomu vypadku
+ return false;
+ }
+
+ void SocketClientGate_onDataArrived(SystemMessage message)
+ {
+ OnAddLogText("Receive", message.Message);
+
+ if (message.IsType("TestingSubmit") == true)
+ {
+ OnDataArrived(message);
+ }
+ }
+
+ public override bool Send(SystemMessage message)
+ {
+ message = new SystemMessage(message);
+
+ if (message.IsType("CheckStateResult") == true)
+ {
+ busyState = (message.Message == "busy");
+ mutex.ReleaseMutex();
+ return true;
+ }
+
+ if (message.IsType("TestingResult") == true)
+ {
+ Result res = Result.CreateFromXml(message.Message);
+ OnAddLogText("Send", "ID " + res.Submit.id + " result - " + res.res);
+ }
+
+ return client.Send(message);
+ }
+
+ public delegate void AddLogTextDelegate(string type, string text);
+ public event AddLogTextDelegate onAddLogText;
+ private void OnAddLogText(string type, string text)
+ {
+ if (onAddLogText != null)
+ onAddLogText(type,text);
+ }
+
+ public void Connect()
+ {
+ if (client != null)
+ client.Connect();
+ }
+ public void Disconnect()
+ {
+ if (client != null)
+ client.Disconnect();
+ }
+ public bool IsConnected()
+ {
+ return client.IsConnected();
+ }
+ }
+}
Property changes on: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGate.cs
___________________________________________________________________
Added: svn:mergeinfo
+
Added: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.cs
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.cs (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.cs 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,34 @@
+using System;
+using AcmContester.Plugins.PluginsFramework;
+using AcmContester.Library.LibraryExtention;
+
+namespace AcmContester.Plugins.TesterPlugins.SocketClientGatePlugin
+{
+ public class SocketClientGatePlugin: BaseMediatorPlugin
+ {
+ SocketClientGate socketClientGate = SocketClientGate.GetInstance();
+
+ public SocketClientGatePlugin()
+ {
+ socketClientGate.onDataArrived += DataArrived;
+ base.Control = new SocketClientGatePluginUserControl();
+
+ socketClientGate.onAddLogText += new SocketClientGate.AddLogTextDelegate(socketClientGate_onAddLogText);
+ }
+
+ void socketClientGate_onAddLogText(string type, string text)
+ {
+ ((SocketClientGatePluginUserControl)base.Control).AddText(type, text);
+ }
+
+ public override void Send(SystemMessage message)
+ {
+ if (message.IsType("ApplicationSystem") && message.Message == "stop")
+ {
+ socketClientGate.Disconnect();
+ return;
+ }
+ socketClientGate.Send(message);
+ }
+ }
+}
Added: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.csproj
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.csproj (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePlugin.csproj 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,80 @@
+<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>{79EB24DD-AF0D-40D0-974E-198F4D8C92BC}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>SocketClientGatePlugin</RootNamespace>
+ <AssemblyName>SocketClientGatePlugin</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</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\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="SocketClientGate.cs" />
+ <Compile Include="SocketClientGatePlugin.cs" />
+ <Compile Include="SocketClientGatePluginUserControl.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="SocketClientGatePluginUserControl.Designer.cs">
+ <DependentUpon>SocketClientGatePluginUserControl.cs</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\Library\Connector\Connector.csproj">
+ <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project>
+ <Name>Connector</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Library\Data\Data.csproj">
+ <Project>{30C0EFA3-36A8-4C6F-8FEC-28F771D4933F}</Project>
+ <Name>Data</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Library\LibraryExtention\LibraryExtention.csproj">
+ <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project>
+ <Name>LibraryExtention</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj">
+ <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project>
+ <Name>PluginsFramework</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="SocketClientGatePluginUserControl.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>SocketClientGatePluginUserControl.cs</DependentUpon>
+ </EmbeddedResource>
+ </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>
\ No newline at end of file
Added: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.Designer.cs 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,159 @@
+namespace AcmContester.Plugins.TesterPlugins.SocketClientGatePlugin
+{
+ partial class SocketClientGatePluginUserControl
+ {
+ /// <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 Component 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.tabControl1 = new System.Windows.Forms.TabControl();
+ this.tabPage1 = new System.Windows.Forms.TabPage();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+ this.timer1 = new System.Windows.Forms.Timer(this.components);
+ this.tabControl1.SuspendLayout();
+ this.tabPage1.SuspendLayout();
+ this.statusStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // tabControl1
+ //
+ this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.tabControl1.Controls.Add(this.tabPage1);
+ this.tabControl1.Location = new System.Drawing.Point(3, 61);
+ this.tabControl1.Name = "tabControl1";
+ this.tabControl1.SelectedIndex = 0;
+ this.tabControl1.Size = new System.Drawing.Size(238, 161);
+ this.tabControl1.TabIndex = 0;
+ //
+ // tabPage1
+ //
+ this.tabPage1.Controls.Add(this.textBox1);
+ this.tabPage1.Location = new System.Drawing.Point(4, 22);
+ this.tabPage1.Name = "tabPage1";
+ this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage1.Size = new System.Drawing.Size(230, 135);
+ this.tabPage1.TabIndex = 0;
+ this.tabPage1.Text = "tabPage1";
+ this.tabPage1.UseVisualStyleBackColor = true;
+ //
+ // textBox1
+ //
+ this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.textBox1.Location = new System.Drawing.Point(3, 3);
+ this.textBox1.Multiline = true;
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(224, 129);
+ this.textBox1.TabIndex = 0;
+ //
+ // textBox2
+ //
+ this.textBox2.Location = new System.Drawing.Point(141, 3);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.Size = new System.Drawing.Size(100, 20);
+ this.textBox2.TabIndex = 1;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(3, 3);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 2;
+ this.button1.Text = "Connect";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(3, 32);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(75, 23);
+ this.button2.TabIndex = 3;
+ this.button2.Text = "Disconnect";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // statusStrip1
+ //
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabel1});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 225);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(244, 22);
+ this.statusStrip1.TabIndex = 4;
+ this.statusStrip1.Text = "statusStrip1";
+ //
+ // toolStripStatusLabel1
+ //
+ this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+ this.toolStripStatusLabel1.Size = new System.Drawing.Size(37, 17);
+ this.toolStripStatusLabel1.Text = "xx0xx";
+ //
+ // timer1
+ //
+ this.timer1.Enabled = true;
+ this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
+ //
+ // SocketClientGatePluginUserControl
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.statusStrip1);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.textBox2);
+ this.Controls.Add(this.tabControl1);
+ this.Name = "SocketClientGatePluginUserControl";
+ this.Size = new System.Drawing.Size(244, 247);
+ this.tabControl1.ResumeLayout(false);
+ this.tabPage1.ResumeLayout(false);
+ this.tabPage1.PerformLayout();
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TabControl tabControl1;
+ private System.Windows.Forms.TabPage tabPage1;
+ private System.Windows.Forms.TextBox textBox1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
+ private System.Windows.Forms.Timer timer1;
+ }
+}
Added: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.cs 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace AcmContester.Plugins.TesterPlugins.SocketClientGatePlugin
+{
+ public partial class SocketClientGatePluginUserControl : UserControl
+ {
+ public SocketClientGatePluginUserControl()
+ {
+ InitializeComponent();
+
+ string ip = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName())[0].ToString();
+ textBox2.Text = ip;
+
+ SocketClientGate gate = SocketClientGate.GetInstance();
+ gate.onAddLogText += AddText;
+ }
+
+ delegate void AddTextCallback(string text);
+ private void AddTextToTextLog(string text)
+ {
+ if (this.textBox1.InvokeRequired)
+ {
+ AddTextCallback d = new AddTextCallback(AddTextToTextLog);
+ this.Invoke(d, new object[] { text });
+ }
+ else
+ {
+ string timeStr = DateTime.Now.ToLongTimeString() + "." + DateTime.Now.Millisecond.ToString();
+ textBox1.Text += timeStr + " " + text + Environment.NewLine;
+ if (true)
+ {
+ textBox1.Select(textBox1.Text.Length, 0);
+ textBox1.ScrollToCaret();
+ }
+ }
+ }
+
+ public void AddText(string type, string text)
+ {
+ AddTextToTextLog(type + ": " + text);
+ //view.AddRow(new LogDataGridView.SystemMessage(text, type));
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ SocketClientGate gate = SocketClientGate.GetInstance();
+ gate.CreateClient(textBox2.Text);
+ gate.Connect();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ SocketClientGate.GetInstance().Disconnect();
+ }
+
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ MessageBox.Show("!");
+ if (SocketClientGate.GetInstance().IsConnected() == true)
+ toolStripStatusLabel1.Text = "CONNECTED";
+ else
+ toolStripStatusLabel1.Text = "not connected";
+ }
+ }
+}
Added: ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.resx
===================================================================
--- ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.resx (rev 0)
+++ ACMServer/trunk/ACMServer/Plugins/TesterPlugins/SocketClientGatePlugin/SocketClientGatePluginUserControl.resx 2008-10-23 20:37:56 UTC (rev 421)
@@ -0,0 +1,126 @@
+<?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="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>127, 17</value>
+ </metadata>
+</root>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|