From: <che...@us...> - 2008-11-08 16:59:50
|
Revision: 2315 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2315&view=rev Author: chef_koch Date: 2008-11-08 16:59:47 +0000 (Sat, 08 Nov 2008) Log Message: ----------- added: FritzBoxDebugger for testing purposes without starting MediaPortal Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox.sln Added Paths: ----------- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.Designer.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.resx trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-11-08 02:51:13 UTC (rev 2314) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2008-11-08 16:59:47 UTC (rev 2315) @@ -308,6 +308,26 @@ } } + void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) + { + switch (logLevel) + { + case FritzBoxClient.LogLevel.Debug: + Log.Debug(logMessage); + break; + case FritzBoxClient.LogLevel.Error: + Log.Error(logMessage); + break; + case FritzBoxClient.LogLevel.Warning: + Log.Warn(logMessage); + break; + case FritzBoxClient.LogLevel.Info: + Log.Info(logMessage); + break; + default: + break; + } + } void OnIncomingCall(CallAction callAction) { @@ -471,6 +491,7 @@ Utils.OnStartExternal += new Utils.UtilEventHandler(OnStartExternal); Utils.OnStopExternal += new Utils.UtilEventHandler(OnStopExternal); + FritzBoxClient.LogEvent += new FritzBoxClient.LogEventHandler(OnLogAction); FritzBoxClient.CallEvent += new FritzBoxClient.CallEventHandler(OnCallAction); FritzBoxClient.StartClient(); } @@ -484,6 +505,7 @@ FritzBoxClient.StopClient(); FritzBoxClient.CallEvent -= new FritzBoxClient.CallEventHandler(OnCallAction); + FritzBoxClient.LogEvent -= new FritzBoxClient.LogEventHandler(OnLogAction); Utils.OnStartExternal -= new Utils.UtilEventHandler(OnStartExternal); Utils.OnStopExternal -= new Utils.UtilEventHandler(OnStopExternal); Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs 2008-11-08 02:51:13 UTC (rev 2314) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs 2008-11-08 16:59:47 UTC (rev 2315) @@ -8,33 +8,44 @@ namespace FritzBox { - #region class StateObject - /// <summary> - /// State object for receiving data from remote device. - /// </summary> - public class StateObject + public static class FritzBoxClient { + #region class StateObject + /// <summary> - /// Client socket. + /// State object for receiving data from remote device. /// </summary> - public Socket workSocket = null; - /// <summary> - /// Size of receive buffer. - /// </summary> - public const int BufferSize = 256; - /// <summary> - /// Receive buffer. - /// </summary> - public byte[] buffer = new byte[BufferSize]; - /// <summary> - /// Received data string. - /// </summary> - public StringBuilder sb = new StringBuilder(); - } - #endregion + class StateObject + { + /// <summary> + /// Client socket. + /// </summary> + public Socket workSocket = null; + /// <summary> + /// Size of receive buffer. + /// </summary> + public const int BufferSize = 256; + /// <summary> + /// Receive buffer. + /// </summary> + public byte[] buffer = new byte[BufferSize]; + /// <summary> + /// Received data string. + /// </summary> + public StringBuilder sb = new StringBuilder(); + } - public static class FritzBoxClient - { + public enum LogLevel + { + Info, + Warning, + Error, + Debug, + HeavyDebug, + } + + #endregion + static TimeSpan minConnectWaitTime = new TimeSpan(0, 10, 0); static DateTime connectionFailed; @@ -60,13 +71,16 @@ public delegate void CallEventHandler(CallAction callAction); public static event CallEventHandler CallEvent; + public delegate void LogEventHandler(LogLevel logLevel, string logMessage); + public static event LogEventHandler LogEvent; + #endregion #region Public methods public static void StartClient() { - Log.Debug("StartClient"); + Log(LogLevel.Debug, "StartClient"); connectionFailed = DateTime.MinValue; Thread thread = new Thread(new ThreadStart(Connect)); @@ -75,7 +89,7 @@ public static void StopClient() { - Log.Debug("StopClient"); + Log(LogLevel.Debug, "StopClient"); try { // Release the socket. @@ -84,7 +98,7 @@ } catch (Exception e) { - Log.Error(e.ToString()); + Log(LogLevel.Error, e.ToString()); } } @@ -112,7 +126,7 @@ private static void ReConnect() { - Log.Debug("ReConnect"); + Log(LogLevel.Debug, "ReConnect"); connectionFailed = DateTime.Now; Thread thread = new Thread(new ThreadStart(Connect)); @@ -121,14 +135,14 @@ private static void Connect() { - Log.Debug("Connect"); + Log(LogLevel.Debug, "Connect"); // Enforce a minimum wait time between connects. DateTime nextconnect = connectionFailed.Add(minConnectWaitTime); if (DateTime.Now < nextconnect) { TimeSpan waittime = nextconnect - DateTime.Now; - Log.Debug("Avoiding too much reconnects, sleeping until {0}.", nextconnect.ToString()); + Log(LogLevel.Debug, "Avoiding too much reconnects, sleeping until {0}.", nextconnect.ToString()); Thread.Sleep(waittime); } @@ -150,19 +164,19 @@ } catch (SocketException) { - Log.Debug("Connect: SocketException"); - Log.Info("FRITZ!BOX connection lost, trying to reconnect."); + Log(LogLevel.Debug, "Connect: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); ReConnect(); } catch (Exception e) { - Log.Error(e.ToString()); + Log(e); } } private static void ConnectCallback(IAsyncResult ar) { - Log.Debug("ConnectCallback"); + Log(LogLevel.Debug, "ConnectCallback"); try { // Retrieve the socket from the state object. @@ -171,52 +185,68 @@ // Complete the connection. client.EndConnect(ar); - Log.Debug("Socket connected to {0}", + Log(LogLevel.Debug, "Socket connected to {0}", client.RemoteEndPoint.ToString()); Receive(client); } catch (SocketException) { - Log.Debug("ConnectCallback: SocketException"); - Log.Info("FRITZ!BOX connection lost, trying to reconnect."); + Log(LogLevel.Debug, "Connect: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); ReConnect(); } catch (Exception e) { - Log.Error(e.ToString()); + Log(e); } } private static void Receive(Socket client) { - Log.Debug("Receive"); + Log(LogLevel.Debug, "Receive"); try { // Create the state object. + Log(LogLevel.HeavyDebug, "StateObject state = new StateObject();"); StateObject state = new StateObject(); + Log(LogLevel.HeavyDebug, "state.workSocket = client;"); state.workSocket = client; + Log(LogLevel.HeavyDebug, "Available {0}", client.Available); + Log(LogLevel.HeavyDebug, "Connected {0}", client.Connected); + Log(LogLevel.HeavyDebug, "IsBound {0}", client.IsBound); + //Log(LogLevel.HeavyDebug, "{0}", client.Connected); + // Begin receiving the data from the remote device. + Log(LogLevel.HeavyDebug, "client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0,"); client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); } - catch (SocketException) + catch (SocketException e) { - Log.Debug("Receive: SocketException"); - Log.Info("FRITZ!BOX connection lost, trying to reconnect."); + Log(LogLevel.HeavyDebug, "{0}", e.NativeErrorCode); + Log(LogLevel.HeavyDebug, "{0}", e.SocketErrorCode); + Log(LogLevel.HeavyDebug, "{0}", e.Data); + Log(LogLevel.HeavyDebug, "{0}", e.ErrorCode); + Log(LogLevel.HeavyDebug, "{0}", e.InnerException); + Log(LogLevel.HeavyDebug, e.Message); + Log(LogLevel.HeavyDebug, e.Source); + Log(LogLevel.HeavyDebug, e.StackTrace); + Log(LogLevel.Debug, "Receive: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); ReConnect(); } - catch (Exception e) + catch (Exception ex) { - Log.Error(e.ToString()); + Log(ex); } } private static void ReceiveCallback(IAsyncResult ar) { - Log.Debug("ReceiveCallback"); + Log(LogLevel.Debug, "ReceiveCallback"); try { // Retrieve the state object and the client socket @@ -231,7 +261,8 @@ { // There might be more data, so store the data received so far. string data = Encoding.ASCII.GetString(state.buffer, 0, bytesRead); - //Log.Debug("ReceiveCallback : received data: {0}", data); + Log(LogLevel.HeavyDebug, "ReceiveCallback : received data: {0}", data); + //Log.Debug();"ReceiveCallback : received data: {0}", data // data-stream can be in following format: // incoming calls: DateTime;RING;ConnectionID;CallerID;MSN;??POTS??; @@ -281,32 +312,46 @@ client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, new AsyncCallback(ReceiveCallback), state); - CallEvent(callAction); + if (CallEvent != null) + CallEvent(callAction); } else { - Log.Debug("ReceiveCallback: no bytes to read"); - Log.Info("FRITZ!BOX connection lost, trying to reconnect."); + Log(LogLevel.Debug, "ReceiveCallback: no bytes to read"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); ReConnect(); } } catch (ObjectDisposedException) { - Log.Debug("ReceiveCallback: ObjectDisposedException"); - Log.Info("FRITZ!BOX connection shut down."); + Log(LogLevel.Debug, "ReceiveCallback: ObjectDisposedException"); + Log(LogLevel.Info, "FRITZ!BOX connection shut down."); } catch (SocketException) { - Log.Debug("ReceiveCallback: SocketException"); - Log.Info("FRITZ!BOX connection lost, trying to reconnect."); + Log(LogLevel.Debug, "ReceiveCallback: SocketException"); + Log(LogLevel.Info, "FRITZ!BOX connection lost, trying to reconnect."); ReConnect(); } catch (Exception e) { - Log.Error(e.ToString()); + Log(e); } } + + private static void Log(LogLevel logLevel, string format, params object[] arg) + { + if (LogEvent != null) + LogEvent(logLevel, String.Format(format, arg)); + } + + private static void Log(Exception e) + { + if (LogEvent != null) + LogEvent(LogLevel.Error, e.ToString()); + } + #endregion } } Modified: trunk/plugins/FritzBox/FritzBox.sln =================================================================== --- trunk/plugins/FritzBox/FritzBox.sln 2008-11-08 02:51:13 UTC (rev 2314) +++ trunk/plugins/FritzBox/FritzBox.sln 2008-11-08 16:59:47 UTC (rev 2315) @@ -5,6 +5,8 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FritzBoxConfigTester", "Tools\FritzBoxConfigTester\FritzBoxConfigTester.csproj", "{5D751473-DCC5-4044-A6E3-403D97C5B9F9}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FritzBoxDebugger", "Tools\FritzBoxDebugger\FritzBoxDebugger.csproj", "{FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,12 @@ {5D751473-DCC5-4044-A6E3-403D97C5B9F9}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D751473-DCC5-4044-A6E3-403D97C5B9F9}.Release|Any CPU.Build.0 = Release|Any CPU {5D751473-DCC5-4044-A6E3-403D97C5B9F9}.Release|x86.ActiveCfg = Release|Any CPU + {FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}.Debug|x86.ActiveCfg = Debug|Any CPU + {FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}.Release|Any CPU.Build.0 = Release|Any CPU + {FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.Designer.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.Designer.cs (rev 0) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.Designer.cs 2008-11-08 16:59:47 UTC (rev 2315) @@ -0,0 +1,176 @@ +namespace FritzBoxDebugger +{ + partial class DebugForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.startButton = new System.Windows.Forms.Button(); + this.logTextBox = new System.Windows.Forms.TextBox(); + this.addressTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.stopButton = new System.Windows.Forms.Button(); + this.testButton = new System.Windows.Forms.Button(); + this.testResultTextBox = new System.Windows.Forms.TextBox(); + this.portNumericUpDown = new System.Windows.Forms.NumericUpDown(); + ((System.ComponentModel.ISupportInitialize)(this.portNumericUpDown)).BeginInit(); + this.SuspendLayout(); + // + // startButton + // + this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.startButton.Location = new System.Drawing.Point(582, 98); + this.startButton.Name = "startButton"; + this.startButton.Size = new System.Drawing.Size(75, 23); + this.startButton.TabIndex = 0; + this.startButton.Text = "Start"; + this.startButton.UseVisualStyleBackColor = true; + this.startButton.Click += new System.EventHandler(this.button1_Click); + // + // logTextBox + // + this.logTextBox.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.logTextBox.Location = new System.Drawing.Point(12, 12); + this.logTextBox.Multiline = true; + this.logTextBox.Name = "logTextBox"; + this.logTextBox.Size = new System.Drawing.Size(527, 441); + this.logTextBox.TabIndex = 1; + // + // addressTextBox + // + this.addressTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.addressTextBox.Location = new System.Drawing.Point(635, 12); + this.addressTextBox.Name = "addressTextBox"; + this.addressTextBox.Size = new System.Drawing.Size(125, 20); + this.addressTextBox.TabIndex = 2; + this.addressTextBox.Text = "fritz.box"; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(579, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 4; + this.label1.Text = "label1"; + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(579, 41); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 4; + this.label2.Text = "label1"; + // + // stopButton + // + this.stopButton.Location = new System.Drawing.Point(685, 98); + this.stopButton.Name = "stopButton"; + this.stopButton.Size = new System.Drawing.Size(75, 23); + this.stopButton.TabIndex = 5; + this.stopButton.Text = "Stop"; + this.stopButton.UseVisualStyleBackColor = true; + this.stopButton.Click += new System.EventHandler(this.button2_Click); + // + // testButton + // + this.testButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.testButton.Location = new System.Drawing.Point(573, 280); + this.testButton.Name = "testButton"; + this.testButton.Size = new System.Drawing.Size(75, 23); + this.testButton.TabIndex = 6; + this.testButton.Text = "Test"; + this.testButton.UseVisualStyleBackColor = true; + this.testButton.Click += new System.EventHandler(this.testButton_Click); + // + // testResultTextBox + // + this.testResultTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.testResultTextBox.Location = new System.Drawing.Point(573, 309); + this.testResultTextBox.Multiline = true; + this.testResultTextBox.Name = "testResultTextBox"; + this.testResultTextBox.ReadOnly = true; + this.testResultTextBox.Size = new System.Drawing.Size(187, 67); + this.testResultTextBox.TabIndex = 7; + // + // portNumericUpDown + // + this.portNumericUpDown.Location = new System.Drawing.Point(635, 39); + this.portNumericUpDown.Maximum = new decimal(new int[] { + 100000, + 0, + 0, + 0}); + this.portNumericUpDown.Name = "portNumericUpDown"; + this.portNumericUpDown.Size = new System.Drawing.Size(125, 20); + this.portNumericUpDown.TabIndex = 8; + this.portNumericUpDown.Value = new decimal(new int[] { + 1012, + 0, + 0, + 0}); + // + // DebugForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(772, 465); + this.Controls.Add(this.portNumericUpDown); + this.Controls.Add(this.testResultTextBox); + this.Controls.Add(this.testButton); + this.Controls.Add(this.stopButton); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.addressTextBox); + this.Controls.Add(this.logTextBox); + this.Controls.Add(this.startButton); + this.Name = "DebugForm"; + this.Text = "DebugForm"; + ((System.ComponentModel.ISupportInitialize)(this.portNumericUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button startButton; + private System.Windows.Forms.TextBox logTextBox; + private System.Windows.Forms.TextBox addressTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button stopButton; + private System.Windows.Forms.Button testButton; + private System.Windows.Forms.TextBox testResultTextBox; + private System.Windows.Forms.NumericUpDown portNumericUpDown; + } +} \ No newline at end of file Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs (rev 0) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs 2008-11-08 16:59:47 UTC (rev 2315) @@ -0,0 +1,87 @@ +using System; +using System.Windows.Forms; + +using FritzBox; + + +namespace FritzBoxDebugger +{ + public partial class DebugForm : Form + { + private delegate void InvokeDelegate(); + + public DebugForm() + { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) + { + FritzBoxClient.Address = addressTextBox.Text; + FritzBoxClient.Port = (int)portNumericUpDown.Value; + + FritzBoxClient.LogEvent += new FritzBoxClient.LogEventHandler(OnLogAction); + FritzBoxClient.StartClient(); + } + + private void button2_Click(object sender, EventArgs e) + { + FritzBoxClient.StopClient(); + FritzBoxClient.LogEvent -= new FritzBoxClient.LogEventHandler(OnLogAction); + } + + private void testButton_Click(object sender, EventArgs e) + { + FritzBoxClient.Address = addressTextBox.Text; + FritzBoxClient.Port = (int)portNumericUpDown.Value; + + testResultTextBox.Text = FritzBoxClient.TestConnection(); + } + + private const string debugPrefix = "[DEBUG ] "; + private const string errorPrefix = "[ ERROR ] "; + private const string warningPrefix = "[ WARNING] "; + private const string infoPrefix = "[ --== INFO ==-- ] "; + private string tempLogMsg = string.Empty; + void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) + { + switch (logLevel) + { + case FritzBoxClient.LogLevel.Debug: + tempLogMsg = debugPrefix + logMessage + Environment.NewLine; + break; + case FritzBoxClient.LogLevel.Error: + tempLogMsg = errorPrefix + logMessage + Environment.NewLine; + break; + case FritzBoxClient.LogLevel.Warning: + tempLogMsg = warningPrefix + logMessage + Environment.NewLine; + break; + case FritzBoxClient.LogLevel.Info: + tempLogMsg = infoPrefix + logMessage + Environment.NewLine; + break; + case FritzBoxClient.LogLevel.HeavyDebug: + tempLogMsg = logMessage + Environment.NewLine; + break; + default: + tempLogMsg = string.Empty; + break; + } + + AppendText(); + } + void AppendText() + { + if (InvokeRequired) + { + this.Invoke(new InvokeDelegate(AppendText)); + return; + } + + if (tempLogMsg != string.Empty) + { + logTextBox.AppendText(tempLogMsg); + tempLogMsg = string.Empty; + } + } + } +} Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.resx =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.resx (rev 0) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.resx 2008-11-08 16:59:47 UTC (rev 2315) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj (rev 0) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj 2008-11-08 16:59:47 UTC (rev 2315) @@ -0,0 +1,76 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{FB2B1D6F-4580-4B3B-95A8-C9800F679D9F}</ProjectGuid> + <OutputType>WinExe</OutputType> + <NoStandardLibraries>false</NoStandardLibraries> + <AssemblyName>FritzBoxDebugger</AssemblyName> + <RootNamespace>FritzBoxDebugger</RootNamespace> + <FileUpgradeFlags> + </FileUpgradeFlags> + <OldToolsVersion>2.0</OldToolsVersion> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + <SccProjectName> + </SccProjectName> + <SccLocalPath> + </SccLocalPath> + <SccAuxPath> + </SccAuxPath> + <SccProvider> + </SccProvider> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>.\bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>.\bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.9.2.154, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\External\Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="DebugForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="DebugForm.Designer.cs"> + <DependentUpon>DebugForm.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\FritzBox\FritzBox.csproj"> + <Project>{7A458560-A537-429E-A016-1A4513CB586F}</Project> + <Name>FritzBox</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="DebugForm.resx"> + <DependentUpon>DebugForm.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> + <ProjectExtensions> + <VisualStudio AllowExistingFolder="true" /> + </ProjectExtensions> + <PropertyGroup> + <PostBuildEvent>copy "$(ProjectDir)..\..\External\sqlite.dll" "$(TargetDir)" /y</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs (rev 0) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs 2008-11-08 16:59:47 UTC (rev 2315) @@ -0,0 +1,19 @@ +using System; + +using System.Windows.Forms; + +namespace FritzBoxDebugger +{ + class Program + { + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new DebugForm()); + } + } +} + + Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs 2008-11-08 16:59:47 UTC (rev 2315) @@ -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("MoviesPluginTester")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MoviesPluginTester")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a8955056-78bf-4390-9c3a-b3ac6b5072e6")] + +// 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")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |