You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(128) |
Jun
(97) |
Jul
(13) |
Aug
(40) |
Sep
(50) |
Oct
(27) |
Nov
(7) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(18) |
Feb
(47) |
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
(32) |
Aug
|
Sep
(14) |
Oct
(22) |
Nov
|
Dec
|
From: <br...@us...> - 2008-06-15 18:39:05
|
Revision: 256 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=256&view=rev Author: brus07 Date: 2008-06-15 11:39:11 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Move and implement "Data" into "Plugins" module Modified Paths: -------------- ACMServer/trunk/ACMServer/Mediator/Form1.cs ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs ACMServer/trunk/ACMServer/Mediator/Mediator.csproj ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs ACMServer/trunk/ACMServer/Plugins/testRun/Program.cs Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/DataMediator.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Result.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Submit.cs Removed Paths: ------------- ACMServer/trunk/ACMServer/Mediator/Library/Data/ ACMServer/trunk/ACMServer/Mediator/Library/Plugins/ Modified: ACMServer/trunk/ACMServer/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Mediator/Form1.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -7,8 +7,6 @@ using System.Windows.Forms; using AcmContester.Library.Connector; using System.Net.Sockets; -using AcmContester.Mediator.Library.Plugins; -using AcmContester.Mediator.Library.Plugins.SocketGate; using System.IO; namespace Mediator @@ -62,9 +60,9 @@ private void Disconnnect() { - AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin socketCreater = new AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin(); - SocketServerPlugin b2 = (SocketServerPlugin)socketCreater.GetInstance(); - b2.Stop(); + //AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin socketCreater = new AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin(); + //SocketServerPlugin b2 = (SocketServerPlugin)socketCreater.GetInstance(); + //b2.Stop(); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) @@ -75,13 +73,14 @@ private void timer1_Tick(object sender, EventArgs e) { string mes = "CountOfClients: "; - + /* AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin socketCreater = new AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin(); SocketServerPlugin b2 = (SocketServerPlugin)socketCreater.GetInstance(); if (b2 != null) mes += b2.CountClients().ToString(); else mes += "0"; + */ toolStripStatusLabel1.Text = mes; } Modified: ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Mediator/Library/MediatorKernel.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -1,6 +1,6 @@ using System; using System.Collections; -using AcmContester.Mediator.Library.Plugins; +using AcmContester.Plugins.PluginsFramework; namespace AcmContester.Mediator.Library { @@ -11,6 +11,7 @@ public void LoadLists() { + /* //TODO: \xEF\xEE\xF2\xF0\xB3\xE1\xED\xEE \xE2\xE8\xF2\xFF\xE3\xF3\xE2\xE0\xF2\xE8 \xE4\xE0\xED\xB3 \xB3\xE7 \xEF\xE0\xEF\xEE\xEA \xF3 \xFF\xEA\xE8\xE9\xF5 \xEC\xE0\xFE\xF2\xFC \xE7\xED\xE0\xF5\xEE\xE4\xE8\xF2\xE8\xF1\xFF \xE2\xB3\xE4\xEF\xEE\xE2\xB3\xE4\xED\xB3 dll \xE4\xEE \xEA\xEE\xE6\xED\xEE\xE3\xEE \xEF\xEB\xE0\xE3\xB3\xED\xF3 AcmContester.Mediator.Library.Plugins.WebGate.CreaterMediatorPlugin webCreater = new AcmContester.Mediator.Library.Plugins.WebGate.CreaterMediatorPlugin(); BaseMediatorPlugin b1 = webCreater.GetInstance(); @@ -23,6 +24,7 @@ b2.onDataArrived += DataArrivedFromTesterList; b2.onWorkingData += WorkingData; testerSideList.Add(b2); + */ } public delegate void WorkingData_EventHandler(string message); Modified: ACMServer/trunk/ACMServer/Mediator/Mediator.csproj =================================================================== --- ACMServer/trunk/ACMServer/Mediator/Mediator.csproj 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Mediator/Mediator.csproj 2008-06-15 18:39:11 UTC (rev 256) @@ -42,15 +42,7 @@ <Compile Include="Form1.Designer.cs"> <DependentUpon>Form1.cs</DependentUpon> </Compile> - <Compile Include="Library\Data\DataMediator.cs" /> - <Compile Include="Library\Data\Result.cs" /> - <Compile Include="Library\Data\Submit.cs" /> <Compile Include="Library\MediatorKernel.cs" /> - <Compile Include="Library\Plugins\BaseMediatorPlugin.cs" /> - <Compile Include="Library\Plugins\SocketGate\CreaterMediatorPlugin.cs" /> - <Compile Include="Library\Plugins\SocketGate\SocketServerPlugin.cs" /> - <Compile Include="Library\Plugins\WebGate\CreaterMediatorPlugin.cs" /> - <Compile Include="Library\Plugins\WebGate\WebGatePlugin.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <EmbeddedResource Include="Form1.resx"> @@ -86,6 +78,10 @@ <Project>{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}</Project> <Name>LibraryExtention</Name> </ProjectReference> + <ProjectReference Include="..\Plugins\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</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. Copied: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/DataMediator.cs (from rev 254, ACMServer/trunk/ACMServer/Mediator/Library/Data/DataMediator.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/DataMediator.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/DataMediator.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Collections; + +namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin.Data +{ + class DataMediator + { + const int secondToLive = 60; + + Dictionary<int, DateTime> d = new Dictionary<int, DateTime>(); + + /// <summary> + /// \xDF\xEA\xF9\xEE \xF1\xE0\xE1\xEC\xB3\xF2 \xF3 \xF7\xE5\xF0\xE7\xB3 \xE7\xED\xE0\xF5\xEE\xE4\xE8\xF2\xFC\xF1\xFF \xE1\xB3\xEB\xFC\xF8\xE5 \xED\xB3\xE6 secondToLive \xF1\xE5\xEA\xF3\xED\xE4, \xF2\xEE \xE2\xB3\xED \xEF\xF0\xEE\xF1\xF2\xEE \xE2\xE8\xE4\xE0\xEB\xFF\xBA\xF2\xFC\xF1\xFF \xE7 \xED\xE5\xBF + /// </summary> + private void DeleteOld() + { + DateTime now = DateTime.Now; + ArrayList keysToDelete = new ArrayList(); + foreach(KeyValuePair<int,DateTime> elem in d) + { + TimeSpan ts = now - elem.Value; + if (ts.TotalSeconds > secondToLive) + { + keysToDelete.Add(elem.Key); + } + } + foreach (int key in keysToDelete) + { + d.Remove(key); + } + } + + private bool Contains(int id) + { + return d.ContainsKey(id); + } + + public bool Add(Submit data) + { + DeleteOld(); + if (Contains(data.GetHashCode()) == false) + { + d.Add(data.GetHashCode(), DateTime.Now); + return true; + } + return false; + } + + public void Return(Result data) + { + DeleteOld(); + if (Contains(data.Submit.GetHashCode()) == true) + { + d.Remove(data.Submit.GetHashCode()); + } + } + } +} Copied: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Result.cs (from rev 254, ACMServer/trunk/ACMServer/Mediator/Library/Data/Result.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Result.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Result.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -0,0 +1,36 @@ +using System; +using AcmContester.AcmLibraryExtention; + +namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin.Data +{ + class Result + { + Xml data; + + Submit submit; + + string temp; + + public Result(string message) + { + //TODO + temp = message.Substring(0, message.IndexOf('$')); + string s = message.Substring(message.IndexOf('$') + 1); + submit = new Submit(s); + } + + public Submit Submit + { + get + { + return submit; + } + } + + public override string ToString() + { + //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML + return temp; + } + } +} Copied: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Submit.cs (from rev 254, ACMServer/trunk/ACMServer/Mediator/Library/Data/Submit.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Submit.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Data/Submit.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -0,0 +1,39 @@ +using System; +using AcmContester.AcmLibraryExtention; + +namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin.Data +{ + class Submit + { + Xml data; + + int id; + string temp; + + public Submit(string message) + { + //TODO + id = Convert.ToInt32(message.Substring(0,message.IndexOf('$'))); + temp = message.Substring(message.IndexOf('$')+1); + } + + //HACK: \xE4\xEB\xFF \xF2\xE5\xF1\xF2\xF3 \xF5\xE0\xE9 \xE1\xF3\xE4\xE5 \xF2\xE0\xEA, \xE0\xEB\xE5 \xEC\xE0\xBA \xE1\xF3\xF2\xE8 \xF7\xE5\xF0\xE5\xE7 XML + public override string ToString() + { + return temp; + } + + public override int GetHashCode() + { + //HACK: + /* + int result = 0; + for (int i = 0; i < temp.Length; i++) + { + result *= 991; + result += (int)temp[i]; + }*/ + return id; + } + } +} Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -1,5 +1,6 @@ using System; using AcmContester.Library.Connector; +using AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin.Data; namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin { @@ -13,10 +14,11 @@ public delegate void DataArrivedDelegate(string s); public event DataArrivedDelegate onDataArrived; + DataMediator dataContainer = new DataMediator(); private SocketServerGate() { - base.Start(); + //base.Start(); base.onDataArrived += DataArrived; } @@ -27,13 +29,15 @@ public void Send(string message) { - //dataContainer.Add(new Submit(message)); - base.Send(message); + if (dataContainer.Add(new Submit(message)) == true) + { + base.Send(message); + } } protected void DataArrived(string message) { - //dataContainer.Return(new Result(message)); + dataContainer.Return(new Result(message)); if (onDataArrived != null) onDataArrived(message); } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -10,13 +10,18 @@ public SocketServerGatePlugin() { socketServerGate = SocketServerGate.GetInstance(); - socketServerGate.onDataArrived += DataArrived; + //socketServerGate.onDataArrived += DataArrived; } public override void Send(string message) { + if (message == "stop") + { + socketServerGate.Stop(); + return; + } WorkingData("WebGatePlugin::Send(" + message + ")"); - socketServerGate.Send(message); + //socketServerGate.Send(message); } } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj 2008-06-15 18:39:11 UTC (rev 256) @@ -31,6 +31,9 @@ <Reference Include="System" /> </ItemGroup> <ItemGroup> + <Compile Include="Data\DataMediator.cs" /> + <Compile Include="Data\Result.cs" /> + <Compile Include="Data\Submit.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="SocketServerGate.cs" /> <Compile Include="SocketServerGatePlugin.cs" /> @@ -40,6 +43,10 @@ <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> <Name>Connector</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> Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -37,6 +37,11 @@ /// <param name="lst">Where to add found objects</param> private static void ScanAndLoad(string filename, List<T> lst) { + if (File.Exists(filename) == false) + { + //throw new Exception("!!!!!!!!!!"); + return; + } Assembly assembly = Assembly.LoadFrom(filename); if (assembly != null) { Modified: ACMServer/trunk/ACMServer/Plugins/testRun/Program.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/testRun/Program.cs 2008-06-15 16:28:12 UTC (rev 255) +++ ACMServer/trunk/ACMServer/Plugins/testRun/Program.cs 2008-06-15 18:39:11 UTC (rev 256) @@ -18,8 +18,9 @@ foreach (BaseMediatorPlugin cp in plugins) { - cp.Send("aaa"); + cp.Send(@"129$program hello; uses windows; var a,b:integer; begin read(a,b); write(a+b); end."); } + plugins = plugins; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 16:28:38
|
Revision: 255 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=255&view=rev Author: brus07 Date: 2008-06-15 09:28:12 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Added empty function to class Xml, for future modification Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/LibraryExtention/Xml.cs Modified: ACMServer/trunk/ACMServer/Library/LibraryExtention/Xml.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/LibraryExtention/Xml.cs 2008-06-15 15:35:47 UTC (rev 254) +++ ACMServer/trunk/ACMServer/Library/LibraryExtention/Xml.cs 2008-06-15 16:28:12 UTC (rev 255) @@ -1,4 +1,5 @@ using System; +using System.Collections; namespace AcmContester.AcmLibraryExtention { @@ -6,13 +7,38 @@ { string data; + string name; + Xml[] elements; + + public string Name + { + get + { + return name; + } + } + public Xml(string str) { data = str; + } public override string ToString() { return data; } + + public Xml[] GetElements() + { + /* + ArrayList arr = new ArrayList(); + Xml[] result = new Xml[arr.Count]; + for (int index = 0; index < arr.Count; index++) + { + result[index] = (Xml)arr[index]; + } + */ + return elements; + } } -} +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 15:35:49
|
Revision: 254 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=254&view=rev Author: brus07 Date: 2008-06-15 08:35:47 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Move "sharp tester" to "trunk" directory Added Paths: ----------- ACMServer/trunk/sharp tester/ Removed Paths: ------------- ACMServer/branches/sharp tester/ Copied: ACMServer/trunk/sharp tester (from rev 253, ACMServer/branches/sharp tester) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 11:15:16
|
Revision: 253 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=253&view=rev Author: brus07 Date: 2008-06-15 04:15:24 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Erase file from old "using/include" Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-06-15 11:03:25 UTC (rev 252) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-06-15 11:15:24 UTC (rev 253) @@ -1,6 +1,5 @@ using System; using AcmContester.Plugins.PluginsFramework; -using AcmContester.Library.Connector; namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 11:03:29
|
Revision: 252 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=252&view=rev Author: brus07 Date: 2008-06-15 04:03:25 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Added "SocketServerGatePlugin" to solution Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-15 10:30:51 UTC (rev 251) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-15 11:03:25 UTC (rev 252) @@ -21,6 +21,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebGatePlugin", "Plugins\MediatorPlugins\WebGatePlugin\WebGatePlugin.csproj", "{20B192BC-FD4D-4ED5-90F5-B5994F995238}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketServerGatePlugin", "Plugins\MediatorPlugins\SocketServerGatePlugin\SocketServerGatePlugin.csproj", "{9462E3BD-67AD-4887-BF4C-8B6A25048941}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -55,6 +57,10 @@ {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Debug|Any CPU.Build.0 = Debug|Any CPU {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.ActiveCfg = Release|Any CPU {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.Build.0 = Release|Any CPU + {9462E3BD-67AD-4887-BF4C-8B6A25048941}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9462E3BD-67AD-4887-BF4C-8B6A25048941}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9462E3BD-67AD-4887-BF4C-8B6A25048941}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9462E3BD-67AD-4887-BF4C-8B6A25048941}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -67,5 +73,6 @@ {A855D392-4817-4408-80CE-61D8C8E77322} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {B75187D7-2032-44F3-AC12-20804C7229AC} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} + {9462E3BD-67AD-4887-BF4C-8B6A25048941} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} EndGlobalSection EndGlobal Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin ___________________________________________________________________ Name: svn:ignore + bin obj Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/Properties/AssemblyInfo.cs 2008-06-15 11:03:25 UTC (rev 252) @@ -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("SocketServerGatePlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("SocketServerGatePlugin")] +[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("6e26be94-4dfb-4de5-8e3e-d36267c1748b")] + +// 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/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs (from rev 250, ACMServer/trunk/ACMServer/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGate.cs 2008-06-15 11:03:25 UTC (rev 252) @@ -0,0 +1,41 @@ +using System; +using AcmContester.Library.Connector; + +namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin +{ + /// <summary> + /// Pattern: Singleton + /// </summary> + class SocketServerGate : SocketServer + { + private static SocketServerGate instance = new SocketServerGate(); + + public delegate void DataArrivedDelegate(string s); + public event DataArrivedDelegate onDataArrived; + + + private SocketServerGate() + { + base.Start(); + base.onDataArrived += DataArrived; + } + + public static SocketServerGate GetInstance() + { + return instance; + } + + public void Send(string message) + { + //dataContainer.Add(new Submit(message)); + base.Send(message); + } + + protected void DataArrived(string message) + { + //dataContainer.Return(new Result(message)); + if (onDataArrived != null) + onDataArrived(message); + } + } +} Copied: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs (from rev 250, ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.cs 2008-06-15 11:03:25 UTC (rev 252) @@ -0,0 +1,22 @@ +using System; +using AcmContester.Plugins.PluginsFramework; + +namespace AcmContester.Plugins.MediatorPlugins.SocketServerGatePlugin +{ + public class SocketServerGatePlugin: BaseMediatorPlugin + { + SocketServerGate socketServerGate; + + public SocketServerGatePlugin() + { + socketServerGate = SocketServerGate.GetInstance(); + socketServerGate.onDataArrived += DataArrived; + } + + public override void Send(string message) + { + WorkingData("WebGatePlugin::Send(" + message + ")"); + socketServerGate.Send(message); + } + } +} Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketServerGatePlugin/SocketServerGatePlugin.csproj 2008-06-15 11:03:25 UTC (rev 252) @@ -0,0 +1,56 @@ +<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>{9462E3BD-67AD-4887-BF4C-8B6A25048941}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SocketServerGatePlugin</RootNamespace> + <AssemblyName>SocketServerGatePlugin</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" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SocketServerGate.cs" /> + <Compile Include="SocketServerGatePlugin.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Library\Connector\Connector.csproj"> + <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> + <Name>Connector</Name> + </ProjectReference> + <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</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> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 10:30:42
|
Revision: 251 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=251&view=rev Author: brus07 Date: 2008-06-15 03:30:51 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Revert to 249 commit Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Removed Paths: ------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/ Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-15 09:47:32 UTC (rev 250) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-15 10:30:51 UTC (rev 251) @@ -21,8 +21,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebGatePlugin", "Plugins\MediatorPlugins\WebGatePlugin\WebGatePlugin.csproj", "{20B192BC-FD4D-4ED5-90F5-B5994F995238}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketGatePlugin", "Plugins\MediatorPlugins\SocketGatePlugin\SocketGatePlugin.csproj", "{7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,10 +55,6 @@ {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Debug|Any CPU.Build.0 = Debug|Any CPU {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.ActiveCfg = Release|Any CPU {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.Build.0 = Release|Any CPU - {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -73,6 +67,5 @@ {A855D392-4817-4408-80CE-61D8C8E77322} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {B75187D7-2032-44F3-AC12-20804C7229AC} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} - {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} EndGlobalSection EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 09:47:26
|
Revision: 250 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=250&view=rev Author: brus07 Date: 2008-06-15 02:47:32 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Added "SocketGatePlugin" to solution Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/Properties/ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketGatePlugin.csproj ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketServerPlugin.cs Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-15 09:36:58 UTC (rev 249) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-15 09:47:32 UTC (rev 250) @@ -21,6 +21,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebGatePlugin", "Plugins\MediatorPlugins\WebGatePlugin\WebGatePlugin.csproj", "{20B192BC-FD4D-4ED5-90F5-B5994F995238}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SocketGatePlugin", "Plugins\MediatorPlugins\SocketGatePlugin\SocketGatePlugin.csproj", "{7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -55,6 +57,10 @@ {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Debug|Any CPU.Build.0 = Debug|Any CPU {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.ActiveCfg = Release|Any CPU {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.Build.0 = Release|Any CPU + {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -67,5 +73,6 @@ {A855D392-4817-4408-80CE-61D8C8E77322} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {B75187D7-2032-44F3-AC12-20804C7229AC} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} + {7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} EndGlobalSection EndGlobal Property changes on: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin ___________________________________________________________________ Name: svn:ignore + bin obj Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/Properties/AssemblyInfo.cs 2008-06-15 09:47:32 UTC (rev 250) @@ -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("SocketGatePlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("SocketGatePlugin")] +[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("035b7387-891a-4394-9278-fa1e8394bc20")] + +// 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")] Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketGatePlugin.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketGatePlugin.csproj 2008-06-15 09:47:32 UTC (rev 250) @@ -0,0 +1,50 @@ +<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>{7F5F7FFF-C09D-49A0-8CBF-5A53A9FFCC86}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SocketGatePlugin</RootNamespace> + <AssemblyName>SocketGatePlugin</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" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</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> \ No newline at end of file Copied: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketServerPlugin.cs (from rev 247, ACMServer/trunk/ACMServer/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketServerPlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/SocketGatePlugin/SocketServerPlugin.cs 2008-06-15 09:47:32 UTC (rev 250) @@ -0,0 +1,59 @@ +using System; +using AcmContester.Mediator.Library.Plugins; +using AcmContester.Library.Connector; +using AcmContester.Mediator.Library.Data; + +namespace AcmContester.Mediator.Library.Plugins.SocketGate +{ + /// <summary> + /// Pattern: Singleton + /// </summary> + class SocketServerPlugin : BaseMediatorPlugin + { + private static SocketServerPlugin instance = new SocketServerPlugin(); + + private SocketServer server = new SocketServer(); + private DataMediator dataContainer = new DataMediator(); + + private SocketServerPlugin() + { + server.Start(); + server.onDataArrived += DataArrived; + } + + public static SocketServerPlugin GetInstance() + { + return instance; + } + + public override void Send(string message) + { + WorkingData("SocketServerPlugin::Send(" + message + ")"); + if (server.CountClients() > 0) + if (dataContainer.Add(new Submit(message))) + server.Send(message); + } + + protected override void DataArrived(string message) + { + WorkingData("SocketServerPlugin::DataArrived(" + message + ")"); + dataContainer.Return(new Result(message)); + base.DataArrived(message); + } + + internal int CountClients() + { + if (server == null) + return 0; + return server.CountClients(); + } + + internal void Stop() + { + WorkingData("SocketServerPlugin::Stop()"); + if (server != null) + server.Stop(); + server = null; + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 09:37:22
|
Revision: 249 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=249&view=rev Author: brus07 Date: 2008-06-15 02:36:58 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Change for real work "WebGatePlugin" Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs Added: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGate.cs 2008-06-15 09:36:58 UTC (rev 249) @@ -0,0 +1,22 @@ +using System; +using AcmContester.Library.Connector; + +namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin +{ + /// <summary> + /// Pattern: Singleton + /// </summary> + class WebGate: WebConnector + { + private static WebGate instance = new WebGate(); + + private WebGate() + { + } + + public static WebGate GetInstance() + { + return instance; + } + } +} Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-06-15 08:53:54 UTC (rev 248) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-06-15 09:36:58 UTC (rev 249) @@ -4,30 +4,20 @@ namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin { - /// <summary> - /// Pattern: Singleton - /// </summary> public class WebGatePlugin: BaseMediatorPlugin { - //private static WebGatePlugin instance = new WebGatePlugin(); + WebGate webGate; - private WebConnector connector = new WebConnector(); - public WebGatePlugin() { - connector.onDataArrived += DataArrived; + webGate = WebGate.GetInstance(); + webGate.onDataArrived += DataArrived; } - public static WebGatePlugin GetInstance() - { - return null; - //return instance; - } - public override void Send(string message) { WorkingData("WebGatePlugin::Send(" + message + ")"); - connector.Send(message); + webGate.Send(message); } } } Modified: ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-06-15 08:53:54 UTC (rev 248) +++ ACMServer/trunk/ACMServer/Plugins/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-06-15 09:36:58 UTC (rev 249) @@ -29,9 +29,12 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WebGate.cs" /> <Compile Include="WebGatePlugin.cs" /> </ItemGroup> <ItemGroup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 08:53:45
|
Revision: 248 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=248&view=rev Author: brus07 Date: 2008-06-15 01:53:54 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Now work with new folder structure in Plugin model. New structure is "PluginFolder/PluginName/PluginName.dll". Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs Modified: ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2008-06-15 08:27:38 UTC (rev 247) +++ ACMServer/trunk/ACMServer/Plugins/PluginsFramework/PluginsLoader.cs 2008-06-15 08:53:54 UTC (rev 248) @@ -18,10 +18,13 @@ List<T> plugins = new List<T>(); if (!Directory.Exists(path)) throw new ArgumentException("Specified path does not exists!"); - string[] allFiles = Directory.GetFiles(path, "*.dllx", SearchOption.TopDirectoryOnly); - foreach (string file in allFiles) + string[] allDirectories = Directory.GetDirectories(path); + //string[] allFiles = Directory.GetFiles(path, "*.dllx", SearchOption.TopDirectoryOnly); + foreach (string directory in allDirectories) { - ScanAndLoad(file, plugins); + string fileName = directory.Substring(directory.LastIndexOf('\\')+1) + ".dll"; + string fileFullName = directory + "\\" + fileName; + ScanAndLoad(fileFullName, plugins); } return plugins; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-15 08:27:35
|
Revision: 247 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=247&view=rev Author: brus07 Date: 2008-06-15 01:27:38 -0700 (Sun, 15 Jun 2008) Log Message: ----------- Deleted accepted solution of task "LoadFromDll". Removed Paths: ------------- ACMServer/trunk/tasks/Load_from_dll/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-11 21:39:05
|
Revision: 246 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=246&view=rev Author: brus07 Date: 2008-06-11 14:39:07 -0700 (Wed, 11 Jun 2008) Log Message: ----------- Rename folder from "Plugin" to "Plugins" Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Added Paths: ----------- ACMServer/trunk/ACMServer/Plugins/ Removed Paths: ------------- ACMServer/trunk/ACMServer/Plugin/ Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-11 14:17:19 UTC (rev 245) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-11 21:39:07 UTC (rev 246) @@ -11,16 +11,16 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{D80861F5-3751-4D49-884B-1A10FE1BCB07}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginsFramework", "Plugin\PluginsFramework\PluginsFramework.csproj", "{69FB4176-F298-4AF7-B714-B6758AA9A58E}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MediatorPlugins", "MediatorPlugins", "{E4F4B91E-CC25-410B-B53A-E2507EFA4FCB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin1", "Plugin\MediatorPlugins\Plugin1\Plugin1.csproj", "{B75187D7-2032-44F3-AC12-20804C7229AC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin1", "Plugins\MediatorPlugins\Plugin1\Plugin1.csproj", "{B75187D7-2032-44F3-AC12-20804C7229AC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testRun", "Plugin\testRun\testRun.csproj", "{A855D392-4817-4408-80CE-61D8C8E77322}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginsFramework", "Plugins\PluginsFramework\PluginsFramework.csproj", "{69FB4176-F298-4AF7-B714-B6758AA9A58E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebGatePlugin", "Plugin\MediatorPlugins\WebGatePlugin\WebGatePlugin.csproj", "{20B192BC-FD4D-4ED5-90F5-B5994F995238}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testRun", "Plugins\testRun\testRun.csproj", "{A855D392-4817-4408-80CE-61D8C8E77322}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebGatePlugin", "Plugins\MediatorPlugins\WebGatePlugin\WebGatePlugin.csproj", "{20B192BC-FD4D-4ED5-90F5-B5994F995238}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -39,14 +39,14 @@ {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Release|Any CPU.Build.0 = Release|Any CPU {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Debug|Any CPU.Build.0 = Debug|Any CPU {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Release|Any CPU.ActiveCfg = Release|Any CPU {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Release|Any CPU.Build.0 = Release|Any CPU - {B75187D7-2032-44F3-AC12-20804C7229AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B75187D7-2032-44F3-AC12-20804C7229AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B75187D7-2032-44F3-AC12-20804C7229AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B75187D7-2032-44F3-AC12-20804C7229AC}.Release|Any CPU.Build.0 = Release|Any CPU {A855D392-4817-4408-80CE-61D8C8E77322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A855D392-4817-4408-80CE-61D8C8E77322}.Debug|Any CPU.Build.0 = Debug|Any CPU {A855D392-4817-4408-80CE-61D8C8E77322}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -62,8 +62,8 @@ GlobalSection(NestedProjects) = preSolution {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {69FB4176-F298-4AF7-B714-B6758AA9A58E} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} - {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {A855D392-4817-4408-80CE-61D8C8E77322} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {B75187D7-2032-44F3-AC12-20804C7229AC} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} Copied: ACMServer/trunk/ACMServer/Plugins (from rev 245, ACMServer/trunk/ACMServer/Plugin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tor...@us...> - 2008-06-11 14:17:47
|
Revision: 245 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=245&view=rev Author: torax777 Date: 2008-06-11 07:17:19 -0700 (Wed, 11 Jun 2008) Log Message: ----------- PluginsLoader works now with both interface and abstract class derived classes. Renamed source file from PluginLoader.cs to PluginsLoader.cs Modified Paths: -------------- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj Added Paths: ----------- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsLoader.cs Removed Paths: ------------- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs Deleted: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs 2008-06-11 09:15:49 UTC (rev 244) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs 2008-06-11 14:17:19 UTC (rev 245) @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.IO; - -namespace AcmContester.Plugins.PluginsFramework -{ - public static class PluginsLoader<T> where T : class - { - /// <summary> - /// Try to load all the instances of type T in all the DLLs, - /// found at path - /// </summary> - /// <param name="path">Path where to find appropriate DLLs</param> - /// <returns>List of all instaces found</returns> - public static List<T> Load(string path) - { - List<T> plugins = new List<T>(); - if (!Directory.Exists(path)) - throw new ArgumentException("Specified path does not exists!"); - string[] allFiles = Directory.GetFiles(path, "*.dllx", SearchOption.TopDirectoryOnly); - foreach (string file in allFiles) - { - ScanAndLoad(file, plugins); - } - return plugins; - } - - /// <summary> - /// Load all instances of type T in specified file and - /// add them to provided list - /// </summary> - /// <param name="filename">Which file to scan</param> - /// <param name="lst">Where to add found objects</param> - private static void ScanAndLoad(string filename, List<T> lst) - { - Assembly assembly = Assembly.LoadFrom(filename); - if (assembly != null) - { - Type[] types = assembly.GetExportedTypes(); - - foreach (Type t in types) - { - try - { - if (t.IsClass && !t.IsAbstract) - if (t.GetInterface(typeof(T).FullName) != null || t.GetMember(typeof(T).FullName) != null) - lst.Add((T)Activator.CreateInstance(t)); - } - catch (System.Reflection.TargetInvocationException ex) - { - //throw ex; - } - catch (System.MissingMethodException ex) - { - //throw ex; - } - catch (System.InvalidCastException ex) - { - //throw ex; - } - catch (Exception ex) - { - //throw ex; - } - } - } - } - } -} Modified: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj 2008-06-11 09:15:49 UTC (rev 244) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj 2008-06-11 14:17:19 UTC (rev 245) @@ -32,7 +32,7 @@ </ItemGroup> <ItemGroup> <Compile Include="BaseMediatorPlugin.cs" /> - <Compile Include="PluginLoader.cs" /> + <Compile Include="PluginsLoader.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Added: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsLoader.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsLoader.cs 2008-06-11 14:17:19 UTC (rev 245) @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.IO; + +namespace AcmContester.Plugins.PluginsFramework +{ + public static class PluginsLoader<T> where T : class + { + /// <summary> + /// Try to load all the instances of type T in all the DLLs, + /// found at path + /// </summary> + /// <param name="path">Path where to find appropriate DLLs</param> + /// <returns>List of all instaces found</returns> + public static List<T> Load(string path) + { + List<T> plugins = new List<T>(); + if (!Directory.Exists(path)) + throw new ArgumentException("Specified path does not exists!"); + string[] allFiles = Directory.GetFiles(path, "*.dllx", SearchOption.TopDirectoryOnly); + foreach (string file in allFiles) + { + ScanAndLoad(file, plugins); + } + return plugins; + } + + /// <summary> + /// Load all instances of type T in specified file and + /// add them to provided list + /// </summary> + /// <param name="filename">Which file to scan</param> + /// <param name="lst">Where to add found objects</param> + private static void ScanAndLoad(string filename, List<T> lst) + { + Assembly assembly = Assembly.LoadFrom(filename); + if (assembly != null) + { + Type[] types = assembly.GetExportedTypes(); + + foreach (Type t in types) + { + try + { + if (t.IsClass && !t.IsAbstract) + if (t.GetInterface(typeof(T).FullName) != null || t.IsSubclassOf(typeof(T))) + lst.Add((T)Activator.CreateInstance(t)); + } + catch (System.Reflection.TargetInvocationException ex) + { + //throw ex; + } + catch (System.MissingMethodException ex) + { + //throw ex; + } + catch (System.InvalidCastException ex) + { + //throw ex; + } + catch (Exception ex) + { + //throw ex; + } + } + } + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-11 09:15:41
|
Revision: 244 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=244&view=rev Author: brus07 Date: 2008-06-11 02:15:49 -0700 (Wed, 11 Jun 2008) Log Message: ----------- Added new plugin project. Load plugin from folder Dll, and file extension *.dllx Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs Added Paths: ----------- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class2.cs ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/Properties/ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs Removed Paths: ------------- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-11 07:03:37 UTC (rev 243) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-11 09:15:49 UTC (rev 244) @@ -19,6 +19,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testRun", "Plugin\testRun\testRun.csproj", "{A855D392-4817-4408-80CE-61D8C8E77322}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebGatePlugin", "Plugin\MediatorPlugins\WebGatePlugin\WebGatePlugin.csproj", "{20B192BC-FD4D-4ED5-90F5-B5994F995238}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -49,6 +51,10 @@ {A855D392-4817-4408-80CE-61D8C8E77322}.Debug|Any CPU.Build.0 = Debug|Any CPU {A855D392-4817-4408-80CE-61D8C8E77322}.Release|Any CPU.ActiveCfg = Release|Any CPU {A855D392-4817-4408-80CE-61D8C8E77322}.Release|Any CPU.Build.0 = Release|Any CPU + {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20B192BC-FD4D-4ED5-90F5-B5994F995238}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -60,5 +66,6 @@ {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {A855D392-4817-4408-80CE-61D8C8E77322} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} {B75187D7-2032-44F3-AC12-20804C7229AC} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} + {20B192BC-FD4D-4ED5-90F5-B5994F995238} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} EndGlobalSection EndGlobal Modified: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs 2008-06-11 07:03:37 UTC (rev 243) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -7,7 +7,9 @@ { public override void Send(string message) { - throw new Exception("The method or operation is not implemented."); + Console.WriteLine("Plugin1::Class1::Send(" + message + ");"); + Console.WriteLine("The method or operation is not implemented."); + //throw new Exception("The method or operation is not implemented."); } } } Added: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class2.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class2.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class2.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Plugin1 +{ + public class Class2 + { + public void Send(string message) + { + Console.WriteLine("Plugin1::Class2::Send(" + message + ");"); + Console.WriteLine("The method or operation is not implemented."); + //throw new Exception("The method or operation is not implemented."); + } + } +} Modified: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj 2008-06-11 07:03:37 UTC (rev 243) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj 2008-06-11 09:15:49 UTC (rev 244) @@ -32,6 +32,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Class1.cs" /> + <Compile Include="Class2.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> Property changes on: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin ___________________________________________________________________ Name: svn:ignore + bin obj WebGatePlugin.csproj.user Added: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/Properties/AssemblyInfo.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -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("WebGatePlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("WebGatePlugin")] +[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("4c84bd0e-8704-4e0e-94b4-d35256692a05")] + +// 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.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Copied: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs (from rev 238, ACMServer/trunk/ACMServer/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -0,0 +1,33 @@ +using System; +using AcmContester.Plugins.PluginsFramework; +using AcmContester.Library.Connector; + +namespace AcmContester.Plugins.MediatorPlugins.WebGatePlugin +{ + /// <summary> + /// Pattern: Singleton + /// </summary> + public class WebGatePlugin: BaseMediatorPlugin + { + //private static WebGatePlugin instance = new WebGatePlugin(); + + private WebConnector connector = new WebConnector(); + + public WebGatePlugin() + { + connector.onDataArrived += DataArrived; + } + + public static WebGatePlugin GetInstance() + { + return null; + //return instance; + } + + public override void Send(string message) + { + WorkingData("WebGatePlugin::Send(" + message + ")"); + connector.Send(message); + } + } +} Added: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/WebGatePlugin/WebGatePlugin.csproj 2008-06-11 09:15:49 UTC (rev 244) @@ -0,0 +1,55 @@ +<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>{20B192BC-FD4D-4ED5-90F5-B5994F995238}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>WebGatePlugin</RootNamespace> + <AssemblyName>WebGatePlugin</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" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WebGatePlugin.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Library\Connector\Connector.csproj"> + <Project>{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}</Project> + <Name>Connector</Name> + </ProjectReference> + <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</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> \ No newline at end of file Deleted: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs 2008-06-11 07:03:37 UTC (rev 243) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -1,9 +0,0 @@ -using System; - -namespace AcmContester.Plugins.PluginsFramework -{ - public abstract class BaseMediatorPlugin - { - public abstract void Send(string message); - } -} Copied: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs (from rev 238, ACMServer/trunk/ACMServer/Mediator/Library/Plugins/BaseMediatorPlugin.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -0,0 +1,28 @@ +using System; + +namespace AcmContester.Plugins.PluginsFramework +{ + public abstract class BaseMediatorPlugin + { + public delegate void DataArrived_EventHandler(string message); + public event DataArrived_EventHandler onDataArrived; + + public delegate void WorkingData_EventHandler(string message); + public event WorkingData_EventHandler onWorkingData; + + public abstract void Send(string message); + + protected virtual void DataArrived(string message) + { + WorkingData("BaseMediatorPlugin::DataArrived(" + message + ")"); + if (onDataArrived != null) + onDataArrived(message); + } + + protected virtual void WorkingData(string message) + { + if (onWorkingData != null) + onWorkingData(message); + } + } +} Modified: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs 2008-06-11 07:03:37 UTC (rev 243) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -18,7 +18,7 @@ List<T> plugins = new List<T>(); if (!Directory.Exists(path)) throw new ArgumentException("Specified path does not exists!"); - string[] allFiles = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); + string[] allFiles = Directory.GetFiles(path, "*.dllx", SearchOption.TopDirectoryOnly); foreach (string file in allFiles) { ScanAndLoad(file, plugins); @@ -43,16 +43,25 @@ { try { - if (t.IsClass && !t.IsAbstract && (t.GetInterface(typeof(T).FullName) != null || t.GetMember(typeof(T).FullName) != null)) - lst.Add((T)Activator.CreateInstance(t)); + if (t.IsClass && !t.IsAbstract) + if (t.GetInterface(typeof(T).FullName) != null || t.GetMember(typeof(T).FullName) != null) + lst.Add((T)Activator.CreateInstance(t)); } catch (System.Reflection.TargetInvocationException ex) { - throw ex; + //throw ex; } + catch (System.MissingMethodException ex) + { + //throw ex; + } + catch (System.InvalidCastException ex) + { + //throw ex; + } catch (Exception ex) { - throw ex; + //throw ex; } } } Modified: ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs 2008-06-11 07:03:37 UTC (rev 243) +++ ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs 2008-06-11 09:15:49 UTC (rev 244) @@ -2,12 +2,18 @@ using AcmContester.Plugins.PluginsFramework; using System.Collections.Generic; +using System.Security; +using System.Reflection; + + namespace testRun { + class Program { static void Main(string[] args) { + //BaseMediatorPlugin wgp = new AcmContester.Plugins.MediatorPlugins.WebGatePlugin.WebGatePlugin(); List<BaseMediatorPlugin> plugins = PluginsLoader<BaseMediatorPlugin>.Load("Dll"); foreach (BaseMediatorPlugin cp in plugins) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-06-11 07:03:30
|
Revision: 243 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=243&view=rev Author: Oracle_ Date: 2008-06-11 00:03:37 -0700 (Wed, 11 Jun 2008) Log Message: ----------- Added extended details for TSecure->RunProcess. Modified Paths: -------------- ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp Modified: ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp =================================================================== --- ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp 2008-06-10 22:41:51 UTC (rev 242) +++ ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp 2008-06-11 07:03:37 UTC (rev 243) @@ -15,7 +15,7 @@ namespace SourceTest { -char* StrToArr(String^ str) //converts Managed String to C++ string to +char* StrToArr(String^ str) //converts Managed String to C++ string { return (char*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str).ToPointer(); } @@ -366,7 +366,7 @@ return TRUE; } -BOOL AddPrivilege(HANDLE hToken,LPCTSTR lpszPrivilege) //adds privilege to process token (in this version unused) +BOOL AddPrivilege(HANDLE hToken,LPCTSTR lpszPrivilege) //adds privilege to process token { TOKEN_PRIVILEGES tp; LUID luid; @@ -844,6 +844,13 @@ wchar_t buflpCommandLine[MAX_PATH+1]; if (!GetFullPathName(lpCommandLine,MAX_PATH,buflpCommandLine,NULL)) wcscpy(buflpCommandLine,lpCommandLine); + HANDLE myToken; + if (OpenProcessToken(GetCurrentProcess(),TOKEN_ALL_ACCESS,&myToken)) + { + if (AddPrivilege(myToken,SE_INCREASE_QUOTA_NAME)) + { + if (AddPrivilege(myToken,SE_ASSIGNPRIMARYTOKEN_NAME)) + { if (LogonUser((LPWSTR)USER_NAME,(LPWSTR)".",(LPWSTR)USER_PASSW,LOGON32_LOGON_NETWORK,LOGON32_PROVIDER_DEFAULT,&Token)) { FileInfo^ fi=gcnew FileInfo(gcnew String(lpCommandLine)); @@ -861,13 +868,25 @@ DestroyEnvironmentBlock(env); RevertToSelf(); CloseHandle(token); + CloseHandle(myToken); Details="Secured process. Result details: "; return true; - } - } - } - } - } + } else + Details="Unsecured process. CreateProcessAsUser failed. Error#"+GetLastError().ToString()+" Result details: "; + } else + Details="Unsecured process. CreateEnvironmentBlock failed. Error#"+GetLastError().ToString()+" Result details: "; + } else + Details="Unsecured process. ImpersonateLoggedOnUser failed. Error#"+GetLastError().ToString()+" Result details: "; + } else + Details="Unsecured process. DuplicateTokenEx failed. Error#"+GetLastError().ToString()+" Result details: "; + } else + Details="Unsecured process. LogonUser failed. Error#"+GetLastError().ToString()+" Result details: "; + } else + Details="Unsecured process. SE_ASSIGNPRIMARYTOKEN_NAME unavailable. Result details: "; + } else + Details="Unsecured process. SE_INCREASE_QUOTA_NAME unavailable. Result details: "; + } else + Details="Unsecured process. OpenProcessToken failed. Error#"+GetLastError().ToString()+" Result details: "; if (env!=NULL) DestroyEnvironmentBlock(env); RevertToSelf(); @@ -875,7 +894,8 @@ CloseHandle(token); if (Token!=NULL) CloseHandle(Token); - Details="Unsecured process. Result details: "; + if (myToken!=NULL) + CloseHandle(myToken); if (CreateProcess(NULL,buflpCommandLine,NULL,NULL,bInheritHandles,dwCreationFlags,NULL,NULL,lpStartupInfo,lpProcessInformation)) return true; return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-10 22:41:45
|
Revision: 242 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=242&view=rev Author: brus07 Date: 2008-06-10 15:41:51 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Added module for work with Plugin. This version don't work correct, but for stat is good. Modified Paths: -------------- ACMServer/trunk/ACMServer/ACMMediator.sln Added Paths: ----------- ACMServer/trunk/ACMServer/Plugin/ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Properties/ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugin/PluginsFramework/ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj ACMServer/trunk/ACMServer/Plugin/PluginsFramework/Properties/ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugin/testRun/ ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs ACMServer/trunk/ACMServer/Plugin/testRun/Properties/ ACMServer/trunk/ACMServer/Plugin/testRun/Properties/AssemblyInfo.cs ACMServer/trunk/ACMServer/Plugin/testRun/testRun.csproj Modified: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-10 21:33:12 UTC (rev 241) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-10 22:41:51 UTC (rev 242) @@ -9,6 +9,16 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{D80861F5-3751-4D49-884B-1A10FE1BCB07}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PluginsFramework", "Plugin\PluginsFramework\PluginsFramework.csproj", "{69FB4176-F298-4AF7-B714-B6758AA9A58E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MediatorPlugins", "MediatorPlugins", "{E4F4B91E-CC25-410B-B53A-E2507EFA4FCB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin1", "Plugin\MediatorPlugins\Plugin1\Plugin1.csproj", "{B75187D7-2032-44F3-AC12-20804C7229AC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testRun", "Plugin\testRun\testRun.csproj", "{A855D392-4817-4408-80CE-61D8C8E77322}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +37,18 @@ {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU + {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69FB4176-F298-4AF7-B714-B6758AA9A58E}.Release|Any CPU.Build.0 = Release|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B75187D7-2032-44F3-AC12-20804C7229AC}.Release|Any CPU.Build.0 = Release|Any CPU + {A855D392-4817-4408-80CE-61D8C8E77322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A855D392-4817-4408-80CE-61D8C8E77322}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A855D392-4817-4408-80CE-61D8C8E77322}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A855D392-4817-4408-80CE-61D8C8E77322}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -34,5 +56,9 @@ GlobalSection(NestedProjects) = preSolution {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + {69FB4176-F298-4AF7-B714-B6758AA9A58E} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} + {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} + {A855D392-4817-4408-80CE-61D8C8E77322} = {D80861F5-3751-4D49-884B-1A10FE1BCB07} + {B75187D7-2032-44F3-AC12-20804C7229AC} = {E4F4B91E-CC25-410B-B53A-E2507EFA4FCB} EndGlobalSection EndGlobal Property changes on: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1 ___________________________________________________________________ Name: svn:ignore + bin obj Added: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Class1.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,13 @@ +using System; +using AcmContester.Plugins.PluginsFramework; + +namespace Plugin1 +{ + public class Class1: BaseMediatorPlugin + { + public override void Send(string message) + { + throw new Exception("The method or operation is not implemented."); + } + } +} Added: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Plugin1.csproj 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,51 @@ +<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>{B75187D7-2032-44F3-AC12-20804C7229AC}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Plugin1</RootNamespace> + <AssemblyName>Plugin1</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" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</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> \ No newline at end of file Added: ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/MediatorPlugins/Plugin1/Properties/AssemblyInfo.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -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("Plugin1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("Plugin1")] +[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("884ef2ba-83e8-4216-aeff-fcf599685fe9")] + +// 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.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Property changes on: ACMServer/trunk/ACMServer/Plugin/PluginsFramework ___________________________________________________________________ Name: svn:ignore + bin obj PluginsFramework.csproj.user Added: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/BaseMediatorPlugin.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,9 @@ +using System; + +namespace AcmContester.Plugins.PluginsFramework +{ + public abstract class BaseMediatorPlugin + { + public abstract void Send(string message); + } +} Copied: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs (from rev 241, ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs) =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginLoader.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.IO; + +namespace AcmContester.Plugins.PluginsFramework +{ + public static class PluginsLoader<T> where T : class + { + /// <summary> + /// Try to load all the instances of type T in all the DLLs, + /// found at path + /// </summary> + /// <param name="path">Path where to find appropriate DLLs</param> + /// <returns>List of all instaces found</returns> + public static List<T> Load(string path) + { + List<T> plugins = new List<T>(); + if (!Directory.Exists(path)) + throw new ArgumentException("Specified path does not exists!"); + string[] allFiles = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); + foreach (string file in allFiles) + { + ScanAndLoad(file, plugins); + } + return plugins; + } + + /// <summary> + /// Load all instances of type T in specified file and + /// add them to provided list + /// </summary> + /// <param name="filename">Which file to scan</param> + /// <param name="lst">Where to add found objects</param> + private static void ScanAndLoad(string filename, List<T> lst) + { + Assembly assembly = Assembly.LoadFrom(filename); + if (assembly != null) + { + Type[] types = assembly.GetExportedTypes(); + + foreach (Type t in types) + { + try + { + if (t.IsClass && !t.IsAbstract && (t.GetInterface(typeof(T).FullName) != null || t.GetMember(typeof(T).FullName) != null)) + lst.Add((T)Activator.CreateInstance(t)); + } + catch (System.Reflection.TargetInvocationException ex) + { + throw ex; + } + catch (Exception ex) + { + throw ex; + } + } + } + } + } +} Added: ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/PluginsFramework.csproj 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,46 @@ +<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>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>PluginsFramework</RootNamespace> + <AssemblyName>PluginsFramework</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" /> + </ItemGroup> + <ItemGroup> + <Compile Include="BaseMediatorPlugin.cs" /> + <Compile Include="PluginLoader.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </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/Plugin/PluginsFramework/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/PluginsFramework/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/PluginsFramework/Properties/AssemblyInfo.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -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("PluginsFramework")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("PluginsFramework")] +[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("aa9fb204-2ead-4c86-8300-759dbd0bb07e")] + +// 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.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Property changes on: ACMServer/trunk/ACMServer/Plugin/testRun ___________________________________________________________________ Name: svn:ignore + bin obj Added: ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/testRun/Program.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,20 @@ +using System; +using AcmContester.Plugins.PluginsFramework; +using System.Collections.Generic; + +namespace testRun +{ + class Program + { + static void Main(string[] args) + { + List<BaseMediatorPlugin> plugins = PluginsLoader<BaseMediatorPlugin>.Load("Dll"); + + foreach (BaseMediatorPlugin cp in plugins) + { + cp.Send("aaa"); + } + + } + } +} Added: ACMServer/trunk/ACMServer/Plugin/testRun/Properties/AssemblyInfo.cs =================================================================== --- ACMServer/trunk/ACMServer/Plugin/testRun/Properties/AssemblyInfo.cs (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/testRun/Properties/AssemblyInfo.cs 2008-06-10 22:41:51 UTC (rev 242) @@ -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("testRun")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Home")] +[assembly: AssemblyProduct("testRun")] +[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("2c65da36-7eee-474f-ba38-097e346b2839")] + +// 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")] Added: ACMServer/trunk/ACMServer/Plugin/testRun/testRun.csproj =================================================================== --- ACMServer/trunk/ACMServer/Plugin/testRun/testRun.csproj (rev 0) +++ ACMServer/trunk/ACMServer/Plugin/testRun/testRun.csproj 2008-06-10 22:41:51 UTC (rev 242) @@ -0,0 +1,52 @@ +<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>{A855D392-4817-4408-80CE-61D8C8E77322}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>testRun</RootNamespace> + <AssemblyName>testRun</AssemblyName> + <SignManifests>false</SignManifests> + </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" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\PluginsFramework\PluginsFramework.csproj"> + <Project>{69FB4176-F298-4AF7-B714-B6758AA9A58E}</Project> + <Name>PluginsFramework</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> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-10 21:33:04
|
Revision: 241 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=241&view=rev Author: brus07 Date: 2008-06-10 14:33:12 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Deleted commented block with old class Modified Paths: -------------- ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs Property Changed: ---------------- ACMServer/trunk/tasks/Load_from_dll/ Property changes on: ACMServer/trunk/tasks/Load_from_dll ___________________________________________________________________ Name: svn:ignore - *.suo + *.suo Ankh.Load Modified: ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs 2008-06-10 21:29:39 UTC (rev 240) +++ ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs 2008-06-10 21:33:12 UTC (rev 241) @@ -58,102 +58,4 @@ } } } - - //public class PluginLoader - //{ - // List<ICreaterPlugin> _plugins = new List<ICreaterPlugin>(); - - // /// <summary> - // /// returns a list of all plugins loaded. - // /// </summary> - // /// <value>The plugins.</value> - // public List<ICreaterPlugin> Plugins - // { - // get { return _plugins; } - // } - // /// <summary> - // /// Loads all plugins. - // /// </summary> - // public void Load() - // { - // _plugins.Clear(); - // try - // { - // if (System.IO.Directory.Exists("Dll")) - // { - // string[] strFiles = System.IO.Directory.GetFiles("Dll", "*.dll"); - // foreach (string strFile in strFiles) - // LoadPlugin(strFile); - // } - // } - // catch (Exception ex) - // { - // throw ex; - // } - // } - // /// <summary> - // /// Loads the plugin. - // /// </summary> - // /// <param name="strFile">The STR file.</param> - // void LoadPlugin(string strFile) - // { - // Type[] foundInterfaces = null; - - // try - // { - // Assembly assem = Assembly.LoadFrom(strFile); - // if (assem != null) - // { - // Type[] types = assem.GetExportedTypes(); - - // foreach (Type t in types) - // { - // try - // { - // if (t.IsClass) - // { - // if (t.IsAbstract) continue; - - // Object newObj = null; - // ICreaterPlugin plugin = null; - // TypeFilter myFilter2 = new TypeFilter(MyInterfaceFilter); - // try - // { - // foundInterfaces = t.FindInterfaces(myFilter2, "BasePlug.ICreaterPlugin"); - // if (foundInterfaces.Length > 0) - // { - // newObj = (object)Activator.CreateInstance(t); - // plugin = (ICreaterPlugin)newObj; - // _plugins.Add(plugin); - // } - // } - // catch (System.Reflection.TargetInvocationException ex) - // { - // throw ex; - // } - // catch (Exception ex) - // { - // throw ex; - // } - // } - // } - // catch (System.NullReferenceException ex) - // { - // throw ex; - // } - // } - // } - // } - // catch (Exception ex) - // { - // throw ex; - // } - // } - - // bool MyInterfaceFilter(Type typeObj, Object criteriaObj) - // { - // return (typeObj.ToString().Equals(criteriaObj.ToString())); - // } - - //} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-10 21:29:31
|
Revision: 240 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=240&view=rev Author: brus07 Date: 2008-06-10 14:29:39 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Update function, in which run Checker, and add logging in this function. Modified Paths: -------------- ACMServer/trunk/ACMServer/Checker/Checker.csproj ACMServer/trunk/ACMServer/Tester/Form1.cs Modified: ACMServer/trunk/ACMServer/Checker/Checker.csproj =================================================================== --- ACMServer/trunk/ACMServer/Checker/Checker.csproj 2008-06-10 21:24:11 UTC (rev 239) +++ ACMServer/trunk/ACMServer/Checker/Checker.csproj 2008-06-10 21:29:39 UTC (rev 240) @@ -59,4 +59,8 @@ <Target Name="AfterBuild"> </Target> --> + <PropertyGroup> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> </Project> \ No newline at end of file Modified: ACMServer/trunk/ACMServer/Tester/Form1.cs =================================================================== --- ACMServer/trunk/ACMServer/Tester/Form1.cs 2008-06-10 21:24:11 UTC (rev 239) +++ ACMServer/trunk/ACMServer/Tester/Form1.cs 2008-06-10 21:29:39 UTC (rev 240) @@ -52,8 +52,20 @@ } private void DataArrived(string message) { + string result = ""; textBox1.Text += "\r\n" + message; - string result = Checker.Checker.GetResult(message); + try + { + + result = Checker.Checker.GetResult(message); + } + catch (Exception ex) + { + Log log = Log.GetLog(); + log.Loging("Form1::DataArrived: Error: " + ex.Message, Log.Priority.ERR); + log.Loging("Form1::DataArrived: Error: " + ex.StackTrace, Log.Priority.ERR); + return; + } textBox1.Text += "\r\n\t-> " + result; socket.Send(result.ToString() + "$" + message); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-10 21:24:08
|
Revision: 239 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=239&view=rev Author: brus07 Date: 2008-06-10 14:24:11 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Commented old version to work with Web Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs Modified: ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs =================================================================== --- ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-06-10 12:02:27 UTC (rev 238) +++ ACMServer/trunk/ACMServer/Library/Connector/Getter/WebGetter.cs 2008-06-10 21:24:11 UTC (rev 239) @@ -34,14 +34,14 @@ return GetInfoFromSite2(); } - void Send1(string message) + /* + void Send1(string message) { WebBrowser webBrowser = new WebBrowser(); webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted); webBrowser.Navigate(fullPathToWebPages + "/a.php?p=321"); } - Mutex mut = new Mutex(); string document = ""; object GetInfoFromSite1() @@ -58,6 +58,7 @@ document = ((WebBrowser)sender).DocumentText; mut.ReleaseMutex(); } + */ void Send2(string message) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-10 12:02:21
|
Revision: 238 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=238&view=rev Author: brus07 Date: 2008-06-10 05:02:27 -0700 (Tue, 10 Jun 2008) Log Message: ----------- Added commented line with specification OS (XP), for easy use for brus07. Modified Paths: -------------- ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp Modified: ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp =================================================================== --- ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp 2008-06-09 23:01:26 UTC (rev 237) +++ ACMServer/branches/sharp tester/SourceTest/SourceTest.cpp 2008-06-10 12:02:27 UTC (rev 238) @@ -1,6 +1,7 @@ // This is the main DLL file. #include "stdafx.h" +//#define _WIN32_WINNT 0x0500 #include <stdio.h> #include "SourceTest.h" #include <LM.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-09 23:01:20
|
Revision: 237 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=237&view=rev Author: brus07 Date: 2008-06-09 16:01:26 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Edit solutions. Move projects. Modified Paths: -------------- ACMServer/trunk/ACMServer/Library/Connector/InDataW.txt Added Paths: ----------- ACMServer/trunk/ACMServer/ ACMServer/trunk/ACMServer/ACMMediator.sln ACMServer/trunk/ACMServer/ACMTester.sln ACMServer/trunk/ACMServer/Checker/ ACMServer/trunk/ACMServer/Library/ ACMServer/trunk/ACMServer/Mediator/ ACMServer/trunk/ACMServer/Resource/ ACMServer/trunk/ACMServer/SAMPLE/ ACMServer/trunk/ACMServer/Tester/ Removed Paths: ------------- ACMServer/trunk/MediatorSolution/ ACMServer/trunk/TesterSolution/ Property changes on: ACMServer/trunk/ACMServer ___________________________________________________________________ Name: svn:ignore + *.suo *.Load Added: ACMServer/trunk/ACMServer/ACMMediator.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMMediator.sln (rev 0) +++ ACMServer/trunk/ACMServer/ACMMediator.sln 2008-06-09 23:01:26 UTC (rev 237) @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mediator", "Mediator\Mediator.csproj", "{60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{9AC82C0B-F256-41DD-9B4A-A59EC7EB4890}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60AAB414-BF4A-4A67-9FF2-D04C3B4BBA9B}.Release|Any CPU.Build.0 = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {9AC82C0B-F256-41DD-9B4A-A59EC7EB4890} + EndGlobalSection +EndGlobal Added: ACMServer/trunk/ACMServer/ACMTester.sln =================================================================== --- ACMServer/trunk/ACMServer/ACMTester.sln (rev 0) +++ ACMServer/trunk/ACMServer/ACMTester.sln 2008-06-09 23:01:26 UTC (rev 237) @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tester", "Tester\Tester.csproj", "{3C6F91E7-56AA-4138-8A3F-FE70897153DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{72651BCE-2999-49F0-8B33-4F6E4EE824D0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connector", "Library\Connector\Connector.csproj", "{211DD6A5-2D73-439E-8722-ED2C89ED1DDB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryExtention", "Library\LibraryExtention\LibraryExtention.csproj", "{A8135069-F8BA-4E5D-835F-3FF3F350AA5D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Checker", "Checker\Checker.csproj", "{052D9F77-17AF-42F3-BFBF-975A19383496}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C6F91E7-56AA-4138-8A3F-FE70897153DA}.Release|Any CPU.Build.0 = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB}.Release|Any CPU.Build.0 = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D}.Release|Any CPU.Build.0 = Release|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Debug|Any CPU.Build.0 = Debug|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.ActiveCfg = Release|Any CPU + {052D9F77-17AF-42F3-BFBF-975A19383496}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {211DD6A5-2D73-439E-8722-ED2C89ED1DDB} = {72651BCE-2999-49F0-8B33-4F6E4EE824D0} + {A8135069-F8BA-4E5D-835F-3FF3F350AA5D} = {72651BCE-2999-49F0-8B33-4F6E4EE824D0} + EndGlobalSection +EndGlobal Copied: ACMServer/trunk/ACMServer/Checker (from rev 236, ACMServer/trunk/TesterSolution/Checker) Copied: ACMServer/trunk/ACMServer/Library (from rev 236, ACMServer/trunk/MediatorSolution/Library) Modified: ACMServer/trunk/ACMServer/Library/Connector/InDataW.txt =================================================================== --- ACMServer/trunk/MediatorSolution/Library/Connector/InDataW.txt 2008-06-09 22:33:14 UTC (rev 236) +++ ACMServer/trunk/ACMServer/Library/Connector/InDataW.txt 2008-06-09 23:01:26 UTC (rev 237) @@ -1,2 +1,2 @@ -http://acm.lviv.ua/version3 -http://127.0.0.1/d \ No newline at end of file +http://127.0.0.1/d +http://acm.lviv.ua/version3 \ No newline at end of file Copied: ACMServer/trunk/ACMServer/Mediator (from rev 236, ACMServer/trunk/MediatorSolution/Mediator) Copied: ACMServer/trunk/ACMServer/Resource (from rev 236, ACMServer/trunk/MediatorSolution/Resource) Copied: ACMServer/trunk/ACMServer/SAMPLE (from rev 236, ACMServer/trunk/TesterSolution/SAMPLE) Copied: ACMServer/trunk/ACMServer/Tester (from rev 236, ACMServer/trunk/TesterSolution/Tester) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-09 22:33:06
|
Revision: 236 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=236&view=rev Author: brus07 Date: 2008-06-09 15:33:14 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Update Log to new version Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Library/LibraryExtention/Log.cs Modified: ACMServer/trunk/MediatorSolution/Library/LibraryExtention/Log.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Library/LibraryExtention/Log.cs 2008-06-09 22:31:03 UTC (rev 235) +++ ACMServer/trunk/MediatorSolution/Library/LibraryExtention/Log.cs 2008-06-09 22:33:14 UTC (rev 236) @@ -96,8 +96,19 @@ //TODO: throw new Exception("WriterNullException"); } - writer.WriteLine(message); + lock (writer) + { + writer.WriteLine(message); + writer.Flush(); + } } } + ~Log() + { + if (writer != null) + { + writer.Close(); + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-09 22:30:58
|
Revision: 235 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=235&view=rev Author: brus07 Date: 2008-06-09 15:31:03 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Update Compiller path Modified Paths: -------------- ACMServer/trunk/TesterSolution/Checker/InData.txt Modified: ACMServer/trunk/TesterSolution/Checker/InData.txt =================================================================== --- ACMServer/trunk/TesterSolution/Checker/InData.txt 2008-06-09 21:59:33 UTC (rev 234) +++ ACMServer/trunk/TesterSolution/Checker/InData.txt 2008-06-09 22:31:03 UTC (rev 235) @@ -1,4 +1,4 @@ -d:\SAMPLE\D7.bat +d:\SAMPLE\Compillers\D7.bat d:\SAMPLE\Test\ d:\SAMPLE\Temp\ d:\SAMPLE\source.txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Tor...@us...> - 2008-06-09 21:59:27
|
Revision: 234 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=234&view=rev Author: Torax777 Date: 2008-06-09 14:59:33 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Redesigned solution. Interface moved to plugins loader. Implemented using generics. Modified Paths: -------------- ACMServer/trunk/tasks/Load_from_dll/Plugin1/CreaterPlugin.cs ACMServer/trunk/tasks/Load_from_dll/Plugin1/Plugin1.csproj ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs ACMServer/trunk/tasks/Load_from_dll/taskDll/Program.cs ACMServer/trunk/tasks/Load_from_dll/taskDll/taskDll.csproj ACMServer/trunk/tasks/Load_from_dll/taskDll.sln Added Paths: ----------- ACMServer/trunk/tasks/Load_from_dll/taskDll/ICreaterPlugin.cs Removed Paths: ------------- ACMServer/trunk/tasks/Load_from_dll/BasePlug/ Modified: ACMServer/trunk/tasks/Load_from_dll/Plugin1/CreaterPlugin.cs =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/Plugin1/CreaterPlugin.cs 2008-06-09 13:31:09 UTC (rev 233) +++ ACMServer/trunk/tasks/Load_from_dll/Plugin1/CreaterPlugin.cs 2008-06-09 21:59:33 UTC (rev 234) @@ -1,7 +1,6 @@ using System; -using BasePlug; -namespace Dll.Plugins +namespace PluginsFramework { public class CreaterPlugin: ICreaterPlugin { Modified: ACMServer/trunk/tasks/Load_from_dll/Plugin1/Plugin1.csproj =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/Plugin1/Plugin1.csproj 2008-06-09 13:31:09 UTC (rev 233) +++ ACMServer/trunk/tasks/Load_from_dll/Plugin1/Plugin1.csproj 2008-06-09 21:59:33 UTC (rev 234) @@ -37,9 +37,9 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\BasePlug\BasePlug.csproj"> - <Project>{3DE17E44-206E-4FC6-A700-0EA0161A2DC4}</Project> - <Name>BasePlug</Name> + <ProjectReference Include="..\taskDll\taskDll.csproj"> + <Project>{0AC9B72D-57AE-4EF9-9745-837F8E4343E5}</Project> + <Name>taskDll</Name> </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Added: ACMServer/trunk/tasks/Load_from_dll/taskDll/ICreaterPlugin.cs =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/taskDll/ICreaterPlugin.cs (rev 0) +++ ACMServer/trunk/tasks/Load_from_dll/taskDll/ICreaterPlugin.cs 2008-06-09 21:59:33 UTC (rev 234) @@ -0,0 +1,9 @@ +using System; + +namespace PluginsFramework +{ + public interface ICreaterPlugin + { + int calc(); + } +} Modified: ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs 2008-06-09 13:31:09 UTC (rev 233) +++ ACMServer/trunk/tasks/Load_from_dll/taskDll/PluginLoader.cs 2008-06-09 21:59:33 UTC (rev 234) @@ -1,105 +1,159 @@ using System; using System.Collections.Generic; -using BasePlug; using System.Reflection; +using System.IO; -namespace Other +namespace PluginsFramework { - public class PluginLoader + public static class PluginsLoader<T> where T : class { - List<ICreaterPlugin> _plugins = new List<ICreaterPlugin>(); - /// <summary> - /// returns a list of all plugins loaded. + /// Try to load all the instances of type T in all the DLLs, + /// found at path /// </summary> - /// <value>The plugins.</value> - public List<ICreaterPlugin> Plugins + /// <param name="path">Path where to find appropriate DLLs</param> + /// <returns>List of all instaces found</returns> + public static List<T> Load(string path) { - get { return _plugins; } - } - /// <summary> - /// Loads all plugins. - /// </summary> - public void Load() - { - _plugins.Clear(); - try + List<T> plugins = new List<T>(); + if (!Directory.Exists(path)) + throw new ArgumentException("Specified path does not exists!"); + string[] allFiles = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); + foreach (string file in allFiles) { - if (System.IO.Directory.Exists("Dll")) - { - string[] strFiles = System.IO.Directory.GetFiles("Dll", "*.dll"); - foreach (string strFile in strFiles) - LoadPlugin(strFile); - } + ScanAndLoad(file, plugins); } - catch (Exception ex) - { - throw ex; - } + return plugins; } + /// <summary> - /// Loads the plugin. + /// Load all instances of type T in specified file and + /// add them to provided list /// </summary> - /// <param name="strFile">The STR file.</param> - void LoadPlugin(string strFile) + /// <param name="filename">Which file to scan</param> + /// <param name="lst">Where to add found objects</param> + private static void ScanAndLoad(string filename, List<T> lst) { - Type[] foundInterfaces = null; + Assembly assembly = Assembly.LoadFrom(filename); + if (assembly != null) + { + Type[] types = assembly.GetExportedTypes(); - try - { - Assembly assem = Assembly.LoadFrom(strFile); - if (assem != null) + foreach (Type t in types) { - Type[] types = assem.GetExportedTypes(); - - foreach (Type t in types) + try { - try - { - if (t.IsClass) - { - if (t.IsAbstract) continue; - - Object newObj = null; - ICreaterPlugin plugin = null; - TypeFilter myFilter2 = new TypeFilter(MyInterfaceFilter); - try - { - foundInterfaces = t.FindInterfaces(myFilter2, "BasePlug.ICreaterPlugin"); - if (foundInterfaces.Length > 0) - { - newObj = (object)Activator.CreateInstance(t); - plugin = (ICreaterPlugin)newObj; - _plugins.Add(plugin); - } - } - catch (System.Reflection.TargetInvocationException ex) - { - throw ex; - } - catch (Exception ex) - { - throw ex; - } - } - } - catch (System.NullReferenceException ex) - { - throw ex; - } + if (t.IsClass && !t.IsAbstract && t.GetInterface(typeof(T).FullName) != null) + lst.Add((T)Activator.CreateInstance(t)); } + catch (System.Reflection.TargetInvocationException ex) + { + throw ex; + } + catch (Exception ex) + { + throw ex; + } } } - catch (Exception ex) - { - throw ex; - } } + } - bool MyInterfaceFilter(Type typeObj, Object criteriaObj) - { - return (typeObj.ToString().Equals(criteriaObj.ToString())); - } + //public class PluginLoader + //{ + // List<ICreaterPlugin> _plugins = new List<ICreaterPlugin>(); - } + // /// <summary> + // /// returns a list of all plugins loaded. + // /// </summary> + // /// <value>The plugins.</value> + // public List<ICreaterPlugin> Plugins + // { + // get { return _plugins; } + // } + // /// <summary> + // /// Loads all plugins. + // /// </summary> + // public void Load() + // { + // _plugins.Clear(); + // try + // { + // if (System.IO.Directory.Exists("Dll")) + // { + // string[] strFiles = System.IO.Directory.GetFiles("Dll", "*.dll"); + // foreach (string strFile in strFiles) + // LoadPlugin(strFile); + // } + // } + // catch (Exception ex) + // { + // throw ex; + // } + // } + // /// <summary> + // /// Loads the plugin. + // /// </summary> + // /// <param name="strFile">The STR file.</param> + // void LoadPlugin(string strFile) + // { + // Type[] foundInterfaces = null; + + // try + // { + // Assembly assem = Assembly.LoadFrom(strFile); + // if (assem != null) + // { + // Type[] types = assem.GetExportedTypes(); + + // foreach (Type t in types) + // { + // try + // { + // if (t.IsClass) + // { + // if (t.IsAbstract) continue; + + // Object newObj = null; + // ICreaterPlugin plugin = null; + // TypeFilter myFilter2 = new TypeFilter(MyInterfaceFilter); + // try + // { + // foundInterfaces = t.FindInterfaces(myFilter2, "BasePlug.ICreaterPlugin"); + // if (foundInterfaces.Length > 0) + // { + // newObj = (object)Activator.CreateInstance(t); + // plugin = (ICreaterPlugin)newObj; + // _plugins.Add(plugin); + // } + // } + // catch (System.Reflection.TargetInvocationException ex) + // { + // throw ex; + // } + // catch (Exception ex) + // { + // throw ex; + // } + // } + // } + // catch (System.NullReferenceException ex) + // { + // throw ex; + // } + // } + // } + // } + // catch (Exception ex) + // { + // throw ex; + // } + // } + + // bool MyInterfaceFilter(Type typeObj, Object criteriaObj) + // { + // return (typeObj.ToString().Equals(criteriaObj.ToString())); + // } + + //} } Modified: ACMServer/trunk/tasks/Load_from_dll/taskDll/Program.cs =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/taskDll/Program.cs 2008-06-09 13:31:09 UTC (rev 233) +++ ACMServer/trunk/tasks/Load_from_dll/taskDll/Program.cs 2008-06-09 21:59:33 UTC (rev 234) @@ -1,8 +1,7 @@ using System; -using Other; -using BasePlug; +using System.Collections.Generic; -namespace taskDll +namespace PluginsFramework { class Program { @@ -14,10 +13,9 @@ /// <param name="args"></param> static void Main(string[] args) { - PluginLoader plugins = new PluginLoader(); - plugins.Load(); + List<ICreaterPlugin> plugins = PluginsLoader<ICreaterPlugin>.Load("Dll"); - foreach(ICreaterPlugin cp in plugins.Plugins) + foreach(ICreaterPlugin cp in plugins) { Console.Out.WriteLine(cp.calc()); } Modified: ACMServer/trunk/tasks/Load_from_dll/taskDll/taskDll.csproj =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/taskDll/taskDll.csproj 2008-06-09 13:31:09 UTC (rev 233) +++ ACMServer/trunk/tasks/Load_from_dll/taskDll/taskDll.csproj 2008-06-09 21:59:33 UTC (rev 234) @@ -34,16 +34,11 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="ICreaterPlugin.cs" /> <Compile Include="PluginLoader.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\BasePlug\BasePlug.csproj"> - <Project>{3DE17E44-206E-4FC6-A700-0EA0161A2DC4}</Project> - <Name>BasePlug</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. Modified: ACMServer/trunk/tasks/Load_from_dll/taskDll.sln =================================================================== --- ACMServer/trunk/tasks/Load_from_dll/taskDll.sln 2008-06-09 13:31:09 UTC (rev 233) +++ ACMServer/trunk/tasks/Load_from_dll/taskDll.sln 2008-06-09 21:59:33 UTC (rev 234) @@ -3,12 +3,8 @@ # Visual Studio 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "taskDll", "taskDll\taskDll.csproj", "{0AC9B72D-57AE-4EF9-9745-837F8E4343E5}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dll", "Dll", "{CBD74D91-5EB9-4E4E-BF4B-D513ADD2B5D8}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin1", "Plugin1\Plugin1.csproj", "{CDE3968A-F7DE-4938-A5C8-22B0949B8565}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasePlug", "BasePlug\BasePlug.csproj", "{3DE17E44-206E-4FC6-A700-0EA0161A2DC4}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -23,15 +19,8 @@ {CDE3968A-F7DE-4938-A5C8-22B0949B8565}.Debug|Any CPU.Build.0 = Debug|Any CPU {CDE3968A-F7DE-4938-A5C8-22B0949B8565}.Release|Any CPU.ActiveCfg = Release|Any CPU {CDE3968A-F7DE-4938-A5C8-22B0949B8565}.Release|Any CPU.Build.0 = Release|Any CPU - {3DE17E44-206E-4FC6-A700-0EA0161A2DC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3DE17E44-206E-4FC6-A700-0EA0161A2DC4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3DE17E44-206E-4FC6-A700-0EA0161A2DC4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3DE17E44-206E-4FC6-A700-0EA0161A2DC4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {CDE3968A-F7DE-4938-A5C8-22B0949B8565} = {CBD74D91-5EB9-4E4E-BF4B-D513ADD2B5D8} - EndGlobalSection EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-09 13:31:20
|
Revision: 233 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=233&view=rev Author: brus07 Date: 2008-06-09 06:31:09 -0700 (Mon, 09 Jun 2008) Log Message: ----------- Delete not used directory (LoadFromDll) Removed Paths: ------------- ACMServer/branches/LoadFromDll/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <br...@us...> - 2008-06-09 13:19:25
|
Revision: 232 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=232&view=rev Author: brus07 Date: 2008-06-09 06:19:32 -0700 (Mon, 09 Jun 2008) Log Message: ----------- WorkingData event. When do something call this event. WorkingData append text to TextLog in main form. Scroll to end TextLog when change text. Modified Paths: -------------- ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs ACMServer/trunk/MediatorSolution/Mediator/Form1.cs ACMServer/trunk/MediatorSolution/Mediator/Form1.resx ACMServer/trunk/MediatorSolution/Mediator/Library/MediatorKernel.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.Designer.cs 2008-06-09 13:19:32 UTC (rev 232) @@ -34,9 +34,11 @@ this.button3 = 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.timerCountSocketClients = new System.Windows.Forms.Timer(this.components); this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.timerUpdateTextLog = new System.Windows.Forms.Timer(this.components); this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -75,9 +77,9 @@ // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripStatusLabel1}); - this.statusStrip1.Location = new System.Drawing.Point(0, 138); + this.statusStrip1.Location = new System.Drawing.Point(0, 295); this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(262, 22); + this.statusStrip1.Size = new System.Drawing.Size(369, 22); this.statusStrip1.TabIndex = 9; this.statusStrip1.Text = "statusStrip1"; // @@ -87,10 +89,10 @@ this.toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17); this.toolStripStatusLabel1.Text = "toolStripStatusLabel1"; // - // timer1 + // timerCountSocketClients // - this.timer1.Enabled = true; - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + this.timerCountSocketClients.Enabled = true; + this.timerCountSocketClients.Tick += new System.EventHandler(this.timer1_Tick); // // textBox1 // @@ -109,11 +111,30 @@ this.textBox2.Size = new System.Drawing.Size(110, 20); this.textBox2.TabIndex = 11; // + // textBox3 + // + this.textBox3.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.textBox3.Location = new System.Drawing.Point(12, 121); + this.textBox3.Multiline = true; + this.textBox3.Name = "textBox3"; + this.textBox3.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.textBox3.Size = new System.Drawing.Size(345, 171); + this.textBox3.TabIndex = 12; + // + // timerUpdateTextLog + // + this.timerUpdateTextLog.Enabled = true; + this.timerUpdateTextLog.Interval = 2000; + this.timerUpdateTextLog.Tick += new System.EventHandler(this.timerUpdateTextLog_Tick); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(262, 160); + this.ClientSize = new System.Drawing.Size(369, 317); + this.Controls.Add(this.textBox3); this.Controls.Add(this.textBox2); this.Controls.Add(this.textBox1); this.Controls.Add(this.statusStrip1); @@ -122,8 +143,8 @@ this.Controls.Add(this.button2); this.Name = "Form1"; this.Text = "Gate"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.Load += new System.EventHandler(this.Form1_Load); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.ResumeLayout(false); @@ -138,9 +159,11 @@ private System.Windows.Forms.Button button3; private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; - private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Timer timerCountSocketClients; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Timer timerUpdateTextLog; } } Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.cs 2008-06-09 13:19:32 UTC (rev 232) @@ -9,6 +9,7 @@ using System.Net.Sockets; using AcmContester.Mediator.Library.Plugins; using AcmContester.Mediator.Library.Plugins.SocketGate; +using System.IO; namespace Mediator { @@ -22,12 +23,38 @@ textBox2.Text = s; } + string fullLog = ""; + private void button2_Click(object sender, EventArgs e) { AcmContester.Mediator.Library.MediatorKernel kernel = new AcmContester.Mediator.Library.MediatorKernel(); + kernel.onWorkingData += WorkingData; kernel.LoadLists(); } + private void WorkingData(string message) + { + string s = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString() + ": "; + s += message; + + lock (fullLog) + { + fullLog += s; + fullLog += "\r\n"; + } + } + private void UpdateTextLog() + { + lock (fullLog) + { + //textBox3.SelectedText = fullLog; + textBox3.Text += fullLog; + textBox3.Select(textBox3.Text.Length, 0); + textBox3.ScrollToCaret(); + fullLog = ""; + } + } + private void button3_Click(object sender, EventArgs e) { Disconnnect(); @@ -62,5 +89,10 @@ { button2_Click(this, null); } + + private void timerUpdateTextLog_Tick(object sender, EventArgs e) + { + UpdateTextLog(); + } } } \ No newline at end of file Modified: ACMServer/trunk/MediatorSolution/Mediator/Form1.resx =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Form1.resx 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Form1.resx 2008-06-09 13:19:32 UTC (rev 232) @@ -120,7 +120,10 @@ <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"> + <metadata name="timerCountSocketClients.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>127, 17</value> </metadata> + <metadata name="timerUpdateTextLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>300, 17</value> + </metadata> </root> \ No newline at end of file Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/MediatorKernel.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/MediatorKernel.cs 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/MediatorKernel.cs 2008-06-09 13:19:32 UTC (rev 232) @@ -15,14 +15,24 @@ AcmContester.Mediator.Library.Plugins.WebGate.CreaterMediatorPlugin webCreater = new AcmContester.Mediator.Library.Plugins.WebGate.CreaterMediatorPlugin(); BaseMediatorPlugin b1 = webCreater.GetInstance(); b1.onDataArrived += DataArrivedFromClentList; + b1.onWorkingData += WorkingData; clientSideList.Add(b1); AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin socketCreater = new AcmContester.Mediator.Library.Plugins.SocketGate.CreaterMediatorPlugin(); BaseMediatorPlugin b2 = socketCreater.GetInstance(); b2.onDataArrived += DataArrivedFromTesterList; + b2.onWorkingData += WorkingData; testerSideList.Add(b2); } + public delegate void WorkingData_EventHandler(string message); + public event WorkingData_EventHandler onWorkingData; + private void WorkingData(string message) + { + if (onWorkingData != null) + onWorkingData(message); + } + private void DataArrivedFromClentList(string message) { for (int index = 0; index < testerSideList.Count; index++) Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/BaseMediatorPlugin.cs 2008-06-09 13:19:32 UTC (rev 232) @@ -7,12 +7,22 @@ public delegate void DataArrived_EventHandler(string message); public event DataArrived_EventHandler onDataArrived; + public delegate void WorkingData_EventHandler(string message); + public event WorkingData_EventHandler onWorkingData; + public abstract void Send(string message); protected virtual void DataArrived(string message) { + WorkingData("BaseMediatorPlugin::DataArrived(" + message + ")"); if (onDataArrived != null) onDataArrived(message); } + + protected virtual void WorkingData(string message) + { + if (onWorkingData != null) + onWorkingData(message); + } } } Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/SocketGate/SocketServerPlugin.cs 2008-06-09 13:19:32 UTC (rev 232) @@ -28,12 +28,15 @@ public override void Send(string message) { - if (dataContainer.Add(new Submit(message))) - server.Send(message); + WorkingData("SocketServerPlugin::Send(" + message + ")"); + if (server.CountClients() > 0) + if (dataContainer.Add(new Submit(message))) + server.Send(message); } protected override void DataArrived(string message) { + WorkingData("SocketServerPlugin::DataArrived(" + message + ")"); dataContainer.Return(new Result(message)); base.DataArrived(message); } @@ -47,6 +50,7 @@ internal void Stop() { + WorkingData("SocketServerPlugin::Stop()"); if (server != null) server.Stop(); server = null; Modified: ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs =================================================================== --- ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs 2008-06-09 13:08:31 UTC (rev 231) +++ ACMServer/trunk/MediatorSolution/Mediator/Library/Plugins/WebGate/WebGatePlugin.cs 2008-06-09 13:19:32 UTC (rev 232) @@ -25,6 +25,7 @@ public override void Send(string message) { + WorkingData("WebGatePlugin::Send(" + message + ")"); connector.Send(message); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |