From: <che...@us...> - 2009-06-03 10:27:05
|
Revision: 2892 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2892&view=rev Author: chef_koch Date: 2009-06-03 10:27:01 +0000 (Wed, 03 Jun 2009) Log Message: ----------- resharped complete solution Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/CallAction.cs trunk/plugins/FritzBox/FritzBox/Caller.cs trunk/plugins/FritzBox/FritzBox/ConfigConnector.cs trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Program.cs trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs Modified: trunk/plugins/FritzBox/FritzBox/CallAction.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/CallAction.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/CallAction.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; - using MediaPortal.ServiceImplementations; namespace FritzBox @@ -24,11 +21,11 @@ public void WriteToLog() { Log.Info("CallAction Info:"); - Log.Info(" CallType: {0}", this.type.ToString()); - Log.Info(" Date: {0}", this.time.ToShortDateString()); - Log.Info(" Time: {0}", this.time.ToShortTimeString()); - Log.Info(" Caller: {0}", this.caller.ID); - Log.Info(" MSN: {0}", this.msn); + Log.Info(" CallType: {0}", type.ToString()); + Log.Info(" Date: {0}", time.ToShortDateString()); + Log.Info(" Time: {0}", time.ToShortTimeString()); + Log.Info(" Caller: {0}", caller.ID); + Log.Info(" MSN: {0}", msn); } } -} +} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/Caller.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Caller.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/Caller.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -23,67 +23,44 @@ #endregion -using System; -using System.Collections.Generic; -using System.Text; - namespace FritzBox { public class Caller { - string _id; - string _name; - bool _show; + private string _id; + private string _name; + private bool _show; public Caller() { - this._id = ""; - this._name = ""; - this._show = true; + _id = ""; + _name = ""; + _show = true; } public Caller(string id, string name, bool show) { - this._id = id; - this._name = name; - this._show = show; + _id = id; + _name = name; + _show = show; } public string ID { - get - { - return _id; - } - set - { - _id = value; - } + get { return _id; } + set { _id = value; } } public string Name { - get - { - return _name; - } - set - { - _name = value; - } + get { return _name; } + set { _name = value; } } public bool Show { - get - { - return _show; - } - set - { - _show = value; - } + get { return _show; } + set { _show = value; } } - } -} +} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/ConfigConnector.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/ConfigConnector.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/ConfigConnector.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,5 +1,4 @@ using System; - using MediaPortal.GUI.Library; namespace FritzBox @@ -62,7 +61,8 @@ return true; } - public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, + out string strPictureImage) { strButtonText = null; strButtonImage = null; @@ -70,6 +70,7 @@ strPictureImage = null; return false; } + #endregion } -} +} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -27,17 +27,11 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Net.Sockets; -using System.Threading; -using System.Windows.Forms; -using System.Xml; - using MediaPortal.Configuration; using MediaPortal.Dialogs; using MediaPortal.GUI.Library; using MediaPortal.Player; using MediaPortal.Util; -using System.Text; namespace FritzBox { @@ -52,8 +46,10 @@ { get { return extensiveLogging; } set { extensiveLogging = value; } - } private static bool extensiveLogging = false; + } + private static bool extensiveLogging = false; + /// <summary> /// stop media when an event happend /// </summary> @@ -61,7 +57,10 @@ { get { return stopMedia; } set { stopMedia = value; } - } private static bool stopMedia = true; + } + + private static bool stopMedia = true; + /// <summary> /// resume media when notify is closed /// </summary> @@ -69,14 +68,19 @@ { get { return resumeMedia; } set { resumeMedia = value; } - } private static bool resumeMedia = true; + } + private static bool resumeMedia = true; + public static int MaxNotifies { get { return maxNotifies; } set { maxNotifies = value; } - } private static int maxNotifies = 20; + } + + private static int maxNotifies = 20; + /// <summary> /// autoclose the dialog after the timeout expired /// </summary> @@ -84,30 +88,43 @@ { get { return notifyTimeout; } set { notifyTimeout = value; } - } private static int notifyTimeout = 10; + } + + private static int notifyTimeout = 10; + public static bool CloseOnTimeout { get { return closeOnTimeout; } set { closeOnTimeout = value; } - } private static bool closeOnTimeout = false; + } + + private static bool closeOnTimeout = false; + public static bool CloseOnConnectionClosed { get { return closeOnConnectionClosed; } set { closeOnConnectionClosed = value; } - } private static bool closeOnConnectionClosed = false; + } + + private static bool closeOnConnectionClosed = false; + public static bool ShowMsnOnHeading { get { return showMsnOnHeading; } set { showMsnOnHeading = value; } - } private static bool showMsnOnHeading = false; + } + private static bool showMsnOnHeading = false; public static bool FilterMSNs { get { return filterMSNs; } set { filterMSNs = value; } - } private static bool filterMSNs = false; + } + + private static bool filterMSNs = false; + public static List<String> MsnList { get @@ -118,8 +135,10 @@ return msnList; } set { msnList = value; } - } private static List<String> msnList; + } + private static List<String> msnList; + #endregion public static void Load() @@ -128,7 +147,9 @@ PhoneBook.LoadSettings(); - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + using ( + MediaPortal.Profile.Settings xmlreader = + new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { ExtensiveLogging = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); @@ -146,7 +167,7 @@ FilterMSNs = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); string strMSN = xmlreader.GetValueAsString("fritzbox", "MSN", ""); - char[] charSeparators = new char[] { ';' }; + char[] charSeparators = new char[] {';'}; MsnList.AddRange(strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries)); ShowMsnOnHeading = xmlreader.GetValueAsBool("fritzbox", "showMsnOnHeading", false); @@ -163,7 +184,9 @@ { Log.Info("FRITZ!Box: Settings.Save()"); - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + using ( + MediaPortal.Profile.Settings xmlwriter = + new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValueAsBool("fritzbox", "extensiveLogging", ExtensiveLogging); @@ -196,7 +219,7 @@ public static void WriteToLog() { - if (Settings.ExtensiveLogging) + if (ExtensiveLogging) { Log.Info("FRITZ!Box: closeOnTimeout = {0}", CloseOnTimeout.ToString()); Log.Info("FRITZ!Box: timeout = {0}", NotifyTimeout.ToString()); @@ -222,13 +245,13 @@ public const string _version = "0.3.2.5"; - List<CallAction> actionList = new List<CallAction>(); - object tempNotify = null; + private readonly List<CallAction> actionList = new List<CallAction>(); + private object tempNotify = null; - int notifyCount = 0; + private int notifyCount = 0; - bool _showNotify = true; - List<CallAction> notifyQueue = new List<CallAction>(); + private bool _showNotify = true; + private readonly List<CallAction> notifyQueue = new List<CallAction>(); #endregion @@ -246,7 +269,7 @@ #region Private Functions/Methods - void OnStartExternal(Process proc, bool waitForExit) + private void OnStartExternal(Process proc, bool waitForExit) { if (waitForExit) { @@ -257,7 +280,8 @@ _showNotify = true; } } - void OnStopExternal(Process proc, bool waitForExit) + + private void OnStopExternal(Process proc, bool waitForExit) { _showNotify = true; @@ -267,7 +291,7 @@ notifyQueue.Clear(); } - void OnCallAction(CallAction callAction) + private void OnCallAction(CallAction callAction) { Log.Info("FRITZ!Box: OnCallAction()"); callAction.WriteToLog(); @@ -298,7 +322,7 @@ { Action act = new Action(); act.wID = Action.ActionType.ACTION_CLOSE_DIALOG; - GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY).OnAction(act); + GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_NOTIFY).OnAction(act); } } break; @@ -306,9 +330,9 @@ Log.Error("incorrect callaction.type"); break; } + } - } - void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) + private void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) { switch (logLevel) { @@ -329,7 +353,7 @@ } } - void OnIncomingCall(CallAction callAction) + private void OnIncomingCall(CallAction callAction) { Log.Info("FRITZ!Box: OnIncomingCall()"); @@ -348,16 +372,16 @@ // Set Heading for NotifyDialog if (Settings.ShowMsnOnHeading) - strHeading = GUILocalizeStrings.Get(1023) + " on " + callAction.msn; // ???? Incoming call on + strHeading = GUILocalizeStrings.Get(1023) + " on " + callAction.msn; // ???? Incoming call on else - strHeading = GUILocalizeStrings.Get(1023); // 1023 Incoming call + strHeading = GUILocalizeStrings.Get(1023); // 1023 Incoming call // Set Image for NotifyDialog strImage = GetCallerImage(callAction.caller); // Set MessageText for NotifyDialog if (callAction.caller.ID == "") - strText = GUILocalizeStrings.Get(2014); // 2014 = unknown + strText = GUILocalizeStrings.Get(2014); // 2014 = unknown else if (callAction.caller.Name == "") strText = callAction.caller.ID; else @@ -378,13 +402,13 @@ #region Helper Methods - string GetCallerImage(Caller caller) + private string GetCallerImage(Caller caller) { if (caller.ID == "") - return MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, "_unknown"); + return Utils.GetCoverArt(Thumbs.Yac, "_unknown"); else { - string strImage = MediaPortal.Util.Utils.GetCoverArtName(Thumbs.Yac, caller.Name); + string strImage = Utils.GetCoverArtName(Thumbs.Yac, caller.Name); // search image for caller if (Settings.ExtensiveLogging) @@ -402,12 +426,12 @@ else { Log.Info("found NO image for caller"); - return MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, "_noImage"); + return Utils.GetCoverArt(Thumbs.Yac, "_noImage"); } } } - bool IsMsnEnabled(string msn) + private bool IsMsnEnabled(string msn) { if (!Settings.FilterMSNs) { @@ -427,7 +451,7 @@ } } - bool IsCallerEnabled(Caller caller) + private bool IsCallerEnabled(Caller caller) { if (!PhoneBook.Enabled) { @@ -438,7 +462,7 @@ else return false; } - void ShowNotify(string strHeading, string strImage, string strText) + private void ShowNotify(string strHeading, string strImage, string strText) { if (notifyCount >= Settings.MaxNotifies) return; @@ -446,7 +470,8 @@ if (g_Player.Playing && !g_Player.Paused && Settings.StopMedia) g_Player.Pause(); - GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + GUIDialogNotify dlgNotify = + (GUIDialogNotify) GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_NOTIFY); if (dlgNotify == null) return; dlgNotify.Reset(); Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2009-06-03 10:27:01 UTC (rev 2892) @@ -35,11 +35,23 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="Core, Version=1.0.2.19958, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=1.0.2.19960, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Dialogs\bin\Release\Dialogs.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.7.19957, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Utils\bin\Release\Utils.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="ConfigConnector.cs" /> @@ -84,24 +96,6 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\..\mediaportal\Core\Core.csproj"> - <Project>{02FFFC1F-2555-4B99-8B01-3432D0673855}</Project> - <Name>Core</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\mediaportal\Dialogs\Dialogs.csproj"> - <Project>{396C5208-5D46-4A11-92C1-FD0F2F42D7DD}</Project> - <Name>Dialogs</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\mediaportal\Utils\Utils.csproj"> - <Project>{6DA0E4DF-6230-4642-98B5-E690BB6942BB}</Project> - <Name>Utils</Name> - </ProjectReference> - <ProjectReference Include="..\..\..\mediaportal\WindowPlugins\WindowPlugins.csproj"> - <Project>{B282C55B-A37B-4CEC-A4FC-00791069BF00}</Project> - <Name>WindowPlugins</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: trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxClient.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,11 +1,10 @@ using System; +using System.Globalization; using System.Net; using System.Net.Sockets; +using System.Text; using System.Threading; -using System.Text; -using MediaPortal.GUI.Library; - namespace FritzBox { public static class FritzBoxClient @@ -15,20 +14,23 @@ /// <summary> /// State object for receiving data from remote device. /// </summary> - class StateObject + private 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]; + public readonly byte[] buffer = new byte[BufferSize]; + /// <summary> /// Received data string. /// </summary> @@ -46,32 +48,39 @@ #endregion - static TimeSpan minConnectWaitTime = new TimeSpan(0, 10, 0); - static DateTime connectionFailed; - - static Socket _client; + private static readonly TimeSpan minConnectWaitTime = new TimeSpan(0, 10, 0); + private static DateTime connectionFailed; + private static Socket _client; + #region Properties public static string Address { get { return address; } set { address = value; } - } private static string address = "fritz.box"; + } + + private static string address = "fritz.box"; + public static int Port { get { return port; } set { port = value; } - } private static int port = 1012; + } + private static int port = 1012; + #endregion #region Public Events and Delegates 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 @@ -82,7 +91,7 @@ { Log(LogLevel.Debug, "StartClient"); connectionFailed = DateTime.MinValue; - + Thread thread = new Thread(new ThreadStart(Connect)); thread.Start(); } @@ -128,7 +137,7 @@ { Log(LogLevel.Debug, "ReConnect"); connectionFailed = DateTime.Now; - + Thread thread = new Thread(new ThreadStart(Connect)); thread.Start(); } @@ -157,7 +166,7 @@ // Create a TCP/IP socket. _client = new Socket(AddressFamily.InterNetwork, - SocketType.Stream, ProtocolType.Tcp); + SocketType.Stream, ProtocolType.Tcp); // Connect to the remote endpoint. _client.BeginConnect(Address, Port, new AsyncCallback(ConnectCallback), _client); @@ -180,7 +189,7 @@ try { // Retrieve the socket from the state object. - Socket client = (Socket)ar.AsyncState; + Socket client = (Socket) ar.AsyncState; // Complete the connection. client.EndConnect(ar); @@ -222,7 +231,7 @@ // 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); + new AsyncCallback(ReceiveCallback), state); } catch (SocketException e) { @@ -251,7 +260,7 @@ { // Retrieve the state object and the client socket // from the asynchronous state object. - StateObject state = (StateObject)ar.AsyncState; + StateObject state = (StateObject) ar.AsyncState; Socket client = state.workSocket; // Read data from the remote device. @@ -278,7 +287,7 @@ CallAction callAction = new CallAction(); // time when action happens - callAction.time = DateTime.Parse(strList[0], new System.Globalization.CultureInfo("de-DE", false)); + callAction.time = DateTime.Parse(strList[0], new CultureInfo("de-DE", false)); // set the type of the callAction switch (strList[1]) @@ -310,7 +319,7 @@ // continue to listen to the fb client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, - new AsyncCallback(ReceiveCallback), state); + new AsyncCallback(ReceiveCallback), state); if (CallEvent != null) CallEvent(callAction); @@ -354,4 +363,4 @@ #endregion } -} +} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,18 +1,6 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -using System.Collections; -using System.Net.Sockets; using System.IO; - -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -using MediaPortal.Profile; +using System.Windows.Forms; using MediaPortal.Util; namespace FritzBox @@ -79,12 +67,12 @@ FritzBox.Settings.ExtensiveLogging = checkBoxExtensiveLogging.Checked; FritzBoxClient.Address = textBoxAddress.Text; - FritzBoxClient.Port = (int)numericUpDownPort.Value; + FritzBoxClient.Port = (int) numericUpDownPort.Value; // notify settings - FritzBox.Settings.MaxNotifies = (int)numericUpDownMaxNotifies.Value; + FritzBox.Settings.MaxNotifies = (int) numericUpDownMaxNotifies.Value; FritzBox.Settings.CloseOnTimeout = checkBoxCloseOnTimout.Checked; - FritzBox.Settings.NotifyTimeout = (int)numericUpDownTimeout.Value; + FritzBox.Settings.NotifyTimeout = (int) numericUpDownTimeout.Value; FritzBox.Settings.CloseOnConnectionClosed = checkBoxCloseOnConnectionClosed.Checked; FritzBox.Settings.FilterMSNs = checkBoxFilterMSNs.Checked; @@ -117,18 +105,18 @@ private void buttonSave_Click(object sender, EventArgs e) { SaveSettings(); - this.Close(); + Close(); } private void buttonCancel_Click(object sender, EventArgs e) { - this.Close(); + Close(); } private void buttonTest_Click(object sender, EventArgs e) { FritzBoxClient.Address = textBoxAddress.Text; - FritzBoxClient.Port = (int)numericUpDownPort.Value; + FritzBoxClient.Port = (int) numericUpDownPort.Value; labelHelp.Text = "Please wait..."; labelHelp.Text = FritzBoxClient.TestConnection(); @@ -214,10 +202,11 @@ } else { - string oldfile = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, - dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString()); + string oldfile = Utils.GetCoverArt(Thumbs.Yac, + dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString()); - string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), Utils.GetThumbExtension()); + string newfile = String.Format(@"{0}\{1}{2}", Thumbs.Yac, Utils.MakeFileName(textBoxCallerName.Text), + Utils.GetThumbExtension()); if (File.Exists(oldfile)) File.Move(oldfile, newfile); @@ -226,7 +215,7 @@ dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value = textBoxCallerName.Text; dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value = checkBoxCallerShow.Checked; - pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); + pictureBoxCaller.ImageLocation = Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); SaveDataGridView(); } @@ -289,9 +278,10 @@ { textBoxCallerId.Text = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[0].Value.ToString(); textBoxCallerName.Text = dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[1].Value.ToString(); - checkBoxCallerShow.Checked = bool.Parse(dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value.ToString()); + checkBoxCallerShow.Checked = + bool.Parse(dataGridView.Rows[dataGridView.CurrentCell.RowIndex].Cells[2].Value.ToString()); - pictureBoxCaller.ImageLocation = MediaPortal.Util.Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); + pictureBoxCaller.ImageLocation = Utils.GetCoverArt(Thumbs.Yac, textBoxCallerName.Text); } } @@ -344,7 +334,9 @@ private void buttonClearAll_Click(object sender, EventArgs e) { - if (MessageBox.Show("Attention! Do you really want to clear the phone book? This will delete all your entries!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) + if ( + MessageBox.Show("Attention! Do you really want to clear the phone book? This will delete all your entries!", "", + MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { PhoneBook.Contacts.Clear(); dataGridView.Rows.Clear(); Modified: trunk/plugins/FritzBox/FritzBox/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/PhoneBook.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/PhoneBook.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -25,72 +25,89 @@ using System; using System.Collections.Generic; +using System.IO; using System.Text; - using MediaPortal.Configuration; using MediaPortal.GUI.Library; -using System.IO; +using MediaPortal.Profile; namespace FritzBox { public static class PhoneBook { private static bool _extensiveLogging; - + #region public properties public static bool Enabled { get { return enabled; } set { enabled = value; } - } private static bool enabled = false; + } + private static bool enabled = false; + public static bool ShowUnknownCaller { get { return showUnknownCaller; } set { showUnknownCaller = value; } - } private static bool showUnknownCaller; + } + + private static bool showUnknownCaller; + public static bool SaveUnknownCaller { get { return saveUnknownCaller; } set { saveUnknownCaller = value; } - } private static bool saveUnknownCaller; + } + private static bool saveUnknownCaller; + public static string SuffixHome { get { return suffixHome; } set { suffixHome = value; } - } private static string suffixHome; + } + + private static string suffixHome; + public static string SuffixWork { get { return suffixWork; } set { suffixWork = value; } - } private static string suffixWork; + } + + private static string suffixWork; + public static string SuffixMobile { get { return suffixMobile; } set { suffixMobile = value; } - } private static string suffixMobile; + } + private static string suffixMobile; + public static List<Caller> Contacts { get { if (contacts == null) contacts = new List<Caller>(); - + return contacts; } set { contacts = value; } - } private static List<Caller> contacts; + } + private static List<Caller> contacts; + #endregion #region public methods public static void LoadSettings() { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { _extensiveLogging = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); @@ -106,9 +123,8 @@ Contacts = new List<Caller>(); - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) { - int countCaller = xmlreader.GetValueAsInt("phonebook", "count", 0); for (int i = 0; i < countCaller; i++) @@ -131,7 +147,7 @@ public static void SaveSettings() { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", Enabled); @@ -142,8 +158,8 @@ xmlwriter.SetValue("fritzbox", "suffixWork", SuffixWork); xmlwriter.SetValue("fritzbox", "suffixMobile", SuffixMobile); } - - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) + + using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "fritzbox.xml"))) { xmlwriter.SetValue("phonebook", "count", Contacts.Count); @@ -170,8 +186,9 @@ using (StreamReader sr = new StreamReader(filepath, Encoding.Default)) { string line; - line = sr.ReadLine(); // sep=; - line = sr.ReadLine(); // Name;TelNumHome;VanityHome;KurzWahlHome;TelNumWork;VanityWork;KurzWahlWork;TelNumMobile;VanityMobile;KurzWahlMobile;Kommentar;Firma;Bild;Kategorie;ImageUrl;Prio;Email;RingTone;RingVol + line = sr.ReadLine(); // sep=; + line = sr.ReadLine(); + // Name;TelNumHome;VanityHome;KurzWahlHome;TelNumWork;VanityWork;KurzWahlWork;TelNumMobile;VanityMobile;KurzWahlMobile;Kommentar;Firma;Bild;Kategorie;ImageUrl;Prio;Email;RingTone;RingVol // Read and display lines from the file until the end of // the file is reached. @@ -216,7 +233,7 @@ Contacts.Add(caller); count++; - } + } } } @@ -279,4 +296,4 @@ #endregion } -} +} \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,25 +1,27 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Reflection; 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("FRITZ!Box CallMonitor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("chefkoch @ Team MediaPortal")] [assembly: AssemblyProduct("FRITZ!Box CallMonitor")] -[assembly: AssemblyCopyright("Copyright © chefkoch @ Team MediaPortal 2008")] +[assembly: AssemblyCopyright("Copyright \xA9 chefkoch @ Team MediaPortal 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("2fed1c7a-a6ad-4bec-b6a5-f6390c705e93")] // Version information for an assembly consists of the following four values: @@ -31,5 +33,6 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: + [assembly: AssemblyVersion(FritzBox.FritzBox._version)] -[assembly: AssemblyFileVersion(FritzBox.FritzBox._version)] +[assembly: AssemblyFileVersion(FritzBox.FritzBox._version)] \ No newline at end of file Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj 2009-06-03 10:27:01 UTC (rev 2892) @@ -35,9 +35,9 @@ <DefineConstants>TRACE</DefineConstants> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.9.2.154, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=1.0.2.19958, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\External\Core.dll</HintPath> + <HintPath>..\..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Core.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Program.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Program.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Program.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,21 +1,18 @@ using System; - +using System.Windows.Forms; using FritzBox; - namespace FritzBoxConfigTester { - class Program + internal class Program { - [STAThreadAttribute] - static void Main(string[] args) + [STAThread] + private static void Main(string[] args) { - System.Windows.Forms.Application.EnableVisualStyles(); + Application.EnableVisualStyles(); ConfigConnector plugin = new ConfigConnector(); plugin.ShowPlugin(); } } -} - - +} \ No newline at end of file Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/AssemblyInfo.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/AssemblyInfo.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,25 +1,27 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Reflection; 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: AssemblyCopyright("Copyright \xA9 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: @@ -29,5 +31,6 @@ // Build Number // Revision // + [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,9 +1,7 @@ -using System; +using System; using System.Windows.Forms; - using FritzBox; - namespace FritzBoxDebugger { public partial class DebugForm : Form @@ -18,7 +16,7 @@ private void button1_Click(object sender, EventArgs e) { FritzBoxClient.Address = addressTextBox.Text; - FritzBoxClient.Port = (int)portNumericUpDown.Value; + FritzBoxClient.Port = (int) portNumericUpDown.Value; FritzBoxClient.LogEvent += new FritzBoxClient.LogEventHandler(OnLogAction); FritzBoxClient.StartClient(); @@ -33,17 +31,18 @@ private void testButton_Click(object sender, EventArgs e) { FritzBoxClient.Address = addressTextBox.Text; - FritzBoxClient.Port = (int)portNumericUpDown.Value; + FritzBoxClient.Port = (int) portNumericUpDown.Value; testResultTextBox.Text = FritzBoxClient.TestConnection(); } - private const string debugPrefix = "[DEBUG ] "; - private const string errorPrefix = "[ ERROR ] "; + private const string debugPrefix = "[DEBUG ] "; + private const string errorPrefix = "[ ERROR ] "; private const string warningPrefix = "[ WARNING] "; - private const string infoPrefix = "[ --== INFO ==-- ] "; + private const string infoPrefix = "[ --== INFO ==-- ] "; private string tempLogMsg = string.Empty; - void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) + + private void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) { switch (logLevel) { @@ -69,11 +68,12 @@ AppendText(); } - void AppendText() + + private void AppendText() { if (InvokeRequired) { - this.Invoke(new InvokeDelegate(AppendText)); + Invoke(new InvokeDelegate(AppendText)); return; } @@ -84,4 +84,4 @@ } } } -} +} \ No newline at end of file Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,19 +1,16 @@ using System; - using System.Windows.Forms; namespace FritzBoxDebugger { - class Program + internal class Program { [STAThread] - static void Main() + private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new DebugForm()); } } -} - - +} \ No newline at end of file Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs 2009-06-03 10:03:58 UTC (rev 2891) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs 2009-06-03 10:27:01 UTC (rev 2892) @@ -1,25 +1,27 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +using System.Reflection; 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: AssemblyCopyright("Copyright \xA9 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: @@ -29,5 +31,6 @@ // Build Number // Revision // + [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |