From: <che...@us...> - 2009-08-09 20:38:59
|
Revision: 3049 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3049&view=rev Author: chemelli_sf Date: 2009-08-09 20:38:42 +0000 (Sun, 09 Aug 2009) Log Message: ----------- Re-added needed component Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.dll trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.xml trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Windows.Forms.dll trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Windows.Forms.xml trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/SourceGrid.License.txt trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/SourceGrid.dll trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/SourceGrid.xml Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj 2009-08-09 20:13:30 UTC (rev 3048) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj 2009-08-09 20:38:42 UTC (rev 3049) @@ -54,6 +54,10 @@ <OutputPath>bin\Release\</OutputPath> </PropertyGroup> <ItemGroup> + <Reference Include="DevAge.Core, Version=4.10.2845.21697, Culture=neutral, PublicKeyToken=faad465d84242dbf, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\SourceGrid\DevAge.Core.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Configuration.Install" /> <Reference Include="System.Data" /> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj 2009-08-09 20:13:30 UTC (rev 3048) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/IR Server Configuration.csproj 2009-08-09 20:38:42 UTC (rev 3049) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<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> @@ -75,7 +75,7 @@ <ItemGroup> <Reference Include="DevAge.Core, Version=4.10.2845.21697, Culture=neutral, PublicKeyToken=faad465d84242dbf, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\Applications\IR Server\SourceGrid\DevAge.Core.dll</HintPath> + <HintPath>..\SourceGrid\DevAge.Core.dll</HintPath> </Reference> <Reference Include="SourceGrid, Version=4.7.2662.1973, Culture=neutral, processorArchitecture=MSIL"> <HintPath>SourceGrid\SourceGrid.dll</HintPath> @@ -196,4 +196,4 @@ <PostBuildEvent> </PostBuildEvent> </PropertyGroup> -</Project> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.xml =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.xml (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/SourceGrid/DevAge.Core.xml 2009-08-09 20:38:42 UTC (rev 3049) @@ -0,0 +1,1911 @@ +<?xml version="1.0"?> +<doc> + <assembly> + <name>DevAge.Core</name> + </assembly> + <members> + <member name="T:DevAge.Text.FixedLength.LineParser"> + <summary> + A class for parsing fixed length string and loading the fields into a class. + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.LineParser.#ctor"> + <summary> + Constructor. Fill the Fields list fot specify the columns. + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.LineParser.#ctor(System.Type)"> + <summary> + Load the parser fields with the properties specified in the type. You must use the FieldAttribute and ParseFormatAttribute to specify additional informations like the field length. + </summary> + <param name="lineClassType"></param> + </member> + <member name="M:DevAge.Text.FixedLength.LineParser.Reset"> + <summary> + Reset the parser + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.LineParser.LoadLine(System.String)"> + <summary> + Load the specified line in the parser. + </summary> + <param name="line"></param> + </member> + <member name="M:DevAge.Text.FixedLength.LineParser.GetValue(System.String)"> + <summary> + Get a specified field value. + </summary> + <param name="fieldName"></param> + <returns></returns> + </member> + <member name="M:DevAge.Text.FixedLength.LineParser.FillLineClass(System.Object)"> + <summary> + Fill the properties of the specified class with the values of the line has defined by the Fields collection. + </summary> + <param name="schemaClass"></param> + <returns>Returns the same class specified in the schemaClass parameter, this is useful if you have struct or value types.</returns> + </member> + <member name="P:DevAge.Text.FixedLength.LineParser.Fields"> + <summary> + Gets a collection of fields. + </summary> + </member> + <member name="T:DevAge.Data.SqlClient.SqlCommandBuilder"> + <summary> + This class is similar to the System.Data.SqlClient.SqlCommandBuilder, but use only the DataTable to create the required commands. + Don't support identity (autoincrement) column and only the base data type. This class don't use the data source to explore the data but only the DataTable informations. + So you must populate the PrimaryKeys of the DataSet. I suggest to use GUID column (uniqueidentifier) to replace the identity column. + Remember to set the Connection of the generated command. + </summary> + </member> + <member name="M:DevAge.Data.SqlClient.SqlCommandBuilder.#ctor(System.Data.DataTable)"> + <summary> + Constructor + </summary> + <param name="dataTable">table used to create commands</param> + </member> + <member name="P:DevAge.Data.SqlClient.SqlCommandBuilder.DataTable"> + <summary> + Table used to create commands + </summary> + </member> + <member name="T:DevAge.DateTimeHelper"> + <summary> + Summary description for DateTimeHelper. + </summary> + </member> + <member name="M:DevAge.DateTimeHelper.YearsDifference(System.DateTime,System.DateTime)"> + <summary> + Calculate the difference in years of 2 dates. Usually used for age calculations. dateA - dateB + </summary> + <param name="dateA"></param> + <param name="dateB"></param> + <returns></returns> + </member> + <member name="M:DevAge.DateTimeHelper.MonthsDifference(System.DateTime,System.DateTime)"> + <summary> + Calculate the difference in months of 2 dates. dateA - dateB + </summary> + <param name="dateA"></param> + <param name="dateB"></param> + <returns></returns> + </member> + <member name="T:DevAge.Data.FileDataSet"> + <summary> + Summary description for Manager. + </summary> + </member> + <member name="P:DevAge.Data.FileDataSet.SaveDataFormat"> + <summary> + Gets or Sets the format used to save the DataSet + </summary> + </member> + <member name="P:DevAge.Data.FileDataSet.FileDataFormat"> + <summary> + Gets the current format of the File where the data are loaded. + </summary> + </member> + <member name="P:DevAge.Data.FileDataSet.MergeReadedSchema"> + <summary> + Gets or Sets if merge the schema of the file with the schema of the DataSet specified. Use true if the DataSet doesn't have a schema definition. Default is false. + </summary> + </member> + <member name="T:DevAge.DevAgeApplicationException"> + <summary> + Generic DevAge Exception + </summary> + </member> + <member name="M:DevAge.DevAgeApplicationException.#ctor(System.String)"> + <summary> + Constructor + </summary> + <param name="p_strErrDescription"></param> + </member> + <member name="M:DevAge.DevAgeApplicationException.#ctor(System.String,System.Exception)"> + <summary> + Constructor + </summary> + <param name="p_strErrDescription"></param> + <param name="p_InnerException"></param> + </member> + <member name="M:DevAge.DevAgeApplicationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)"> + <summary> + Constructor + </summary> + <param name="p_Info"></param> + <param name="p_StreamingContext"></param> + </member> + <member name="T:DevAge.Text.FixedLength.FieldAttribute"> + <summary> + Required attribute to specify the field position and length + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.FieldAttribute.#ctor(System.Int32,System.Int32)"> + <summary> + Constructor. + </summary> + <param name="fieldIndex">Index of the field, 0 based. Each field must have a unique progressive index</param> + <param name="length">Lenght of the field when readed and writed to the string.</param> + </member> + <member name="T:DevAge.Text.FixedLength.ParseFormatAttribute"> + <summary> + Attribute used to specify additional parse options + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.ParseFormatAttribute.#ctor"> + <summary> + Constructor. Use one of these properties to customize the format: CultureInfo, DateTimeFormat, NumberFormat, TrimBeforeParse. + Default is Invariant culture format. + </summary> + </member> + <member name="T:DevAge.Text.FixedLength.ValueMappingAttribute"> + <summary> + Attribute used to convert a specific value to another value + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.ValueMappingAttribute.#ctor(System.String,System.Object)"> + <summary> + Constructor + </summary> + <param name="stringValue">String value</param> + <param name="fieldValue">Field typed value</param> + </member> + <member name="T:DevAge.Text.FixedLength.StandardValueAttribute"> + <summary> + Attribute used to specify the standard value (mandatory value) for a specific field. + You can use this attribute for example when you want a particular field to only accept one or more standard values. + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.StandardValueAttribute.#ctor(System.Object)"> + <summary> + Construcotr + </summary> + <param name="standardValue">Required value</param> + </member> + <member name="T:DevAge.Patterns.IActivity"> + <summary> + An interface to represents a basic activity. + </summary> + </member> + <member name="M:DevAge.Patterns.IActivity.Start(DevAge.Patterns.IActivityEvents)"> + <summary> + Start the activity and all sub activities. + </summary> + <param name="events">Interface class that receive the events, can be null if no event class is needed.</param> + </member> + <member name="M:DevAge.Patterns.IActivity.Cancel"> + <summary> + Cancel the current activity and all sub activities throwing a ActivityCanceledException. + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.SubActivities"> + <summary> + Subordinated activities. Are executed after the current activity. If one of these activity throws an exception is propagated to parent activity and the operation is stopped. + Note that the sub activities can be async and so can be executed in a parellel mode. + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.Status"> + <summary> + Activity status + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.Name"> + <summary> + Name of the activity used to describe the class. + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.WaitHandle"> + <summary> + Gets the WaitHandle class used to wait for the completition of the activity. + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.Exception"> + <summary> + Gets the exception throwed when the activity fail. Null if no exception. + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.Parent"> + <summary> + Gets or sets the Activity parent. Null when it is a root activity. + Do not set manually the parent activity, but simply add the activity to the SubActivities collection. + </summary> + </member> + <member name="P:DevAge.Patterns.IActivity.FullName"> + <summary> + Gets the activity full name of the activity, composed by the full name of the parent activity separated with a \ character + </summary> + </member> + <member name="F:DevAge.Patterns.SubActivityWaitMode.DoNotWait"> + <summary> + Don't wait the sub activities to finish (parallel processing, asyncronous) + </summary> + </member> + <member name="F:DevAge.Patterns.SubActivityWaitMode.WaitOnEach"> + <summary> + Wait for each sub activities (syncronous) + </summary> + </member> + <member name="F:DevAge.Patterns.SubActivityWaitMode.WaitAtTheEnd"> + <summary> + Wait all the sub activities at the end (parallel processing but syncronized with the parent) + </summary> + </member> + <member name="T:DevAge.Patterns.ActivityBase"> + <summary> + Base activity class. Override the OnWork method to customize the activity. + </summary> + </member> + <member name="F:DevAge.Patterns.ActivityBase.mActivityCount"> + <summary> + An activity count used only to generate a seguential name + </summary> + </member> + <member name="F:DevAge.Patterns.ActivityBase.mWaitHandle"> + <summary> + Initially set to signaled=true=completed, nonsignaled=false=notcompleted, + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityBase.#ctor"> + <summary> + Constructor + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityBase.ResetRunningStatus"> + <summary> + Reset the status property to the original values. If the activity is still running an exception is throw. + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityBase.OnWork"> + <summary> + Working method. Abstract. Override this method to provide a specific work for the activity. + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityBase.DoWork"> + <summary> + Internal work method. Call the OnWork method and Start the SubActivities. + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityBase.WaitActivities(DevAge.Patterns.ActivityCollection,System.Int32)"> + <summary> + Wait until or SubActivities are completed. Throw an exception on timeout. + </summary> + <param name="activities"></param> + <param name="timeout"></param> + </member> + <member name="M:DevAge.Patterns.ActivityBase.WaitActivity(DevAge.Patterns.IActivity,System.Int32)"> + <summary> + Wait until or SubActivities are completed. Throw an exception on timeout. + </summary> + <param name="activity"></param> + <param name="timeout"></param> + </member> + <member name="M:DevAge.Patterns.ActivityBase.CheckActivitiesException(DevAge.Patterns.ActivityCollection)"> + <summary> + Throw an exception if one of the activities has an exception. + </summary> + <param name="activities"></param> + </member> + <member name="M:DevAge.Patterns.ActivityBase.CheckActivityException(DevAge.Patterns.IActivity)"> + <summary> + Throw an exception if one of the activities has an exception. + </summary> + <param name="activity"></param> + </member> + <member name="M:DevAge.Patterns.ActivityBase.StartActivity"> + <summary> + Start the activity. NOTE: Usually don't override this method but override the OnWork method to implement the specific activity work. + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityBase.Start(DevAge.Patterns.IActivityEvents)"> + <summary> + Start the activity. If the activity is already running an exception is throw. + To override the common working code use the OnWork abstract method. + </summary> + <param name="events">Interface class that receive the events, can be null if no event class is needed.</param> + </member> + <member name="M:DevAge.Patterns.ActivityBase.Cancel"> + <summary> + Cancel the current activity and all sub activities throwing a ActivityCanceledException. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.SubActivitiesTimeOut"> + <summary> + Gets or sets the time to wait for the sub activities. If the operation is still executing then a TimeOutException is fired. Default is System.Threading.Timeout.Infinite. Default is true. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.PropagateException"> + <summary> + Gets or sets if propagate an exception from sub activities to the current activities. Default is true. + Only valid SubActivitiesTimeOut is WaitOnEach or WaitAtTheEnd + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.SubActivityWaitMode"> + <summary> + Gets or sets how the current activity wait the completition of the sub activities. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.SubActivities"> + <summary> + Subordinated activities. Are executed after the current activity. If one of these activity throws an exception is propagated to parent activity and the operation is stopped. + Note that the sub activities can be async and so can be executed in a parellel mode. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.Status"> + <summary> + Activity status + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.Name"> + <summary> + Name of the activity used to describe the class. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.WaitHandle"> + <summary> + Gets the WaitHandle class used to wait for the completition of the activity. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.Exception"> + <summary> + Gets the exception throwed when the activity fail. Null if no exception. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.Parent"> + <summary> + Gets or sets the Activity parent. Null when it is a root activity. + Do not set manually the parent activity, but simply add the activity to the SubActivities collection. + </summary> + </member> + <member name="P:DevAge.Patterns.ActivityBase.FullName"> + <summary> + Gets the activity full name of the activity, composed by the full name of the parent activity separated with a \ character + </summary> + </member> + <member name="T:DevAge.Patterns.Activity"> + <summary> + An activity used as a container for other activities using a syncronized code. + </summary> + </member> + <member name="T:DevAge.Patterns.AsynchronousActivity"> + <summary> + An activity used as a container for other activities using an asynchronous code. + Override the OnAsyncWork method for custom asynchronous work. + </summary> + </member> + <member name="T:DevAge.Patterns.AsyncActivityBase"> + <summary> + Base activity class. Override the OnBeginWork and OnEndWork method to customize the activity. + This class support an asyncronous activity. + </summary> + </member> + <member name="M:DevAge.Patterns.AsyncActivityBase.OnBeginWork(System.AsyncCallback)"> + <summary> + Begind working method. Called to start the asyncronous activity. Abstract. + </summary> + </member> + <member name="M:DevAge.Patterns.AsyncActivityBase.OnEndWork(System.IAsyncResult)"> + <summary> + End working method. Called when the asyncronous operation is finished + </summary> + <param name="asyncResult">AsyncResult</param> + </member> + <member name="M:DevAge.Patterns.AsyncActivityBase.OnWork"> + <summary> + Working method. + </summary> + </member> + <member name="M:DevAge.Patterns.AsyncActivityBase.StartActivity"> + <summary> + Start the activity. NOTE: Usually don't override this method but override the OnBeginWork method to implement the specific activity work. + </summary> + </member> + <member name="T:DevAge.Data.StreamDataSet"> + <summary> + A static class used to serialize a DataSet to and from a stream using a binary or xml format. + The xml format use the standard DataSet xml serialization, the binary format use a custom format. + </summary> + </member> + <member name="M:DevAge.Data.StreamDataSet.Write(System.IO.Stream,System.Data.DataSet,DevAge.Data.StreamDataSetFormat)"> + <summary> + Write the dataset to the stream using the specified format. + </summary> + <param name="destination"></param> + <param name="source"></param> + <param name="format"></param> + </member> + <member name="M:DevAge.Data.StreamDataSet.Read(System.IO.Stream,System.Data.DataSet,DevAge.Data.StreamDataSetFormat,System.Boolean)"> + <summary> + Read from the stream and populate the dataset using the specified format. + </summary> + <param name="source"></param> + <param name="destination"></param> + <param name="format"></param> + <param name="mergeSchema">True to merge the schema, otherwise it is used the schema of the dataset</param> + </member> + <member name="T:DevAge.Data.StreamDataSetFormat"> + <summary> + Enum to control the serialization format + </summary> + </member> + <member name="F:DevAge.Data.StreamDataSetFormat.XML"> + <summary> + Standard xml format used by the ReadXml and WriteXml of the DataSet + </summary> + </member> + <member name="F:DevAge.Data.StreamDataSetFormat.Binary"> + <summary> + Custom binary format. More compact of the xml but not human readable + </summary> + </member> + <member name="T:DevAge.Data.BinaryDataSetInvalidException"> + <summary> + Binary data not valid exception + </summary> + </member> + <member name="M:DevAge.Data.BinaryDataSetInvalidException.#ctor"> + <summary> + Constructor + </summary> + </member> + <member name="M:DevAge.Data.BinaryDataSetInvalidException.#ctor(System.Exception)"> + <summary> + Constructor + </summary> + <param name="p_InnerException"></param> + </member> + <member name="T:DevAge.Data.BinaryDataSetVersionException"> + <summary> + Version not valid exception + </summary> + </member> + <member name="M:DevAge.Data.BinaryDataSetVersionException.#ctor"> + <summary> + Constructor + </summary> + </member> + <member name="M:DevAge.Data.BinaryDataSetVersionException.#ctor(System.Exception)"> + <summary> + Constructor + </summary> + <param name="p_InnerException"></param> + </member> + <member name="T:DevAge.Configuration.CommandLineArgs"> + <summary> + Description résumée de Arguments. + </summary> + </member> + <member name="T:DevAge.ComponentModel.Converter.PercentTypeConverter"> + <summary> + A TypeConverter that support string conversion from and to string with the percent symbol. + Support Conversion for Float, Double and Decimal + </summary> + </member> + <member name="P:DevAge.ComponentModel.Converter.PercentTypeConverter.ConsiderAllStringAsPercent"> + <summary> + If true and the user insert a string with no percent symbel the value is divided by 100, otherwise not. + </summary> + </member> + <member name="T:DevAge.Text.FixedLength.LineWriter"> + <summary> + A class used to create fixed lenght string. + </summary> + </member> + <member name="T:DevAge.IO.StreamPersistence"> + <summary> + A static class to help save and read stream data + </summary> + </member> + <member name="T:DevAge.Configuration.PersistableItemDictionary"> + <summary> + A dictionary with keys of type String and values of type PersistableItem + </summary> + </member> + <member name="M:DevAge.Configuration.PersistableItemDictionary.#ctor"> + <summary> + Initializes a new empty instance of the PersistableItemDictionary class + </summary> + </member> + <member name="M:DevAge.Configuration.PersistableItemDictionary.Add(System.String,DevAge.Configuration.PersistableItem)"> + <summary> + Adds an element with the specified key and value to this PersistableItemDictionary. + </summary> + <param name="key"> + The String key of the element to add. + </param> + <param name="value"> + The PersistableItem value of the element to add. + </param> + </member> + <member name="M:DevAge.Configuration.PersistableItemDictionary.Contains(System.String)"> + <summary> + Determines whether this PersistableItemDictionary contains a specific key. + </summary> + <param name="key"> + The String key to locate in this PersistableItemDictionary. + </param> + <returns> + true if this PersistableItemDictionary contains an element with the specified key; + otherwise, false. + </returns> + </member> + <member name="M:DevAge.Configuration.PersistableItemDictionary.ContainsKey(System.String)"> + <summary> + Determines whether this PersistableItemDictionary contains a specific key. + </summary> + <param name="key"> + The String key to locate in this PersistableItemDictionary. + </param> + <returns> + true if this PersistableItemDictionary contains an element with the specified key; + otherwise, false. + </returns> + </member> + <member name="M:DevAge.Configuration.PersistableItemDictionary.ContainsValue(DevAge.Configuration.PersistableItem)"> + <summary> + Determines whether this PersistableItemDictionary contains a specific value. + </summary> + <param name="value"> + The PersistableItem value to locate in this PersistableItemDictionary. + </param> + <returns> + true if this PersistableItemDictionary contains an element with the specified value; + otherwise, false. + </returns> + </member> + <member name="M:DevAge.Configuration.PersistableItemDictionary.Remove(System.String)"> + <summary> + Removes the element with the specified key from this PersistableItemDictionary. + </summary> + <param name="key"> + The String key of the element to remove. + </param> + </member> + <member name="P:DevAge.Configuration.PersistableItemDictionary.Item(System.String)"> + <summary> + Gets or sets the PersistableItem associated with the given String + </summary> + <param name="key"> + The String whose value to get or set. + </param> + </member> + <member name="P:DevAge.Configuration.PersistableItemDictionary.Keys"> + <summary> + Gets a collection containing the keys in this PersistableItemDictionary. + </summary> + </member> + <member name="P:DevAge.Configuration.PersistableItemDictionary.Values"> + <summary> + Gets a collection containing the values in this PersistableItemDictionary. + </summary> + </member> + <member name="T:DevAge.ComponentModel.Converter.CurrencyTypeConverter"> + <summary> + A TypeConverter that support string conversion from and to string with the currency symbol. + Support Conversion for Float, Double and Decimal, Int + </summary> + </member> + <member name="T:DevAge.ComponentModel.Converter.NumberTypeConverter"> + <summary> + A TypeConverter that support string conversion from and to string with a custom format number. + Support Conversion for Float, Double and Decimal, Int + </summary> + </member> + <member name="T:DevAge.Text.FixedLength.FieldList"> + <summary> + A dictionary with keys of type string and values of type IField + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.FieldList.#ctor"> + <summary> + Initializes a new empty instance of the FieldList class + </summary> + </member> + <member name="M:DevAge.Text.FixedLength.FieldList.Add(DevAge.Text.FixedLength.IField)"> + <summary> + Adds an element with the specified key and value to this FieldList. + </summary> + <param name="key"> + The string key of the element to add. + </param> + <param name="value"> + The IField value of the element to add. + </param> + </member> + <member name="M:DevAge.Text.FixedLength.FieldList.Contains(System.String)"> + <summary> + Determines whether this FieldList contains a specific key. + </summary> + <param name="fieldName"> + The string key to locate in this FieldList. + </param> + <returns> + true if this FieldList contains an element with the specified key; + otherwise, false. + </returns> + </member> + <member name="M:DevAge.Text.FixedLength.FieldList.ContainsKey(System.String)"> + <summary> + Determines whether this FieldList contains a specific key. + </summary> + <param name="key"> + The string key to locate in this FieldList. + </param> + <returns> + true if this FieldList contains an element with the specified key; + otherwise, false. + </returns> + </member> + <member name="M:DevAge.Text.FixedLength.FieldList.ContainsValue(DevAge.Text.FixedLength.IField)"> + <summary> + Determines whether this FieldList contains a specific value. + </summary> + <param name="value"> + The IField value to locate in this FieldList. + </param> + <returns> + true if this FieldList contains an element with the specified value; + otherwise, false. + </returns> + </member> + <member name="M:DevAge.Text.FixedLength.FieldList.Remove(System.String)"> + <summary> + Removes the element with the specified key from this FieldList. + </summary> + <param name="fieldName"> + The string key of the element to remove. + </param> + </member> + <member name="P:DevAge.Text.FixedLength.FieldList.Item(System.String)"> + <summary> + Gets or sets the IField associated with the given string + </summary> + <param name="key"> + The string whose value to get or set. + </param> + </member> + <member name="P:DevAge.Text.FixedLength.FieldList.Keys"> + <summary> + Gets a collection containing the keys in this FieldList. + </summary> + </member> + <member name="P:DevAge.Text.FixedLength.FieldList.Values"> + <summary> + Gets a collection containing the values in this FieldList. + </summary> + </member> + <member name="T:DevAge.Shell.Utilities"> + <summary> + Shell utilities + </summary> + </member> + <member name="T:DevAge.Patterns.ActivityCanceledException"> + <summary> + Exception fired when canceling an activity with the Cancel method. + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityCanceledException.#ctor"> + <summary> + Constructor + </summary> + </member> + <member name="T:DevAge.Patterns.ActivityStatusNotValidException"> + <summary> + Exception fired when canceling an activity with the Cancel method. + </summary> + </member> + <member name="M:DevAge.Patterns.ActivityStatusNotValidException.#ctor"> + <summary> + Constructor + </summary> + </member> + <member name="T:DevAge.Patterns.TimeOutActivityException"> + <summary> + Exception fired when a time out is encountered. + </summary> + </member> + <member name="M:DevAge.Patterns.TimeOutActivityException.#ctor"> + <summary> + Constructor + </summary> + </member> + <member name="T:DevAge.Patterns.SubActivityException"> + <summary> + Exception fired when a time out is encountered. + </summary> + </member> + <member name="M:DevAge.Patterns.SubActivityException.#ctor(System.String,System.Exception)"> + <summary> + Constructor + </summary> + <param name="activityName"></param> + <param name="innerException"></param> + </member> + <member name="T:DevAge.IO.IsolatedStorage.IsolatedStorageSettingBase"> + <summary> + Abstract class that help to save settings in the isolated storage + </summary> + </member> + <member name="T:DevAge.ComponentModel.Validator.ValidatorTypeConverter"> + <summary> + A string editor that use a TypeConverter for conversion. + </summary> + </member> + <member name="T:DevAge.ComponentModel.Validator.ValidatorBase"> + <summary> + A base class to support value conversion and validation. This class is used if no conversion is required or as a base class for specialized validator. + Naming Legend: + Object = an object not yet converted for the current validator, + Value = an object already converted and valid for the current validator, + String = a string that can be used for conversion to and from Value, + DisplayString = a string representation of the Value + </summary> + </member> + <member name="T:DevAge.ComponentModel.ComponentLight"> + <summary> + A IComponent implementation, used as a base class for component derived class. It is similar to the System Component class but doesn't derive from MarshalByRef class, for this reason it is faster and consume less resources. + Can be serialized. + </summary> + </member> + <member name="M:DevAge.ComponentModel.ComponentLight.#ctor"> + <summary> + Default constructor + </summary> + </member> + <member name="M:DevAge.ComponentModel.ComponentLight.#ctor(DevAge.ComponentModel.ComponentLight)"> + <summary> + Copy constructor + </summary> + <param name="other"></param> + </member> + <member name="T:DevAge.ComponentModel.Validator.IValidator"> + <summary> + An interface to support value conversion and validation. + Naming Legend: + Object = an object not yet converted for the current validator, + Value = an object already converted and valid for the current validator, + String = a string that can be used for conversion to and from Value, + DisplayString = a string representation of the Value + </summary> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsNullString(System.String)"> + <summary> + Returns true if the string is null or if is equals to the NullString + </summary> + <param name="p_str"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.ObjectToValue(System.Object)"> + <summary> + Convert an object according to the current ValueType of the validator + </summary> + <param name="p_Object"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.ValueToObject(System.Object,System.Type)"> + <summary> + Convert a value valid for the current validator ValueType to an object with the Type specified. Throw an exception on error. + </summary> + <param name="p_Value"></param> + <param name="p_ReturnObjectType"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.ValueToString(System.Object)"> + <summary> + Convert a value valid for the current validator ValueType to a string that can be used for other conversions, for example StringToValue method. + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.StringToValue(System.String)"> + <summary> + Converts a string to an object according to the type of the string editor + </summary> + <param name="p_str"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsStringConversionSupported"> + <summary> + Returns true if string conversion is suported. AllowStringConversion must be true and the current Validator must support string conversion. + </summary> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.ValueToDisplayString(System.Object)"> + <summary> + Converts a value valid for this validator valuetype to a string representation. The string cannot be used for conversion. + If the validator support string conversion this method simply call ValueToString otherwise call Value.ToString() + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsValidValue(System.Object)"> + <summary> + Returns true if the value is valid for this type of editor without any conversion. + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsValidObject(System.Object)"> + <summary> + Returns true if the object is valid for this type of validator, using conversion functions. + </summary> + <param name="p_Object"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsValidObject(System.Object,System.Object@)"> + <summary> + Returns true if the object is valid for this type of validator, using conversion functions. Returns as parameter the value converted. + </summary> + <param name="p_Object"></param> + <param name="p_ValueConverted"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsValidString(System.String)"> + <summary> + Returns true if the string is valid for this type of editor, using string conversion function. + </summary> + <param name="p_strValue"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsValidString(System.String,System.Object@)"> + <summary> + Returns true if the string is valid for this type of editor, using string conversion function. An returns the object converted. + </summary> + <param name="p_strValue"></param> + <param name="p_ValueConverted"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.IsInStandardValues(System.Object)"> + <summary> + Returns true if the value specified is presents in the list StandardValues. + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.StandardValueAtIndex(System.Int32)"> + <summary> + Returns the standard values at the specified index. If StandardValues support IList use simple the indexer method otherwise loop troght the collection. + </summary> + <param name="p_Index"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.IValidator.StandardValuesIndexOf(System.Object)"> + <summary> + Returns the index of the specified standard value. -1 if not found. If StandardValues support IList use simple the indexer method otherwise loop troght the collection. + </summary> + <param name="p_StandardValue"></param> + <returns></returns> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.AllowNull"> + <summary> + True to allow null object value or NullString string Value + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.NullString"> + <summary> + Null string representation. A string is null when is null or when is equals to this string. Default is empty string. + Used by ValueToString and StringToValue + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.NullDisplayString"> + <summary> + Null string representation. A string is null when is null or when is equals to this string. Default is empty string. + Used by ValueToDisplayString + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.AllowStringConversion"> + <summary> + Gets or Sets if the string conversion is allowed. + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.MinimumValue"> + <summary> + Minimum value allowed. If null no check is performed. The value must derive from IComparable interface to use Minimum or Maximum feature. + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.MaximumValue"> + <summary> + Maximum value allowed. If null no check is performed. The value must derive from IComparable interface to use Minimum or Maximum feature. + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.ValueType"> + <summary> + Type allowed for the current editor. Cannot be null. + </summary> + </member> + <member name="E:DevAge.ComponentModel.Validator.IValidator.ConvertingObjectToValue"> + <summary> + Fired when converting a object to the value specified. Called from method ObjectToValue and IsValidObject + </summary> + </member> + <member name="E:DevAge.ComponentModel.Validator.IValidator.ConvertingValueToObject"> + <summary> + Fired when converting a object to the value specified. Called from method ObjectToValue and IsValidObject + </summary> + </member> + <member name="E:DevAge.ComponentModel.Validator.IValidator.ConvertingValueToDisplayString"> + <summary> + Fired when converting a value to a display string. Called from method ValueToDisplayString + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.DefaultValue"> + <summary> + Default value for this editor, usually is the default value for the specified type. + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.StandardValues"> + <summary> + A list of values that this editor can support. If StandardValuesExclusive is true then the editor can only support one of these values. + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.StandardValuesExclusive"> + <summary> + If StandardValuesExclusive is true then the editor can only support the list specified in StandardValues. + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.IValidator.CultureInfo"> + <summary> + Culture for conversion. If null the default user culture is used. Default is null. + </summary> + </member> + <member name="E:DevAge.ComponentModel.Validator.IValidator.Changed"> + <summary> + Fired when one of the properties of the Validator change. + </summary> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.#ctor"> + <summary> + Constructor. Initialize the class using a null type. + </summary> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.#ctor(System.Type)"> + <summary> + Constructor. + </summary> + <param name="type">The type used to validate the values. If null no validation is made.</param> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsNullString(System.String)"> + <summary> + Returns true if the string is null or if is equals to the NullString + </summary> + <param name="p_str"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.ObjectToStringForError(System.Object)"> + <summary> + Returns a string used for error description for a specified object. Usually used when printing the object for the error message when there is a conversion error. + </summary> + <param name="val"></param> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.ObjectToValue(System.Object)"> + <summary> + Convert an object according to the current ValueType of the validator + </summary> + <param name="p_Object"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.ValueToObject(System.Object,System.Type)"> + <summary> + Convert a value according to the current ValueType to an object with the Type specified. Throw an exception on error. + </summary> + <param name="p_Value"></param> + <param name="p_ReturnObjectType"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.ValueToString(System.Object)"> + <summary> + Converts a value object to a string representation + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.StringToValue(System.String)"> + <summary> + Converts a string to an object according to the type of the string editor + </summary> + <param name="p_str"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsStringConversionSupported"> + <summary> + Returns true if string conversion is suported. AllowStringConversion must be true and the current Validator must support string conversion. + </summary> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.ValueToDisplayString(System.Object)"> + <summary> + Converts a value valid for this validator valuetype to a string representation. The string cannot be used for conversion. + If the validator support string conversion this method simply call ValueToString otherwise call Value.ToString() + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="F:DevAge.ComponentModel.Validator.ValidatorBase.m_ConvertingObjectToValue"> + <summary> + Fired when converting a object to the value specified. Called from method ObjectToValue and IsValidObject + </summary> + </member> + <member name="F:DevAge.ComponentModel.Validator.ValidatorBase.m_ConvertingValueToObject"> + <summary> + Fired when converting a object to the value specified. Called from method ObjectToValue and IsValidObject + </summary> + </member> + <member name="F:DevAge.ComponentModel.Validator.ValidatorBase.m_ConvertingValueToDisplayString"> + <summary> + Fired when converting a value to a display string. Called from method ValueToDisplayString + </summary> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.OnConvertingObjectToValue(DevAge.ComponentModel.ConvertingObjectEventArgs)"> + <summary> + Fired when converting a object to the value specified. Called from method ObjectToValue and IsValidObject + </summary> + <param name="e"></param> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.OnConvertingValueToObject(DevAge.ComponentModel.ConvertingObjectEventArgs)"> + <summary> + Fired when converting a object to the value specified. Called from method ObjectToValue and IsValidObject + </summary> + <param name="e"></param> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.OnConvertingValueToDisplayString(DevAge.ComponentModel.ConvertingObjectEventArgs)"> + <summary> + Fired when converting a value to a display string. Called from method ValueToDisplayString + </summary> + <param name="e"></param> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsValidValue(System.Object)"> + <summary> + Returns true if the value is valid for this type of editor without any conversion. + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsValidObject(System.Object)"> + <summary> + Returns true if the object is valid for this type of validator, using conversion functions. + </summary> + <param name="p_Object"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsValidObject(System.Object,System.Object@)"> + <summary> + Returns true if the object is valid for this type of validator, using conversion functions. Returns as parameter the value converted. + </summary> + <param name="p_Object"></param> + <param name="p_ValueConverted"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsValidString(System.String)"> + <summary> + Returns true if the string is valid for this type of editor, using string conversion function. + </summary> + <param name="p_strValue"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsValidString(System.String,System.Object@)"> + <summary> + Returns true if the string is valid for this type of editor, using string conversion function. Returns as out parameter the object converted. + </summary> + <param name="p_strValue"></param> + <param name="p_ValueConverted"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.IsInStandardValues(System.Object)"> + <summary> + Returns true if the value specified is presents in the list StandardValues. + </summary> + <param name="p_Value"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.StandardValueAtIndex(System.Int32)"> + <summary> + Returns the standard values at the specified index. If StandardValues support IList use simple the indexer method otherwise loop troght the collection. + </summary> + <param name="p_Index"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.StandardValuesIndexOf(System.Object)"> + <summary> + Returns the index of the specified standard value. -1 if not found. If StandardValues support IList use simple the indexer method otherwise loop troght the collection. + </summary> + <param name="p_StandardValue"></param> + <returns></returns> + </member> + <member name="M:DevAge.ComponentModel.Validator.ValidatorBase.OnChanged(System.EventArgs)"> + <summary> + Fired when one of the properties of the Validator change. + Call the Changed event. + </summary> + <param name="e"></param> + </member> + <member name="P:DevAge.ComponentModel.Validator.ValidatorBase.AllowNull"> + <summary> + True to allow null object value or NullString string Value + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.ValidatorBase.NullString"> + <summary> + Null string representation. A string is null when is null or when is equals to this string. Default is empty string. + Used by ValueToString and StringToValue + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.ValidatorBase.NullDisplayString"> + <summary> + Null string representation. Default is empty string. + Used by ValueToDisplayString + </summary> + </member> + <member name="P:DevAge.ComponentModel.Validator.ValidatorBase.AllowStringConversion"> + <summary> + Gets or Sets if the string conversion is allowed. + </summary> + </member> + <member name="E:DevAge.ComponentModel.Validator.ValidatorBase.ConvertingObjectToValue"> + ... [truncated message content] |
From: <che...@us...> - 2009-09-10 15:33:52
|
Revision: 3084 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3084&view=rev Author: chemelli_sf Date: 2009-09-10 15:33:42 +0000 (Thu, 10 Sep 2009) Log Message: ----------- Removed unavailable plugins from plugin configuration grid Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/FireDTV Receiver/FireDTVReceiver.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2009-09-10 11:28:34 UTC (rev 3083) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2009-09-10 15:33:42 UTC (rev 3084) @@ -38,542 +38,538 @@ namespace IRServer.Configuration { - internal partial class Config : Form - { - #region Constants + internal partial class Config : Form + { + #region Constants - private const int ColConfigure = 4; - private const int ColIcon = 0; - private const int ColName = 1; - private const int ColReceive = 2; - private const int ColTransmit = 3; + private const int ColConfigure = 4; + private const int ColIcon = 0; + private const int ColName = 1; + private const int ColReceive = 2; + private const int ColTransmit = 3; - #endregion Constants + #endregion Constants - #region Variables + #region Variables - private readonly PluginBase[] _transceivers; + private readonly PluginBase[] _transceivers; - private bool _abstractRemoteMode; - private string _hostComputer = String.Empty; - private IRServerMode _mode = IRServerMode.ServerMode; - private string _processPriority = String.Empty; - private BackgroundWorker monitorThread; + private bool _abstractRemoteMode; + private string _hostComputer = String.Empty; + private IRServerMode _mode = IRServerMode.ServerMode; + private string _processPriority = String.Empty; + private BackgroundWorker monitorThread; - #endregion Variables + #endregion Variables - private void Config_Load(object sender, EventArgs e) - { - monitorThreadStart(); - } + private void Config_Load(object sender, EventArgs e) + { + monitorThreadStart(); + } - private void Config_FormClosing(object sender, FormClosingEventArgs e) - { - monitorThreadStop(); - } - - private void monitorThreadStart() - { - if (monitorThread == null) - monitorThread = new BackgroundWorker(); - monitorThread.WorkerReportsProgress = true; - monitorThread.WorkerSupportsCancellation = true; - monitorThread.ProgressChanged += new ProgressChangedEventHandler(monitorThread_ProgressChanged); - monitorThread.DoWork += new DoWorkEventHandler(monitorThread_DoWork); - monitorThread.RunWorkerAsync(); - } + private void Config_FormClosing(object sender, FormClosingEventArgs e) + { + monitorThreadStop(); + } - private void monitorThreadStop() - { - monitorThread.CancelAsync(); - } + private void monitorThreadStart() + { + if (monitorThread == null) + monitorThread = new BackgroundWorker(); + monitorThread.WorkerReportsProgress = true; + monitorThread.WorkerSupportsCancellation = true; + monitorThread.ProgressChanged += new ProgressChangedEventHandler(monitorThread_ProgressChanged); + monitorThread.DoWork += new DoWorkEventHandler(monitorThread_DoWork); + monitorThread.RunWorkerAsync(); + } - private void monitorThread_DoWork(object sender, EventArgs e) - { - do - { - Program.getStatus(); - monitorThread.ReportProgress(0); - Thread.Sleep(1000); - } - while (!monitorThread.CancellationPending); - } + private void monitorThreadStop() + { + monitorThread.CancelAsync(); + } - private void monitorThread_ProgressChanged(object sender, EventArgs e) - { - setButtons(); - } + private void monitorThread_DoWork(object sender, EventArgs e) + { + do + { + Program.getStatus(); + monitorThread.ReportProgress(0); + Thread.Sleep(1000); + } + while (!monitorThread.CancellationPending); + } - private void setButtons() - { - if (Program._serviceInstalled == true) - { - toolStripServiceButton.Text = "Uninstall Service"; - } - else - { - toolStripServiceButton.Text = "Install Service"; - } - switch (Program._irsStatus) - { - case IrsStatus.NotRunning: - { - toolStripButtonApplication.Image = Resources.Start; - toolStripButtonApplication.Enabled = true; - toolStripButtonService.Image = Resources.Start; - toolStripButtonService.Enabled = Program._serviceInstalled; - break; - } - case IrsStatus.RunningApplication: - { - toolStripButtonApplication.Image = Resources.Stop; - toolStripButtonApplication.Enabled = true; - toolStripButtonService.Image = Resources.Start; - toolStripButtonService.Enabled = false; - break; - } - case IrsStatus.RunningService: - { - toolStripButtonApplication.Image = Resources.Start; - toolStripButtonApplication.Enabled = false; - toolStripButtonService.Image = Resources.Stop; - toolStripButtonService.Enabled = true; - break; - } - } - } + private void monitorThread_ProgressChanged(object sender, EventArgs e) + { + setButtons(); + } - private void CreateGrid() - { - IrssLog.Info("Creating configuration grid ..."); + private void setButtons() + { + if (Program._serviceInstalled == true) + { + toolStripServiceButton.Text = "Uninstall Service"; + } + else + { + toolStripServiceButton.Text = "Install Service"; + } + switch (Program._irsStatus) + { + case IrsStatus.NotRunning: + { + toolStripButtonApplication.Image = Resources.Start; + toolStripButtonApplication.Enabled = true; + toolStripButtonService.Image = Resources.Start; + toolStripButtonService.Enabled = Program._serviceInstalled; + break; + } + case IrsStatus.RunningApplication: + { + toolStripButtonApplication.Image = Resources.Stop; + toolStripButtonApplication.Enabled = true; + toolStripButtonService.Image = Resources.Start; + toolStripButtonService.Enabled = false; + break; + } + case IrsStatus.RunningService: + { + toolStripButtonApplication.Image = Resources.Start; + toolStripButtonApplication.Enabled = false; + toolStripButtonService.Image = Resources.Stop; + toolStripButtonService.Enabled = true; + break; + } + } + } - try - { - int row = 0; + private void CreateGrid() + { + IrssLog.Info("Creating configuration grid ..."); - gridPlugins.Rows.Clear(); - gridPlugins.Columns.SetCount(5); + try + { + int row = 0; - // Setup Column Headers - gridPlugins.Rows.Insert(row); + gridPlugins.Rows.Clear(); + gridPlugins.Columns.SetCount(5); - ColumnHeader header = new ColumnHeader(" "); - header.AutomaticSortEnabled = false; - gridPlugins[row, ColIcon] = header; + // Setup Column Headers + gridPlugins.Rows.Insert(row); - gridPlugins[row, ColName] = new ColumnHeader("Name"); - gridPlugins[row, ColReceive] = new ColumnHeader("Receive"); - gridPlugins[row, ColTransmit] = new ColumnHeader("Transmit"); - gridPlugins[row, ColConfigure] = new ColumnHeader("Configure"); - gridPlugins.FixedRows = 1; + ColumnHeader header = new ColumnHeader(" "); + header.AutomaticSortEnabled = false; + gridPlugins[row, ColIcon] = header; - foreach (PluginBase transceiver in _transceivers) - { - gridPlugins.Rows.Insert(++row); - gridPlugins.Rows[row].Tag = transceiver; + gridPlugins[row, ColName] = new ColumnHeader("Name"); + gridPlugins[row, ColReceive] = new ColumnHeader("Receive"); + gridPlugins[row, ColTransmit] = new ColumnHeader("Transmit"); + gridPlugins[row, ColConfigure] = new ColumnHeader("Configure"); + gridPlugins.FixedRows = 1; - // Icon Cell - if (transceiver.DeviceIcon != null) - { - Image iconCell = new Image(transceiver.DeviceIcon); - iconCell.Editor.EnableEdit = false; + foreach (PluginBase transceiver in _transceivers) + { + gridPlugins.Rows.Insert(++row); + gridPlugins.Rows[row].Tag = transceiver; - gridPlugins[row, ColIcon] = iconCell; - } - else - { - gridPlugins[row, ColIcon] = new Cell(); - } + // Icon Cell + if (transceiver.DeviceIcon != null) + { + Image iconCell = new Image(transceiver.DeviceIcon); + iconCell.Editor.EnableEdit = false; - // Name Cell - Cell nameCell = new Cell(transceiver.Name); + gridPlugins[row, ColIcon] = iconCell; + } + else + { + gridPlugins[row, ColIcon] = new Cell(); + } - CustomEvents nameCellController = new CustomEvents(); - nameCellController.DoubleClick += PluginDoubleClick; - nameCell.AddController(nameCellController); + // Name Cell + Cell nameCell = new Cell(transceiver.Name); - nameCell.AddController(new ToolTipText()); - nameCell.ToolTipText = String.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, - transceiver.Version, transceiver.Author, transceiver.Description); + CustomEvents nameCellController = new CustomEvents(); + nameCellController.DoubleClick += PluginDoubleClick; + nameCell.AddController(nameCellController); - gridPlugins[row, ColName] = nameCell; + nameCell.AddController(new ToolTipText()); + nameCell.ToolTipText = String.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, + transceiver.Version, transceiver.Author, transceiver.Description); - // Receive Cell - if (transceiver is IRemoteReceiver || transceiver is IMouseReceiver || transceiver is IKeyboardReceiver) - { - gridPlugins[row, ColReceive] = new CheckBox(); - } - else - { - gridPlugins[row, ColReceive] = new Cell(); - } + gridPlugins[row, ColName] = nameCell; - // Transmit Cell - if (transceiver is ITransmitIR) - { - CheckBox checkbox = new CheckBox(); + // Receive Cell + if (transceiver is IRemoteReceiver || transceiver is IMouseReceiver || transceiver is IKeyboardReceiver) + { + gridPlugins[row, ColReceive] = new CheckBox(); + } + else + { + gridPlugins[row, ColReceive] = new Cell(); + } - CustomEvents checkboxcontroller = new CustomEvents(); - checkboxcontroller.ValueChanged += TransmitChanged; - checkbox.Controller.AddController(checkboxcontroller); + // Transmit Cell + if (transceiver is ITransmitIR) + { + CheckBox checkbox = new CheckBox(); - gridPlugins[row, ColTransmit] = checkbox; - } - else - { - gridPlugins[row, ColTransmit] = new Cell(); - } + CustomEvents checkboxcontroller = new CustomEvents(); + checkboxcontroller.ValueChanged += TransmitChanged; + checkbox.Controller.AddController(checkboxcontroller); - // Configure Cell - if (transceiver is IConfigure) - { - Button button = new Button("Configure"); + gridPlugins[row, ColTransmit] = checkbox; + } + else + { + gridPlugins[row, ColTransmit] = new Cell(); + } - SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button(); - buttonClickEvent.Executed += buttonClickEvent_Executed; - button.Controller.AddController(buttonClickEvent); + // Configure Cell + if (transceiver is IConfigure) + { + Button button = new Button("Configure"); - gridPlugins[row, ColConfigure] = button; - } - else - { - gridPlugins[row, ColConfigure] = new Cell(); - } - } + SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button(); + buttonClickEvent.Executed += buttonClickEvent_Executed; + button.Controller.AddController(buttonClickEvent); - gridPlugins.Columns[ColIcon].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[ColName].AutoSizeMode = SourceGrid.AutoSizeMode.Default; - gridPlugins.Columns[ColReceive].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[ColTransmit].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[ColConfigure].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.AutoStretchColumnsToFitWidth = true; - gridPlugins.AutoSizeCells(); - } - catch (Exception ex) - { - IrssLog.Error(ex); - MessageBox.Show(this, ex.ToString(), "Error setting up plugin grid", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + gridPlugins[row, ColConfigure] = button; + } + else + { + gridPlugins[row, ColConfigure] = new Cell(); + } } - private void Detect() - { - IrssLog.Info("Attempting to detect Input Plugins ..."); + gridPlugins.Columns[ColIcon].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColName].AutoSizeMode = SourceGrid.AutoSizeMode.Default; + gridPlugins.Columns[ColReceive].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColTransmit].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColConfigure].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.AutoStretchColumnsToFitWidth = true; + gridPlugins.AutoSizeCells(); + } + catch (Exception ex) + { + IrssLog.Error(ex); + MessageBox.Show(this, ex.ToString(), "Error setting up plugin grid", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } - CheckBox checkBox; - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - PluginBase plugin = gridPlugins.Rows[row].Tag as PluginBase; + private void Detect() + { + IrssLog.Info("Attempting to detect Input Plugins ..."); - try - { - if (plugin == null) - throw new InvalidOperationException(String.Format("Invalid grid data, row {0} contains no plugin in tag", - row)); + CheckBox checkBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) + { + PluginBase plugin = gridPlugins.Rows[row].Tag as PluginBase; - PluginBase.DetectionResult detected = plugin.Detect(); + try + { + if (plugin == null) + throw new InvalidOperationException(String.Format("Invalid grid data, row {0} contains no plugin in tag", + row)); - if (detected == PluginBase.DetectionResult.DevicePresent) - { - IrssLog.Info("Plugin {0}: detected", plugin.Name); - } - if (detected == PluginBase.DetectionResult.DeviceException) - { - IrssLog.Warn("Plugin {0}: exception during Detect()", plugin.Name); - } + PluginBase.DetectionResult detected = plugin.Detect(); - // Receive - checkBox = gridPlugins[row, ColReceive] as CheckBox; - if (checkBox != null) - checkBox.Checked = (detected == PluginBase.DetectionResult.DevicePresent ? true : false); + if (detected == PluginBase.DetectionResult.DevicePresent) + { + IrssLog.Info("Plugin {0}: detected", plugin.Name); + } + if (detected == PluginBase.DetectionResult.DeviceException) + { + IrssLog.Warn("Plugin {0}: exception during Detect()", plugin.Name); + } - // Transmit - checkBox = gridPlugins[row, ColTransmit] as CheckBox; - if (checkBox != null) - checkBox.Checked = (detected == PluginBase.DetectionResult.DevicePresent ? true : false); - } - catch (BadImageFormatException) - { - IrssLog.Warn("Plugin {0}: not available on current OS architecture ({1})", plugin.Name, IntPtr.Size == 8 ? "x64" : "x86"); - } - catch (Exception ex) - { - IrssLog.Error(ex); - } - } + // Receive + checkBox = gridPlugins[row, ColReceive] as CheckBox; + if (checkBox != null) + checkBox.Checked = (detected == PluginBase.DetectionResult.DevicePresent ? true : false); - IrssLog.Info("Input Plugins detection completed..."); + // Transmit + checkBox = gridPlugins[row, ColTransmit] as CheckBox; + if (checkBox != null) + checkBox.Checked = (detected == PluginBase.DetectionResult.DevicePresent ? true : false); } - - private void Advanced() + catch (Exception ex) { - IrssLog.Info("Entering advanced configuration ..."); + IrssLog.Error(ex); + } + } - Advanced advanced = new Advanced(); + IrssLog.Info("Input Plugins detection completed..."); + } - advanced.AbstractRemoteMode = _abstractRemoteMode; - advanced.Mode = _mode; - advanced.HostComputer = _hostComputer; - advanced.ProcessPriority = _processPriority; + private void Advanced() + { + IrssLog.Info("Entering advanced configuration ..."); - if (advanced.ShowDialog(this) == DialogResult.OK) - { - _abstractRemoteMode = advanced.AbstractRemoteMode; - _mode = advanced.Mode; - _hostComputer = advanced.HostComputer; - _processPriority = advanced.ProcessPriority; - } - } + Advanced advanced = new Advanced(); - #region Properties + advanced.AbstractRemoteMode = _abstractRemoteMode; + advanced.Mode = _mode; + advanced.HostComputer = _hostComputer; + advanced.ProcessPriority = _processPriority; - public bool AbstractRemoteMode - { - get { return _abstractRemoteMode; } - set { _abstractRemoteMode = value; } - } + if (advanced.ShowDialog(this) == DialogResult.OK) + { + _abstractRemoteMode = advanced.AbstractRemoteMode; + _mode = advanced.Mode; + _hostComputer = advanced.HostComputer; + _processPriority = advanced.ProcessPriority; + } + } - public IRServerMode Mode - { - get { return _mode; } - set { _mode = value; } - } + #region Properties - public string HostComputer - { - get { return _hostComputer; } - set { _hostComputer = value; } - } + public bool AbstractRemoteMode + { + get { return _abstractRemoteMode; } + set { _abstractRemoteMode = value; } + } - public string ProcessPriority - { - get { return _processPriority; } - set { _processPriority = value; } - } + public IRServerMode Mode + { + get { return _mode; } + set { _mode = value; } + } - public string[] PluginReceive - { - get - { - List<string> receivers = new List<string>(); + public string HostComputer + { + get { return _hostComputer; } + set { _hostComputer = value; } + } - CheckBox checkBox; - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - checkBox = gridPlugins[row, ColReceive] as CheckBox; - if (checkBox != null && checkBox.Checked == true) - receivers.Add(gridPlugins[row, ColName].DisplayText); - } + public string ProcessPriority + { + get { return _processPriority; } + set { _processPriority = value; } + } - if (receivers.Count == 0) - return null; + public string[] PluginReceive + { + get + { + List<string> receivers = new List<string>(); - return receivers.ToArray(); - } - set - { - CheckBox checkBox; - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - checkBox = gridPlugins[row, ColReceive] as CheckBox; - if (checkBox == null) - continue; + CheckBox checkBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) + { + checkBox = gridPlugins[row, ColReceive] as CheckBox; + if (checkBox != null && checkBox.Checked == true) + receivers.Add(gridPlugins[row, ColName].DisplayText); + } - if (value == null) - checkBox.Checked = false; - else if (Array.IndexOf(value, gridPlugins[row, ColName].DisplayText) != -1) - checkBox.Checked = true; - else - checkBox.Checked = false; - } - } + if (receivers.Count == 0) + return null; + + return receivers.ToArray(); + } + set + { + CheckBox checkBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) + { + checkBox = gridPlugins[row, ColReceive] as CheckBox; + if (checkBox == null) + continue; + + if (value == null) + checkBox.Checked = false; + else if (Array.IndexOf(value, gridPlugins[row, ColName].DisplayText) != -1) + checkBox.Checked = true; + else + checkBox.Checked = false; } + } + } - public string PluginTransmit + public string PluginTransmit + { + get + { + CheckBox checkBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) { - get - { - CheckBox checkBox; - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - checkBox = gridPlugins[row, ColTransmit] as CheckBox; - if (checkBox != null && checkBox.Checked == true) - return gridPlugins[row, ColName].DisplayText; - } + checkBox = gridPlugins[row, ColTransmit] as CheckBox; + if (checkBox != null && checkBox.Checked == true) + return gridPlugins[row, ColName].DisplayText; + } - return String.Empty; - } - set - { - if (String.IsNullOrEmpty(value)) - return; + return String.Empty; + } + set + { + if (String.IsNullOrEmpty(value)) + return; - CheckBox checkBox; - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - checkBox = gridPlugins[row, ColTransmit] as CheckBox; - if (checkBox == null) - continue; + CheckBox checkBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) + { + checkBox = gridPlugins[row, ColTransmit] as CheckBox; + if (checkBox == null) + continue; - if (gridPlugins[row, ColName].DisplayText.Equals(value, StringComparison.OrdinalIgnoreCase)) - checkBox.Checked = true; - else - checkBox.Checked = false; - } - } + if (gridPlugins[row, ColName].DisplayText.Equals(value, StringComparison.OrdinalIgnoreCase)) + checkBox.Checked = true; + else + checkBox.Checked = false; } + } + } - #endregion Properties + #endregion Properties - #region Constructor + #region Constructor - /// <summary> - /// Initializes a new instance of the <see cref="Config"/> class. - /// </summary> - public Config() - { - InitializeComponent(); + /// <summary> + /// Initializes a new instance of the <see cref="Config"/> class. + /// </summary> + public Config() + { + InitializeComponent(); - try - { - _transceivers = Program.AvailablePlugins(); - } - catch (Exception ex) - { - IrssLog.Error(ex); + try + { + _transceivers = Program.AvailablePlugins(); + } + catch (Exception ex) + { + IrssLog.Error(ex); - _transceivers = null; - } + _transceivers = null; + } - if (_transceivers == null || _transceivers.Length == 0) - MessageBox.Show(this, "No IR Server Plugins found!", "IR Server Configuration", MessageBoxButtons.OK, - MessageBoxIcon.Error); - else - CreateGrid(); - } + if (_transceivers == null || _transceivers.Length == 0) + MessageBox.Show(this, "No IR Server Plugins found!", "IR Server Configuration", MessageBoxButtons.OK, + MessageBoxIcon.Error); + else + CreateGrid(); + } - #endregion Constructor + #endregion Constructor - #region Controls + #region Controls - private void buttonOK_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.OK; - Close(); - } + private void buttonOK_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.OK; + Close(); + } - private void buttonCancel_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - Close(); - } + private void buttonCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } - private void buttonClickEvent_Executed(object sender, EventArgs e) - { - CellContext context = (CellContext)sender; - Button cell = (Button)context.Cell; + private void buttonClickEvent_Executed(object sender, EventArgs e) + { + CellContext context = (CellContext)sender; + Button cell = (Button)context.Cell; - try - { - IConfigure plugin = cell.Row.Tag as IConfigure; - if (plugin != null) - plugin.Configure(this); - } - catch (Exception ex) - { - IrssLog.Error(ex); + try + { + IConfigure plugin = cell.Row.Tag as IConfigure; + if (plugin != null) + plugin.Configure(this); + } + catch (Exception ex) + { + IrssLog.Error(ex); - MessageBox.Show(this, ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } + MessageBox.Show(this, ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } - private void TransmitChanged(object sender, EventArgs e) - { - CellContext context = (CellContext)sender; - CheckBox cell = (CheckBox)context.Cell; + private void TransmitChanged(object sender, EventArgs e) + { + CellContext context = (CellContext)sender; + CheckBox cell = (CheckBox)context.Cell; - if (cell.Checked != true) - return; + if (cell.Checked != true) + return; - PluginBase plugin = cell.Row.Tag as PluginBase; - if (plugin == null) - return; + PluginBase plugin = cell.Row.Tag as PluginBase; + if (plugin == null) + return; - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - CheckBox checkBox = gridPlugins[row, ColTransmit] as CheckBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) + { + CheckBox checkBox = gridPlugins[row, ColTransmit] as CheckBox; - if (checkBox != null && checkBox.Checked == true && - !gridPlugins[row, ColName].DisplayText.Equals(plugin.Name, StringComparison.OrdinalIgnoreCase)) - checkBox.Checked = false; - } - } + if (checkBox != null && checkBox.Checked == true && + !gridPlugins[row, ColName].DisplayText.Equals(plugin.Name, StringComparison.OrdinalIgnoreCase)) + checkBox.Checked = false; + } + } - private void PluginDoubleClick(object sender, EventArgs e) - { - CellContext context = (CellContext)sender; - Cell cell = (Cell)context.Cell; + private void PluginDoubleClick(object sender, EventArgs e) + { + CellContext context = (CellContext)sender; + Cell cell = (Cell)context.Cell; - CheckBox checkBoxReceive = gridPlugins[cell.Row.Index, ColReceive] as CheckBox; - if (checkBoxReceive != null) - checkBoxReceive.Checked = true; + CheckBox checkBoxReceive = gridPlugins[cell.Row.Index, ColReceive] as CheckBox; + if (checkBoxReceive != null) + checkBoxReceive.Checked = true; - CheckBox checkBoxTransmit = gridPlugins[cell.Row.Index, ColTransmit] as CheckBox; - if (checkBoxTransmit != null) - checkBoxTransmit.Checked = true; - } + CheckBox checkBoxTransmit = gridPlugins[cell.Row.Index, ColTransmit] as CheckBox; + if (checkBoxTransmit != null) + checkBoxTransmit.Checked = true; + } - private void toolStripButtonDetect_Click(object sender, EventArgs e) - { - // TODO: Place on a seperate thread? - Detect(); - } + private void toolStripButtonDetect_Click(object sender, EventArgs e) + { + // TODO: Place on a seperate thread? + Detect(); + } - private void toolStripButtonAdvancedSettings_Click(object sender, EventArgs e) - { - Advanced(); - } + private void toolStripButtonAdvancedSettings_Click(object sender, EventArgs e) + { + Advanced(); + } - private void toolStripButtonHelp_Click(object sender, EventArgs e) - { - IrssHelp.Open(this); - } + private void toolStripButtonHelp_Click(object sender, EventArgs e) + { + IrssHelp.Open(this); + } - private void Config_HelpRequested(object sender, HelpEventArgs hlpevent) - { - IrssHelp.Open(sender); - } + private void Config_HelpRequested(object sender, HelpEventArgs hlpevent) + { + IrssHelp.Open(sender); + } - private void toolStripServiceButton_Click(object sender, EventArgs e) - { - toolStripServiceButton.Enabled = false; - if (Program._serviceInstalled == true) - Program.ServiceUninstall(); - else - Program.ServiceInstall(); + private void toolStripServiceButton_Click(object sender, EventArgs e) + { + toolStripServiceButton.Enabled = false; + if (Program._serviceInstalled == true) + Program.ServiceUninstall(); + else + Program.ServiceInstall(); - Program.getStatus(); - setButtons(); - toolStripServiceButton.Enabled = true; - } + Program.getStatus(); + setButtons(); + toolStripServiceButton.Enabled = true; + } - private void toolStripButtonService_Click(object sender, EventArgs e) - { - if (Program._irsStatus == IrsStatus.RunningService) - Program.ServiceStop(); - if (Program._irsStatus == IrsStatus.NotRunning) - Program.ServiceStart(); - } + private void toolStripButtonService_Click(object sender, EventArgs e) + { + if (Program._irsStatus == IrsStatus.RunningService) + Program.ServiceStop(); + if (Program._irsStatus == IrsStatus.NotRunning) + Program.ServiceStart(); + } - private void toolStripButtonApplication_Click(object sender, EventArgs e) - { - if (Program._irsStatus == IrsStatus.RunningApplication) - Program.ApplicationStop(); - if (Program._irsStatus == IrsStatus.NotRunning) - Program.ApplicationStart(); - } + private void toolStripButtonApplication_Click(object sender, EventArgs e) + { + if (Program._irsStatus == IrsStatus.RunningApplication) + Program.ApplicationStop(); + if (Program._irsStatus == IrsStatus.NotRunning) + Program.ApplicationStart(); + } - #endregion Controls + #endregion Controls - } + } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2009-09-10 11:28:34 UTC (rev 3083) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2009-09-10 15:33:42 UTC (rev 3084) @@ -40,705 +40,705 @@ namespace IRServer.Configuration { - #region Enumerations + #region Enumerations + /// <summary> + /// Describes the operation mode of IR Server. + /// </summary> + internal enum IRServerMode + { /// <summary> - /// Describes the operation mode of IR Server. + /// Acts as a standard Server (Default). /// </summary> - internal enum IRServerMode - { - /// <summary> - /// Acts as a standard Server (Default). - /// </summary> - ServerMode = 0, - /// <summary> - /// Relays button presses to another IR Server. - /// </summary> - RelayMode = 1, - /// <summary> - /// Acts as a repeater for another IR Server's blasting. - /// </summary> - RepeaterMode = 2, - } + ServerMode = 0, + /// <summary> + /// Relays button presses to another IR Server. + /// </summary> + RelayMode = 1, + /// <summary> + /// Acts as a repeater for another IR Server's blasting. + /// </summary> + RepeaterMode = 2, + } + /// <summary> + /// Describes the actual status of IR Server + /// </summary> + internal enum IrsStatus + { /// <summary> - /// Describes the actual status of IR Server + /// IR Server is not running. /// </summary> - internal enum IrsStatus - { - /// <summary> - /// IR Server is not running. - /// </summary> - NotRunning, - /// <summary> - /// IR Server is running as Service. - /// </summary> - RunningService, - /// <summary> - /// IR Server is running as Application. - /// </summary> - RunningApplication - } + NotRunning, + /// <summary> + /// IR Server is running as Service. + /// </summary> + RunningService, + /// <summary> + /// IR Server is running as Application. + /// </summary> + RunningApplication + } - #endregion Enumerations + #endregion Enumerations - internal static class Program - { - #region Constants + internal static class Program + { + #region Constants - internal const string ServerName = "IRServer"; - internal const string ServerWindowName = "IRSS - " + ServerName; - internal const string ServerDisplayName = "IR Server"; + internal const string ServerName = "IRServer"; + internal const string ServerWindowName = "IRSS - " + ServerName; + internal const string ServerDisplayName = "IR Server"; - private static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, @"IR Server\IR Server.xml"); - internal static readonly string IRServerFile = Path.Combine(Common.FolderProgramFiles, @"IR Server.exe"); + private static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, @"IR Server\IR Server.xml"); + internal static readonly string IRServerFile = Path.Combine(Common.FolderProgramFiles, @"IR Server.exe"); - internal static readonly Icon _iconGray = new Icon(Resources.iconGray, new Size(16, 16)); - internal static readonly Icon _iconGreen = new Icon(Resources.iconGreen, new Size(16, 16)); - private static readonly TimeSpan defaultServiceTime = new TimeSpan(0, 0, 30); + internal static readonly Icon _iconGray = new Icon(Resources.iconGray, new Size(16, 16)); + internal static readonly Icon _iconGreen = new Icon(Resources.iconGreen, new Size(16, 16)); + private static readonly TimeSpan defaultServiceTime = new TimeSpan(0, 0, 30); - #endregion Constants + #endregion Constants - #region Variables + #region Variables - private static bool _abstractRemoteMode; - private static string _hostComputer; - private static IRServerMode _mode; - private static string[] _pluginNameReceive; - private static string _pluginNameTransmit; - private static string _processPriority; - private static NotifyIcon _notifyIcon; - private static bool _inConfiguration; - private static Thread thread; - private static ServiceController serviceController; - private static ServiceController[] serviceControllers; - private static IntPtr irsWindow; - private static int waitCount; - internal static IrsStatus _irsStatus; - internal static bool _serviceInstalled; + private static bool _abstractRemoteMode; + private static string _hostComputer; + private static IRServerMode _mode; + private static string[] _pluginNameReceive; + private static string _pluginNameTransmit; + private static string _processPriority; + private static NotifyIcon _notifyIcon; + private static bool _inConfiguration; + private static Thread thread; + private static ServiceController serviceController; + private static ServiceController[] serviceControllers; + private static IntPtr irsWindow; + private static int waitCount; + internal static IrsStatus _irsStatus; + internal static bool _serviceInstalled; - #endregion Variables + #endregion Variables - #region Interops + #region Interops - [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] - internal static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); - [DllImport("user32.dll")] - internal static extern int SendMessage( - IntPtr hWnd, // handle to destination window - uint Msg, // message - long wParam, // first message parameter - long lParam // second message parameter - ); + [DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] + internal static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName); + [DllImport("user32.dll")] + internal static extern int SendMessage( + IntPtr hWnd, // handle to destination window + uint Msg, // message + long wParam, // first message parameter + long lParam // second message parameter + ); - #endregion Interops + #endregion Interops - /// <summary> - /// The main entry point for the application. - /// </summary> - [STAThread] - private static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(true); + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + private static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(true); - IrssLog.LogLevel = IrssLog.Level.Debug; - IrssLog.Open("IR Server Configuration.log"); + IrssLog.LogLevel = IrssLog.Level.Debug; + IrssLog.Open("IR Server Configuration.log"); - _notifyIcon = new NotifyIcon(); + _notifyIcon = new NotifyIcon(); - _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); - _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripLabel(ServerDisplayName)); - _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator()); - _notifyIcon.ContextMenuStrip.Items.Add("&Setup", null, OpenConfiguration); - _notifyIcon.ContextMenuStrip.Items.Add("&Quit", null, ClickQuit); - _notifyIcon.DoubleClick += new EventHandler(OpenConfiguration); - _notifyIcon.Icon = new System.Drawing.Icon(Resources.iconGray, new System.Drawing.Size(16, 16)); - _notifyIcon.Text = ServerDisplayName; - _notifyIcon.Visible = true; + _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); + _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripLabel(ServerDisplayName)); + _notifyIcon.ContextMenuStrip.Items.Add(new ToolStripSeparator()); + _notifyIcon.ContextMenuStrip.Items.Add("&Setup", null, OpenConfiguration); + _notifyIcon.ContextMenuStrip.Items.Add("&Quit", null, ClickQuit); + _notifyIcon.DoubleClick += new EventHandler(OpenConfiguration); + _notifyIcon.Icon = new System.Drawing.Icon(Resources.iconGray, new System.Drawing.Size(16, 16)); + _notifyIcon.Text = ServerDisplayName; + _notifyIcon.Visible = true; - thread = new Thread(new ThreadStart(UpdateIcon)); - thread.IsBackground = true; - thread.Start(); + thread = new Thread(new ThreadStart(UpdateIcon)); + thread.IsBackground = true; + thread.Start(); - Application.Run(); - thread.Abort(); - _notifyIcon.Visible = false; - _notifyIcon = null; - } + Application.Run(); + thread.Abort(); + _notifyIcon.Visible = false; + _notifyIcon = null; + } - private static void UpdateIcon() - { - while (thread != null && thread.IsAlive) - { - getStatus(); - _notifyIcon.Icon = getIcon(); - Thread.Sleep(1000); - } - } + private static void UpdateIcon() + { + while (thread != null && thread.IsAlive) + { + getStatus(); + _notifyIcon.Icon = getIcon(); + Thread.Sleep(1000); + } + } - internal static void getStatus() + internal static void getStatus() + { + _irsStatus = IrsStatus.NotRunning; + _serviceInstalled = false; + serviceControllers = ServiceController.GetServices(); + foreach (ServiceController serviceController in serviceControllers) + { + if (serviceController.ServiceName == ServerName) { - _irsStatus = IrsStatus.NotRunning; - _serviceInstalled = false; - serviceControllers = ServiceController.GetServices(); - foreach (ServiceController serviceController in serviceControllers) - { - if (serviceController.ServiceName == ServerName) - { - _serviceInstalled = true; - if (serviceController.Status == ServiceControllerStatus.Running) - _irsStatus = IrsStatus.RunningService; - } - } - - try - { - irsWindow = FindWindowByCaption(IntPtr.Zero, ServerWindowName); - if (irsWindow != IntPtr.Zero) - _irsStatus = IrsStatus.RunningApplication; - } - catch { } + _serviceInstalled = true; + if (serviceController.Status == ServiceControllerStatus.Running) + _irsStatus = IrsStatus.RunningService; } + } - private static Icon getIcon() - { - return (_irsStatus == IrsStatus.NotRunning) ? _iconGray : _iconGreen; - } + try + { + irsWindow = FindWindowByCaption(IntPtr.Zero, ServerWindowName); + if (irsWindow != IntPtr.Zero) + _irsStatus = IrsStatus.RunningApplication; + } + catch { } + } - private static void ClickQuit(object sender, EventArgs e) - { - Application.Exit(); - } + private static Icon getIcon() + { + return (_irsStatus == IrsStatus.NotRunning) ? _iconGray : _iconGreen; + } - private static void OpenConfiguration(object sender, EventArgs e) - { - if (_inConfiguration) - return; + private static void ClickQuit(object sender, EventArgs e) + { + Application.Exit(); + } - IrssLog.Info("Setup"); + private static void OpenConfiguration(object sender, EventArgs e) + { + if (_inConfiguration) + return; - LoadSettings(); + IrssLog.Info("Setup"); - Config config = new Config(); + LoadSettings(); - config.AbstractRemoteMode = _abstractRemoteMode; - config.Mode = _mode; - config.HostComputer = _hostComputer; - config.ProcessPriority = _processPriority; - config.PluginReceive = _pluginNameReceive; - config.PluginTransmit = _pluginNameTransmit; + Config config = new Config(); - _inConfiguration = true; + config.AbstractRemoteMode = _abstractRemoteMode; + config.Mode = _mode; + config.HostComputer = _hostComputer; + config.ProcessPriority = _processPriority; + config.PluginReceive = _pluginNameReceive; + config.PluginTransmit = _pluginNameTransmit; - if (config.ShowDialog() == DialogResult.OK) - { - if ((_abstractRemoteMode != config.AbstractRemoteMode) || - (_mode != config.Mode) || - (_hostComputer != config.HostComputer) || - (_processPriority != config.ProcessPriority) || - (_pluginNameReceive != config.PluginReceive) || - (_pluginNameTransmit != config.PluginTransmit)) - { - if ( - MessageBox.Show("IR Server will now be restarted for configuration changes to take effect", - "Restarting IR Server", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == - DialogResult.OK) - { - // Change settings ... - _abstractRemoteMode = config.AbstractRemoteMode; - _mode = config.Mode; - _hostComputer = config.HostComputer; - _processPriority = config.ProcessPriority; - _pluginNameReceive = config.PluginReceive; - _pluginNameTransmit = config.PluginTransmit; + _inConfiguration = true; - SaveSettings(); + if (config.ShowDialog() == DialogResult.OK) + { + if ((_abstractRemoteMode != config.AbstractRemoteMode) || + (_mode != config.Mode) || + (_hostComputer != config.HostComputer) || + (_processPriority != config.ProcessPriority) || + (_pluginNameReceive != config.PluginReceive) || + (_pluginNameTransmit != config.PluginTransmit)) + { + if ( + MessageBox.Show("IR Server will now be restarted for configuration changes to take effect", + "Restarting IR Server", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == + DialogResult.OK) + { + // Change settings ... + _abstractRemoteMode = config.AbstractRemoteMode; + _mode = config.Mode; + _hostComputer = config.HostComputer; + _processPriority = config.ProcessPriority; + _pluginNameReceive = config.PluginReceive; + _pluginNameTransmit = config.PluginTransmit; - // Restart IR Server ... - RestartIRS(); - } - else - { - IrssLog.Info("Canceled settings changes"); - } - } - } + SaveSettings(); - _inConfiguration = false; - - IrssLog.Close(); + // Restart IR Server ... + RestartIRS(); + } + else + { + IrssLog.Info("Canceled settings changes"); + } } + } - private static void LoadSettings() - { - IrssLog.Info("Loading settings ..."); + _inConfiguration = false; - _abstractRemoteMode = true; - _mode = IRServerMode.ServerMode; - _hostComputer = String.Empty; - _processPriority = "No Change"; - _pluginNameReceive = null; - _pluginNameTransmit = String.Empty; + IrssLog.Close(); + } - XmlDocument doc = new XmlDocument(); + private static void LoadSettings() + { + IrssLog.Info("Loading settings ..."); - try - { - doc.Load(ConfigurationFile); - } - catch (DirectoryNotFoundException) - { - IrssLog.Error("No configuration file found ({0}), folder not found! Creating default configuration file", - ConfigurationFile); + _abstractRemoteMode = true; + _mode = IRServerMode.ServerMode; + _hostComputer = String.Empty; + _processPriority = "No Change"; + _pluginNameReceive = null; + _pluginNameTransmit = String.Empty; - Directory.CreateDirectory(Path.GetDirectoryName(ConfigurationFile)); + XmlDocument doc = new XmlDocument(); - CreateDefaultSettings(); - return; - } - catch (FileNotFoundException) - { - IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); + try + { + doc.Load(ConfigurationFile); + } + catch (DirectoryNotFoundException) + { + IrssLog.Error("No configuration file found ({0}), folder not found! Creating default configuration file", + ConfigurationFile); - CreateDefaultSettings(); - return; - } - catch (Exception ex) - { - IrssLog.Error(ex); - return; - } + Directory.CreateDirectory(Path.GetDirectoryName(ConfigurationFile)); - try - { - _abstractRemoteMode = bool.Parse(doc.DocumentElement.Attributes["AbstractRemoteMode"].Value); - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } + CreateDefaultSettings(); + return; + } + catch (FileNotFoundException) + { + IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); - try - { - _mode = - (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } + CreateDefaultSettings(); + return; + } + catch (Exception ex) + { + IrssLog.Error(ex); + return; + } - try - { - _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } + try + { + _abstractRemoteMode = bool.Parse(doc.DocumentElement.Attributes["AbstractRemoteMode"].Value); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } - try - { - _processPriority = doc.DocumentElement.Attributes["ProcessPriority"].Value; - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } + try + { + _mode = + (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } - try - { - _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } + try + { + _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } - try - { - string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; - if (!String.IsNullOrEmpty(receivers)) - _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); - } - catch (Exception ex) - { - IrssLog.Warn(ex.ToString()); - } - } + try + { + _processPriority = doc.DocumentElement.Attributes["ProcessPriority"].Value; + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } - private static void SaveSettings() - { - IrssLog.Info("Saving settings ..."); + try + { + _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } - try - { - using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) - { - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("settings"); // <settings> + try + { + string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; + if (!String.IsNullOrEmpty(receivers)) + _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + } - writer.WriteAttributeString("AbstractRemoteMode", _abstractRemoteMode.ToString()); - writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); - writer.WriteAttributeString("HostComputer", _hostComputer); - writer.WriteAttributeString("ProcessPriority", _processPriority); - writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); + private static void SaveSettings() + { + IrssLog.Info("Saving settings ..."); - if (_pluginNameReceive != null) - { - StringBuilder receivers = new StringBuilder(); - for (int index = 0; index < _pluginNameReceive.Length; index++) - { - receivers.Append(_pluginNameReceive[index]); + try + { + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> - if (index < _pluginNameReceive.Length - 1) - receivers.Append(','); - } - writer.WriteAttributeString("PluginReceive", receivers.ToString()); - } - else - { - writer.WriteAttributeString("PluginReceive", String.Empty); - } + writer.WriteAttributeString("AbstractRemoteMode", _abstractRemoteMode.ToString()); + writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); + writer.WriteAttributeString("HostComputer", _hostComputer); + writer.WriteAttributeString("ProcessPriority", _processPriority); + writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); - ... [truncated message content] |
From: <che...@us...> - 2009-10-11 14:47:44
|
Revision: 3117 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3117&view=rev Author: chemelli_sf Date: 2009-10-11 14:47:37 +0000 (Sun, 11 Oct 2009) Log Message: ----------- - Custom HID plugin is available only is disabled in service mode - IRSS install path is taken from the application path instead of registry lookup - Minor cleanup Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs 2009-10-11 14:47:37 UTC (rev 3117) @@ -1472,7 +1472,7 @@ { IrssMessage response = new IrssMessage(MessageType.AvailableBlasters, MessageFlags.Response); - PluginBase[] plugins = Program.AvailablePlugins(); + PluginBase[] plugins = BasicFunctions.AvailablePlugins(); StringBuilder blasters = new StringBuilder(); for (int index = 0; index < plugins.Length; index++) @@ -1508,7 +1508,7 @@ { IrssMessage response = new IrssMessage(MessageType.AvailableReceivers, MessageFlags.Response); - PluginBase[] plugins = Program.AvailablePlugins(); + PluginBase[] plugins = BasicFunctions.AvailablePlugins(); StringBuilder receivers = new StringBuilder(); for (int index = 0; index < plugins.Length; index++) Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj 2009-10-11 14:47:37 UTC (rev 3117) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.21022</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{46F1DB42-F082-4200-B939-6E4B72A8117C}</ProjectGuid> <OutputType>WinExe</OutputType> @@ -19,6 +19,21 @@ <OldToolsVersion>2.0</OldToolsVersion> <UpgradeBackupLocation> </UpgradeBackupLocation> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -155,6 +170,33 @@ <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework Client Profile</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> + <Visible>False</Visible> + <ProductName>.NET Framework 2.0 %28x86%29</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.0"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.0 %28x86%29</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1</ProductName> + <Install>false</Install> + </BootstrapperPackage> + </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/IR Server Suite/IR Server Suite/IR Server/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Program.cs 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Program.cs 2009-10-11 14:47:37 UTC (rev 3117) @@ -30,6 +30,7 @@ using IRServer.Plugin; using IrssUtils; using System.Windows.Forms; +using IRServer.Plugin; namespace IRServer { @@ -58,106 +59,106 @@ try { - IrssLog.Open("IR Server.log"); + IrssLog.Open("IR Server.log"); - if (args.Length == 0) + if (args.Length == 0) + { + IRServer = new IRServer(); + if (IRServer.DoStart()) { - IRServer = new IRServer(); - if (IRServer.DoStart()) - { - ReceiverWindow receiverWindow = new ReceiverWindow(ServerWindowName); - Application.Run(); - receiverWindow.DestroyHandle(); - receiverWindow = null; - IRServer.DoStop(); - } + ReceiverWindow receiverWindow = new ReceiverWindow(ServerWindowName); + Application.Run(); + receiverWindow.DestroyHandle(); + receiverWindow = null; + IRServer.DoStop(); } - else + } + else + { + foreach (string parameter in args) { - foreach (string parameter in args) - { - switch (parameter.ToUpperInvariant().Replace("-", "/")) + switch (parameter.ToUpperInvariant().Replace("-", "/")) + { + case "/INSTALL": + IrssLog.Info("Installing IR Server ..."); + using (TransactedInstaller transactedInstaller = new TransactedInstaller()) + { + using (IRServerInstaller IRServerInstaller = new IRServerInstaller()) { - case "/INSTALL": - IrssLog.Info("Installing IR Server ..."); - using (TransactedInstaller transactedInstaller = new TransactedInstaller()) - { - using (IRServerInstaller IRServerInstaller = new IRServerInstaller()) - { - transactedInstaller.Installers.Add(IRServerInstaller); + transactedInstaller.Installers.Add(IRServerInstaller); - string path = "/assemblypath=" + Assembly.GetExecutingAssembly().Location; - string[] cmdline = { path }; + string path = "/assemblypath=" + Assembly.GetExecutingAssembly().Location; + string[] cmdline = { path }; - InstallContext installContext = new InstallContext(String.Empty, cmdline); - transactedInstaller.Context = installContext; + InstallContext installContext = new InstallContext(String.Empty, cmdline); + transactedInstaller.Context = installContext; - transactedInstaller.Install(new Hashtable()); - } - } - break; + transactedInstaller.Install(new Hashtable()); + } + } + break; - case "/UNINSTALL": - IrssLog.Info("Uninstalling IR Server ..."); - using (TransactedInstaller transactedInstaller = new TransactedInstaller()) - { - using (IRServerInstaller IRServerInstaller = new IRServerInstaller()) - { - transactedInstaller.Installers.Add(IRServerInstaller); + case "/UNINSTALL": + IrssLog.Info("Uninstalling IR Server ..."); + using (TransactedInstaller transactedInstaller = new TransactedInstaller()) + { + using (IRServerInstaller IRServerInstaller = new IRServerInstaller()) + { + transactedInstaller.Installers.Add(IRServerInstaller); - string path = "/assemblypath=" + Assembly.GetExecutingAssembly().Location; - string[] cmdline = { path }; + string path = "/assemblypath=" + Assembly.GetExecutingAssembly().Location; + string[] cmdline = { path }; - InstallContext installContext = new InstallContext(String.Empty, cmdline); - transactedInstaller.Context = installContext; + InstallContext installContext = new InstallContext(String.Empty, cmdline); + transactedInstaller.Context = installContext; - transactedInstaller.Uninstall(null); - } - } - break; + transactedInstaller.Uninstall(null); + } + } + break; - case "/START": - IrssLog.Info("Starting IR Server ..."); - using (ServiceController serviceController = new ServiceController(ServiceName)) - if (serviceController.Status == ServiceControllerStatus.Stopped) - serviceController.Start(); - break; + case "/START": + IrssLog.Info("Starting IR Server ..."); + using (ServiceController serviceController = new ServiceController(ServiceName)) + if (serviceController.Status == ServiceControllerStatus.Stopped) + serviceController.Start(); + break; - case "/STOP": - IrssLog.Info("Stopping IR Server ..."); - using (ServiceController serviceController = new ServiceController(ServiceName)) - if (serviceController.Status == ServiceControllerStatus.Running) - serviceController.Stop(); - break; + case "/STOP": + IrssLog.Info("Stopping IR Server ..."); + using (ServiceController serviceController = new ServiceController(ServiceName)) + if (serviceController.Status == ServiceControllerStatus.Running) + serviceController.Stop(); + break; - case "/RESTART": - IrssLog.Info("Restarting IR Server ..."); - using (ServiceController serviceController = new ServiceController(ServiceName)) - { - if (serviceController.Status == ServiceControllerStatus.Running) - serviceController.Stop(); + case "/RESTART": + IrssLog.Info("Restarting IR Server ..."); + using (ServiceController serviceController = new ServiceController(ServiceName)) + { + if (serviceController.Status == ServiceControllerStatus.Running) + serviceController.Stop(); - serviceController.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, 30)); + serviceController.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, 30)); - if (serviceController.Status == ServiceControllerStatus.Stopped) - serviceController.Start(); - } - break; + if (serviceController.Status == ServiceControllerStatus.Stopped) + serviceController.Start(); + } + break; - case "/SERVICE": - { - IRServer IRServer = new IRServer(); - ServiceBase.Run(IRServer); - } - break; + case "/SERVICE": + { + IRServer IRServer = new IRServer(); + ServiceBase.Run(IRServer); + } + break; - default: - throw new InvalidOperationException(String.Format("Unknown command line parameter \"{0}\"", parameter)); - } - } - - IrssLog.Info("Done."); + default: + throw new InvalidOperationException(String.Format("Unknown command line parameter \"{0}\"", parameter)); + } } + + IrssLog.Info("Done."); + } } catch (Exception ex) { @@ -169,56 +170,8 @@ } } + /// <summary> - /// Retreives a list of available IR Server plugins. - /// </summary> - /// <returns>Array of plugin instances.</returns> - internal static PluginBase[] AvailablePlugins() - { - List<PluginBase> plugins = new List<PluginBase>(); - - string installFolder = SystemRegistry.GetInstallFolder(); - if (String.IsNullOrEmpty(installFolder)) - return null; - - string path = Path.Combine(installFolder, "IR Server Plugins"); - string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); - - // TODO: Return a Type[], don't instantiate unless required - - foreach (string file in files) - { - try - { - Assembly assembly = Assembly.LoadFrom(file); - Type[] types = assembly.GetExportedTypes(); - - foreach (Type type in types) - { - if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof (PluginBase))) - { - PluginBase plugin = (PluginBase) assembly.CreateInstance(type.FullName); - - if (plugin != null) - plugins.Add(plugin); - } - } - } - catch (BadImageFormatException) - { - } // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins - catch (TypeLoadException) - { - } // Ignore Type Load Exceptions, just keep checking for IR Server Plugins - catch (FileNotFoundException) - { - } // Ignore File Not Found Exceptions, just keep checking for IR Server Plugins - } - - return plugins.ToArray(); - } - - /// <summary> /// Retreives a plugin instance given the plugin name. /// </summary> /// <param name="pluginName">Name of plugin to instantiate.</param> @@ -228,7 +181,7 @@ if (String.IsNullOrEmpty(pluginName)) throw new ArgumentNullException("pluginName"); - PluginBase[] serverPlugins = AvailablePlugins(); + PluginBase[] serverPlugins = BasicFunctions.AvailablePlugins(); if (serverPlugins == null) throw new FileNotFoundException("No available plugins found"); @@ -247,7 +200,7 @@ { IrssLog.Info("Detect Receivers ..."); - PluginBase[] plugins = AvailablePlugins(); + PluginBase[] plugins = BasicFunctions.AvailablePlugins(); if (plugins == null || plugins.Length == 0) return null; @@ -280,7 +233,7 @@ { IrssLog.Info("Detect Blasters ..."); - PluginBase[] plugins = AvailablePlugins(); + PluginBase[] plugins = BasicFunctions.AvailablePlugins(); if (plugins == null || plugins.Length == 0) return null; Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2009-10-11 14:47:37 UTC (rev 3117) @@ -432,7 +432,7 @@ try { - _transceivers = Program.AvailablePlugins(); + _transceivers = BasicFunctions.AvailablePlugins(); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2009-10-11 14:47:37 UTC (rev 3117) @@ -486,7 +486,7 @@ if (exitCode != 0) { IrssLog.Error("RunAdminHelper exitcode = " + exitCode); - MessageBox.Show("There occured an issue when trying to run AdminHelper." + Environment.NewLine + + MessageBox.Show("There occured an issue when trying to run AdminHelper." + Environment.NewLine + "Do you have administration rights?" + Environment.NewLine + "Did you accept the request for Administration rights?" + Environment.NewLine + Environment.NewLine + "If you think you did everything right, please report the issue to the devlopers.", @@ -592,56 +592,6 @@ } /// <summary> - /// Retreives a list of available IR Server plugins. - /// </summary> - /// <returns>Array of plugin instances.</returns> - internal static PluginBase[] AvailablePlugins() - { - List<PluginBase> plugins = new List<PluginBase>(); - - string installFolder = SystemRegistry.GetInstallFolder(); - if (String.IsNullOrEmpty(installFolder)) - return null; - - string path = Path.Combine(installFolder, "IR Server Plugins"); - string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); - - // TODO: Return a Type[], don't instantiate unless required - - foreach (string file in files) - { - try - { - Assembly assembly = Assembly.LoadFrom(file); - - Type[] types = assembly.GetExportedTypes(); - - foreach (Type type in types) - { - if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) - { - PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); - - if (plugin != null && plugin.Detect() != PluginBase.DetectionResult.DeviceDisabled) - plugins.Add(plugin); - } - } - } - catch (BadImageFormatException) - { - } // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins - catch (TypeLoadException) - { - } // Ignore Type Load Exceptions, just keep checking for IR Server Plugins - catch (FileNotFoundException) - { - } // Ignore File Not Found Exceptions, just keep checking for IR Server Plugins - } - - return plugins.ToArray(); - } - - /// <summary> /// Retreives a list of detected Receiver plugins. /// </summary> /// <returns>String array of plugin names.</returns> @@ -649,7 +599,7 @@ { IrssLog.Info("Detect Receivers ..."); - PluginBase[] plugins = AvailablePlugins(); + PluginBase[] plugins = BasicFunctions.AvailablePlugins(); if (plugins == null || plugins.Length == 0) return null; @@ -682,7 +632,7 @@ { IrssLog.Info("Detect Blasters ..."); - PluginBase[] plugins = AvailablePlugins(); + PluginBase[] plugins = BasicFunctions.AvailablePlugins(); if (plugins == null || plugins.Length == 0) return null; Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2009-10-11 14:47:37 UTC (rev 3117) @@ -28,6 +28,7 @@ using System.Windows.Forms; using System.Xml; using IRServer.Plugin.Properties; +using IrssUtils; namespace IRServer.Plugin { @@ -234,6 +235,16 @@ #endregion + public override DetectionResult Detect() + { + if (Environment.UserInteractive) + { + IrssLog.Error("{0,15}: not available on \"service\" installation mode", Name); + return DetectionResult.DeviceDisabled; + } + return DetectionResult.DevicePresent; + } + /// <summary> /// Start the IR Server plugin. /// </summary> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2009-10-11 14:47:37 UTC (rev 3117) @@ -83,6 +83,10 @@ <Compile Include="ReceiverWindow.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2009-10-11 14:47:37 UTC (rev 3117) @@ -69,6 +69,12 @@ <Compile Include="ITransmitIR.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</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/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2009-10-11 11:02:31 UTC (rev 3116) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2009-10-11 14:47:37 UTC (rev 3117) @@ -21,8 +21,12 @@ #endregion using System; +using System.Collections.Generic; using System.Drawing; using System.IO; +using System.Reflection; +using System.Windows.Forms; +using IrssUtils; namespace IRServer.Plugin { @@ -140,4 +144,56 @@ #endregion Methods } + + public class BasicFunctions + { + /// <summary> + /// Retreives a list of available IR Server plugins. + /// </summary> + /// <returns>Array of plugin instances.</returns> + public static PluginBase[] AvailablePlugins() + { + List<PluginBase> plugins = new List<PluginBase>(); + + string path = Path.Combine(Application.StartupPath, "IR Server Plugins"); + string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); + + // TODO: Return a Type[], don't instantiate unless required + + foreach (string file in files) + { + try + { + Assembly assembly = Assembly.LoadFrom(file); + + Type[] types = assembly.GetExportedTypes(); + + foreach (Type type in types) + { + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) + { + + PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); + + if (plugin != null && plugin.Detect() != PluginBase.DetectionResult.DeviceDisabled) + { + plugins.Add(plugin); + } + } + } + } + catch (BadImageFormatException) + { + } // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins + catch (TypeLoadException) + { + } // Ignore Type Load Exceptions, just keep checking for IR Server Plugins + catch (FileNotFoundException) + { + } // Ignore File Not Found Exceptions, just keep checking for IR Server Plugins + } + + return plugins.ToArray(); + } + } } \ 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: <be...@us...> - 2009-10-28 11:49:52
|
Revision: 3136 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3136&view=rev Author: belcom Date: 2009-10-28 11:49:24 +0000 (Wed, 28 Oct 2009) Log Message: ----------- - Improved iMON Front Panel support, added some buttons, code corrections. - Added XML description for detect() in Custom HID Receiver.cs because while debugging the "Warning as Error" was annoying. :) - Introduced a "retry loop" if command send to iMON fails. - Sometimes (XP?) devicePath gets reported as "\??\HID..." and will be corrected to "\\?\HID..." Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.csproj trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/TestApplication.cs Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml 2009-10-28 10:38:24 UTC (rev 3135) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml 2009-10-28 11:49:24 UTC (rev 3136) @@ -8,6 +8,7 @@ <RemoteTable RawCode="3015" AbstractButton="Start" /> <RemoteTable RawCode="3023" AbstractButton="Back" /> <RemoteTable RawCode="3045" AbstractButton="Info" /> + <RemoteTable RawCode="3044" AbstractButton="Home" /> <RemoteTable RawCode="3043" AbstractButton="Power" /> <RemoteTable RawCode="3002" AbstractButton="Play" /> <RemoteTable RawCode="3004" AbstractButton="Stop" /> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj 2009-10-28 10:38:24 UTC (rev 3135) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.csproj 2009-10-28 11:49:24 UTC (rev 3136) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{46F1DB42-F082-4200-B939-6E4B72A8117C}</ProjectGuid> <OutputType>WinExe</OutputType> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2009-10-28 10:38:24 UTC (rev 3135) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2009-10-28 11:49:24 UTC (rev 3136) @@ -235,6 +235,9 @@ #endregion + /// <summary> + /// Detect Custom HID Devices. + /// </summary> public override DetectionResult Detect() { if (Environment.UserInteractive) Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2009-10-28 10:38:24 UTC (rev 3135) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2009-10-28 11:49:24 UTC (rev 3136) @@ -1285,6 +1285,15 @@ rDevice.usUsage = details.Usage; rDevice.usUsagePage = details.UsagePage; RemoteDeviceName = details.ID; + + // on very rare systems RemoteDeviceName is reported wrong, no idea why. Lets change it! + if (RemoteDeviceName.StartsWith(@"\??\")) + { + DebugWriteLine("FindDevices_HID(): Changing to right RemoteDeviceName..."); + DebugWriteLine("FindDevices_HID(): reported RemoteDeviceName: \"{0}\"", RemoteDeviceName); + RemoteDeviceName = @"\\?\" + RemoteDeviceName.Substring(4); + DebugWriteLine("FindDevices_HID(): corrected RemoteDeviceName: \"{0}\"", RemoteDeviceName); + } } // check for keyboard device - MI_00&Col02# if (details.ID.Contains(HIDKeyboardSuffix)) @@ -1572,9 +1581,9 @@ } else if (newArray[8] == 0xEE) // Front panel buttons/volume knob { - if (newArray[4] != 0x00) + if (newArray[5] != 0x00) { - uint keyCode = IMON_PANEL_BUTTON + newArray[4]; + uint keyCode = IMON_PANEL_BUTTON + newArray[5]; RemoteEvent(keyCode, _remoteToggle != newArray[4]); } _remoteToggle = newArray[4]; Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.csproj 2009-10-28 10:38:24 UTC (rev 3135) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.csproj 2009-10-28 11:49:24 UTC (rev 3136) @@ -2,7 +2,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>9.0.30729</ProductVersion> + <ProductVersion>9.0.21022</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{EC37743A-64B2-472A-9EB6-CB052AD2B35C}</ProjectGuid> <OutputType>Library</OutputType> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/TestApplication.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/TestApplication.cs 2009-10-28 10:38:24 UTC (rev 3135) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/TestApplication.cs 2009-10-28 11:49:24 UTC (rev 3136) @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Windows.Forms; namespace IRServer.Plugin { @@ -196,7 +197,7 @@ DeviceType DevType; - iMonUSBReceivers device = new iMonUSBReceiver(); + iMonUSBReceivers device = new iMonUSBReceivers(); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2010-11-11 12:43:09
|
Revision: 3924 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3924&view=rev Author: chef_koch Date: 2010-11-11 12:43:03 +0000 (Thu, 11 Nov 2010) Log Message: ----------- finally making usage of hardwareMonitor: server plugins can optionally be restarted now, when a device has been connected Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.Designer.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs 2010-11-11 12:21:08 UTC (rev 3923) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs 2010-11-11 12:43:03 UTC (rev 3924) @@ -63,6 +63,10 @@ private List<ClientManager> _registeredRepeaters; private Server _server; + private HardwareMonitor hardwareMonitor; + private DateTime lastDeviceEvent = DateTime.MinValue; + private const int timeToWaitForRestart = 10000; + #endregion Variables #region Constructor @@ -201,6 +205,17 @@ #endregion Setup Abstract Remote Model processing + #region Setup Hardware Monitoring + + if (Settings.RestartOnUSBChanges) + { + hardwareMonitor = new HardwareMonitor(); + hardwareMonitor.DeviceConnected += new HardwareMonitor.HardwareMonitorEvent(OnDeviceConnected); + hardwareMonitor.Start(); + } + + #endregion + IrssLog.Info("IR Server started"); } @@ -211,6 +226,10 @@ { IrssLog.Info("Stopping IR Server ..."); + if (hardwareMonitor != null) + hardwareMonitor.Stop(); + hardwareMonitor = null; + if (Settings.Mode == IRServerMode.ServerMode) { try @@ -1688,6 +1707,34 @@ return true; } + #region Hardware Monitoring + + private void OnDeviceConnected() + { + Thread lazyRestartThread = new Thread(LazyRestart); + lazyRestartThread.Start(); + } + + private void LazyRestart() + { + DateTime tempLastDeviceEvent = DateTime.Now; + lastDeviceEvent = tempLastDeviceEvent; + + // wait, if new decice events occur + Thread.Sleep(timeToWaitForRestart); + + // if new device event occured, stop here + if (!tempLastDeviceEvent.Equals(lastDeviceEvent)) return; + + // restart service + IrssLog.Info("New device event. Restarting Input Service."); + StopPlugins(); + LoadPlugins(); + StartPlugins(); + } + + #endregion + #endregion Implementation #region Wrapper-Functions for Executing as Application Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.Designer.cs 2010-11-11 12:21:08 UTC (rev 3923) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.Designer.cs 2010-11-11 12:43:03 UTC (rev 3924) @@ -44,9 +44,12 @@ this.groupBoxPriority = new System.Windows.Forms.GroupBox(); this.labelPriority = new System.Windows.Forms.Label(); this.comboBoxPriority = new System.Windows.Forms.ComboBox(); + this.groupBoxHardwareMonitoring = new System.Windows.Forms.GroupBox(); + this.checkBoxRestartOnUSBChanges = new System.Windows.Forms.CheckBox(); this.groupBoxMode.SuspendLayout(); this.groupBoxAbstractRemoteModel.SuspendLayout(); this.groupBoxPriority.SuspendLayout(); + this.groupBoxHardwareMonitoring.SuspendLayout(); this.SuspendLayout(); // // groupBoxMode @@ -132,7 +135,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(328, 272); + this.buttonCancel.Location = new System.Drawing.Point(328, 318); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 4; @@ -143,7 +146,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(256, 272); + this.buttonOK.Location = new System.Drawing.Point(256, 318); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 3; @@ -223,13 +226,38 @@ this.comboBoxPriority.Size = new System.Drawing.Size(272, 21); this.comboBoxPriority.TabIndex = 1; // + // groupBoxHardwareMonitoring + // + this.groupBoxHardwareMonitoring.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxHardwareMonitoring.Controls.Add(this.checkBoxRestartOnUSBChanges); + this.groupBoxHardwareMonitoring.Location = new System.Drawing.Point(8, 262); + this.groupBoxHardwareMonitoring.Name = "groupBoxHardwareMonitoring"; + this.groupBoxHardwareMonitoring.Size = new System.Drawing.Size(384, 50); + this.groupBoxHardwareMonitoring.TabIndex = 5; + this.groupBoxHardwareMonitoring.TabStop = false; + this.groupBoxHardwareMonitoring.Text = "Hardware Monitoring"; + // + // checkBoxRestartOnUSBChanges + // + this.checkBoxRestartOnUSBChanges.AutoSize = true; + this.checkBoxRestartOnUSBChanges.Location = new System.Drawing.Point(16, 24); + this.checkBoxRestartOnUSBChanges.Name = "checkBoxRestartOnUSBChanges"; + this.checkBoxRestartOnUSBChanges.Size = new System.Drawing.Size(214, 17); + this.checkBoxRestartOnUSBChanges.TabIndex = 0; + this.checkBoxRestartOnUSBChanges.Text = "Restart IR Server on hardware changes"; + this.toolTips.SetToolTip(this.checkBoxRestartOnUSBChanges, "If enabled, IR Server will be automatically restarted if an USB device hase been " + + "connected or removed."); + this.checkBoxRestartOnUSBChanges.UseVisualStyleBackColor = true; + // // Advanced // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(400, 308); + this.ClientSize = new System.Drawing.Size(400, 354); + this.Controls.Add(this.groupBoxHardwareMonitoring); this.Controls.Add(this.groupBoxPriority); this.Controls.Add(this.groupBoxAbstractRemoteModel); this.Controls.Add(this.buttonCancel); @@ -246,6 +274,8 @@ this.groupBoxMode.PerformLayout(); this.groupBoxAbstractRemoteModel.ResumeLayout(false); this.groupBoxPriority.ResumeLayout(false); + this.groupBoxHardwareMonitoring.ResumeLayout(false); + this.groupBoxHardwareMonitoring.PerformLayout(); this.ResumeLayout(false); } @@ -267,5 +297,7 @@ private System.Windows.Forms.GroupBox groupBoxPriority; private System.Windows.Forms.ComboBox comboBoxPriority; private System.Windows.Forms.Label labelPriority; + private System.Windows.Forms.GroupBox groupBoxHardwareMonitoring; + private System.Windows.Forms.CheckBox checkBoxRestartOnUSBChanges; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.cs 2010-11-11 12:21:08 UTC (rev 3923) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Advanced.cs 2010-11-11 12:43:03 UTC (rev 3924) @@ -83,6 +83,12 @@ set { comboBoxPriority.SelectedItem = value; } } + public bool RestartOnUSBChanges + { + get { return checkBoxRestartOnUSBChanges.Checked; } + set { checkBoxRestartOnUSBChanges.Checked = value; } + } + #endregion Properties #region Constructor Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2010-11-11 12:21:08 UTC (rev 3923) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2010-11-11 12:43:03 UTC (rev 3924) @@ -58,6 +58,7 @@ private string _hostComputer = String.Empty; private IRServerMode _mode = IRServerMode.ServerMode; private string _processPriority = String.Empty; + private bool _restartOnUSBChanges = true; private BackgroundWorker monitorThread; #endregion Variables @@ -311,6 +312,7 @@ advanced.Mode = _mode; advanced.HostComputer = _hostComputer; advanced.ProcessPriority = _processPriority; + advanced.RestartOnUSBChanges = _restartOnUSBChanges; if (advanced.ShowDialog(this) == DialogResult.OK) { @@ -318,6 +320,7 @@ _mode = advanced.Mode; _hostComputer = advanced.HostComputer; _processPriority = advanced.ProcessPriority; + _restartOnUSBChanges = advanced.RestartOnUSBChanges; } } @@ -567,6 +570,7 @@ _mode = Settings.Mode; _hostComputer = Settings.HostComputer; _processPriority = Settings.ProcessPriority; + _restartOnUSBChanges = Settings.RestartOnUSBChanges; PluginReceive = Settings.PluginNameReceive; PluginTransmit = Settings.PluginNameTransmit; } @@ -577,6 +581,7 @@ (Settings.Mode != _mode) || (Settings.HostComputer != _hostComputer) || (Settings.ProcessPriority != _processPriority) || + (Settings.RestartOnUSBChanges != _restartOnUSBChanges) || (Settings.PluginNameReceive != PluginReceive) || (Settings.PluginNameTransmit != PluginTransmit)) { @@ -590,6 +595,7 @@ Settings.Mode = _mode; Settings.HostComputer = _hostComputer; Settings.ProcessPriority = _processPriority; + Settings.RestartOnUSBChanges = _restartOnUSBChanges; Settings.PluginNameReceive = PluginReceive; Settings.PluginNameTransmit = PluginTransmit; Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs 2010-11-11 12:21:08 UTC (rev 3923) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs 2010-11-11 12:43:03 UTC (rev 3924) @@ -20,6 +20,7 @@ public static IRServerMode Mode { get; set; } public static string HostComputer { get; set; } public static string ProcessPriority { get; set; } + public static bool RestartOnUSBChanges { get; set; } public static string[] PluginNameReceive { get; set; } public static string PluginNameTransmit { get; set; } @@ -34,6 +35,7 @@ Mode = IRServerMode.ServerMode; HostComputer = String.Empty; ProcessPriority = "No Change"; + RestartOnUSBChanges = true; PluginNameReceive = null; PluginNameTransmit = String.Empty; @@ -105,6 +107,15 @@ try { + RestartOnUSBChanges = bool.Parse(doc.DocumentElement.Attributes["RestartOnUSBChanges"].Value); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { PluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; } catch (Exception ex) @@ -145,6 +156,7 @@ writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), Mode)); writer.WriteAttributeString("HostComputer", HostComputer); writer.WriteAttributeString("ProcessPriority", ProcessPriority); + writer.WriteAttributeString("RestartOnUSBChanges", RestartOnUSBChanges.ToString()); writer.WriteAttributeString("PluginTransmit", PluginNameTransmit); if (PluginNameReceive != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2010-11-19 19:38:02
|
Revision: 3962 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3962&view=rev Author: chef_koch Date: 2010-11-19 19:37:55 +0000 (Fri, 19 Nov 2010) Log Message: ----------- moved restart code to IRShared added hardware monitor to ir tray, only available in app mode Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Shared.cs Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs 2010-11-19 15:51:30 UTC (rev 3961) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/IR Server.cs 2010-11-19 19:37:55 UTC (rev 3962) @@ -207,14 +207,15 @@ #endregion Setup Abstract Remote Model processing #region Setup Hardware Monitoring + + //// Restart is done onlyy in IRTray with AppMode + //if (Settings.RestartOnUSBChanges) + //{ + // _hardwareMonitor = new HardwareMonitor(); + // _hardwareMonitor.DeviceConnected += new HardwareMonitor.HardwareMonitorEvent(OnDeviceConnected); + // _hardwareMonitor.Start(); + //} - if (Settings.RestartOnUSBChanges) - { - _hardwareMonitor = new HardwareMonitor(); - _hardwareMonitor.DeviceConnected += new HardwareMonitor.HardwareMonitorEvent(OnDeviceConnected); - _hardwareMonitor.Start(); - } - #endregion IrssLog.Info("IR Server started"); Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2010-11-19 15:51:30 UTC (rev 3961) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Config.cs 2010-11-19 19:37:55 UTC (rev 3962) @@ -535,9 +535,9 @@ { toolStripServiceButton.Enabled = false; if (Shared._serviceInstalled == true) - Program.ServiceUninstall(); + Shared.ServiceUninstall(); else - Program.ServiceInstall(); + Shared.ServiceInstall(); Shared.getStatus(); setButtons(); @@ -547,17 +547,17 @@ private void toolStripButtonService_Click(object sender, EventArgs e) { if (Shared._irsStatus == IrsStatus.RunningService) - Program.ServiceStop(); + Shared.ServiceStop(); if (Shared._irsStatus == IrsStatus.NotRunning) - Program.ServiceStart(); + Shared.ServiceStart(); } private void toolStripButtonApplication_Click(object sender, EventArgs e) { if (Shared._irsStatus == IrsStatus.RunningApplication) - Program.ApplicationStop(); + Shared.ApplicationStop(); if (Shared._irsStatus == IrsStatus.NotRunning) - Program.ApplicationStart(); + Shared.ApplicationStart(); } #endregion Controls @@ -602,7 +602,7 @@ Settings.SaveSettings(); // Restart IR Server ... - Program.RestartIRS(); + Shared.RestartIRS(); } else { Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2010-11-19 15:51:30 UTC (rev 3961) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Configuration/Program.cs 2010-11-19 19:37:55 UTC (rev 3962) @@ -41,21 +41,6 @@ { internal static class Program { - #region Constants - - internal static readonly string IRServerFile = Path.Combine(Application.StartupPath, @"IR Server.exe"); - - private static readonly TimeSpan defaultServiceTime = new TimeSpan(0, 0, 30); - - #endregion Constants - - #region Variables - - private static ServiceController serviceController; - private static int waitCount; - - #endregion Variables - /// <summary> /// The main entry point for the application. /// </summary> @@ -76,175 +61,5 @@ IrssLog.Close(); } - - private static ServiceController getServiceController() - { - Shared.serviceControllers = ServiceController.GetServices(); - foreach (ServiceController sc in Shared.serviceControllers) - { - if (sc.ServiceName == Shared.ServerName) - return sc; - } - return null; - } - - internal static void ServiceInstall() - { - try - { - IrssLog.Info("Installing IR Server service"); - Process IRServer = Process.Start(Program.IRServerFile, "/INSTALL"); - IRServer.WaitForExit((int)defaultServiceTime.TotalMilliseconds); - IrssLog.Info("Installing IR Server service - done"); - } - catch (Exception ex) - { - IrssLog.Error("Installing IR Server service - failed (see following...)"); - IrssLog.Error(ex); - } - } - - internal static void ServiceUninstall() - { - try - { - IrssLog.Info("Uninstalling IR Server service"); - Process IRServer = Process.Start(Program.IRServerFile, "/UNINSTALL"); - IRServer.WaitForExit((int)defaultServiceTime.TotalMilliseconds); - IrssLog.Info("Uninstalling IR Server service - done"); - } - catch (Exception ex) - { - IrssLog.Error("Uninstalling IR Server service - failed (see following...)"); - IrssLog.Error(ex); - } - } - - internal static void ServiceStart() - { - try - { - serviceController = getServiceController(); - if (Shared.serviceControllers != null) - { - IrssLog.Info("Starting IR Server (service)"); - serviceController.Start(); - serviceController.WaitForStatus(ServiceControllerStatus.Running, defaultServiceTime); - IrssLog.Info("Starting IR Server (service) - done"); - } - } - catch (TimeoutException ex) - { - IrssLog.Error("Starting IR Server (service) - failed (timeout error)"); - IrssLog.Error(ex); - } - catch (Exception ex) - { - IrssLog.Error("Starting IR Server (service) - failed (see following...)"); - IrssLog.Error(ex); - } - } - - internal static void ServiceStop() - { - try - { - serviceController = getServiceController(); - if (Shared.serviceControllers != null) - { - IrssLog.Info("Stopping IR Server (service)"); - serviceController.Stop(); - serviceController.WaitForStatus(ServiceControllerStatus.Stopped, defaultServiceTime); - IrssLog.Info("Stopping IR Server (service) - done"); - } - } - catch (TimeoutException ex) - { - IrssLog.Error("Stopping IR Server (service) - failed (timeout error)"); - IrssLog.Error(ex); - } - catch (Exception ex) - { - IrssLog.Error("Stopping IR Server (service) - failed (see following...)"); - IrssLog.Error(ex); - } - } - - internal static void ApplicationStart() - { - try - { - IrssLog.Info("Starting IR Server (application)"); - Process IRServer = Process.Start(IRServerFile); - waitCount = 0; - while (Win32.FindWindowByTitle(Shared.ServerWindowName) == IntPtr.Zero) - { - waitCount++; - if (waitCount > 150) throw new TimeoutException(); - Thread.Sleep(200); - } - IrssLog.Info("Starting IR Server (application) - done"); - } - catch (TimeoutException ex) - { - IrssLog.Error("Starting IR Server (application) - failed (timeout error)"); - IrssLog.Error(ex); - } - catch (Exception ex) - { - IrssLog.Error("Starting IR Server (application) - failed (see following...)"); - IrssLog.Error(ex); - } - } - - internal static void ApplicationStop() - { - try - { - IrssLog.Info("Stopping IR Server (application)"); - IntPtr irssWindow = Win32.FindWindowByTitle(Shared.ServerWindowName); - IntPtr result = Win32.SendWindowsMessage(irssWindow, 16, 0, 0); - waitCount = 0; - while (Win32.FindWindowByTitle(Shared.ServerWindowName) != IntPtr.Zero) - { - waitCount++; - if (waitCount > 150) throw new TimeoutException(); - Thread.Sleep(200); - } - IrssLog.Info("Stopping IR Server (application) - done"); - } - catch (TimeoutException ex) - { - IrssLog.Error("Stopping IR Server (application) - failed (timeout error)"); - IrssLog.Error(ex); - } - catch (Exception ex) - { - IrssLog.Error("Stopping IR Server (application) - failed (see following...)"); - IrssLog.Error(ex); - } - } - - internal static void RestartIRS() - { - IrssLog.Info("Restarting IR Server"); - - switch (Shared._irsStatus) - { - case IrsStatus.RunningService: - { - ServiceStop(); - ServiceStart(); - break; - } - case IrsStatus.RunningApplication: - { - ApplicationStop(); - ApplicationStart(); - break; - } - } - IrssLog.Info("Restarting IR Server - done"); - } } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs 2010-11-19 15:51:30 UTC (rev 3961) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs 2010-11-19 19:37:55 UTC (rev 3962) @@ -18,6 +18,8 @@ private static readonly string _translatorExe = Path.Combine(Application.StartupPath, @"Translator.exe"); private static readonly string _debugClientExe = Path.Combine(Application.StartupPath, @"DebugClient.exe"); + private const int TimeToWaitForRestart = 10000; + #endregion Constants #region Variables @@ -28,6 +30,9 @@ internal static readonly Icon _iconGray = new Icon(Resources.iconGray, new Size(16, 16)); internal static readonly Icon _iconGreen = new Icon(Resources.iconGreen, new Size(16, 16)); + private static HardwareMonitor _hardwareMonitor; + private static DateTime _lastDeviceEvent = DateTime.MinValue; + #endregion Variables /// <summary> @@ -62,6 +67,14 @@ _notifyIcon.Text = Shared.ServerDisplayName; _notifyIcon.Visible = true; + Settings.LoadSettings(); + if (Settings.RestartOnUSBChanges) + { + _hardwareMonitor = new HardwareMonitor(); + _hardwareMonitor.DeviceConnected += new HardwareMonitor.HardwareMonitorEvent(OnDeviceConnected); + _hardwareMonitor.Start(); + } + thread = new Thread(new ThreadStart(UpdateIcon)); thread.IsBackground = true; thread.Start(); @@ -121,5 +134,32 @@ } #endregion + + #region Hardware Monitoring + + private static void OnDeviceConnected() + { + Thread lazyRestartThread = new Thread(LazyRestart); + lazyRestartThread.Start(); + } + + private static void LazyRestart() + { + DateTime tempLastDeviceEvent = DateTime.Now; + _lastDeviceEvent = tempLastDeviceEvent; + + // wait, if new decice events occur + Thread.Sleep(TimeToWaitForRestart); + + // if new device event occured, stop here + if (!tempLastDeviceEvent.Equals(_lastDeviceEvent)) return; + + // restart service + IrssLog.Info("New device event. Restarting Input Service."); + Shared.ApplicationStop(); + Shared.ApplicationStart(); + } + + #endregion } } Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Shared.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Shared.cs 2010-11-19 15:51:30 UTC (rev 3961) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Shared.cs 2010-11-19 19:37:55 UTC (rev 3962) @@ -1,8 +1,13 @@ using System; using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; using System.ServiceProcess; +using System.Threading; using IRServer.Plugin; using IrssUtils; +using TimeoutException = System.ServiceProcess.TimeoutException; namespace IRServer { @@ -52,14 +57,22 @@ { #region Constants + public static readonly string IRServerFile = Path.Combine( + Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase), @"IR Server.exe"); + public const string ServerName = "IRServer"; public const string ServerWindowName = "IRSS - " + ServerName; public const string ServerDisplayName = "IR Server"; + private static readonly TimeSpan defaultServiceTime = new TimeSpan(0, 0, 30); + #endregion #region Variables + private static ServiceController serviceController; + private static int waitCount; + public static ServiceController[] serviceControllers; private static IntPtr irsWindow; @@ -68,6 +81,180 @@ #endregion + #region Start / Stop App / Service + + private static ServiceController getServiceController() + { + Shared.serviceControllers = ServiceController.GetServices(); + foreach (ServiceController sc in Shared.serviceControllers) + { + if (sc.ServiceName == Shared.ServerName) + return sc; + } + return null; + } + + public static void ServiceInstall() + { + try + { + IrssLog.Info("Installing IR Server service"); + Process IRServer = Process.Start(Shared.IRServerFile, "/INSTALL"); + IRServer.WaitForExit((int)defaultServiceTime.TotalMilliseconds); + IrssLog.Info("Installing IR Server service - done"); + } + catch (Exception ex) + { + IrssLog.Error("Installing IR Server service - failed (see following...)"); + IrssLog.Error(ex); + } + } + + public static void ServiceUninstall() + { + try + { + IrssLog.Info("Uninstalling IR Server service"); + Process IRServer = Process.Start(Shared.IRServerFile, "/UNINSTALL"); + IRServer.WaitForExit((int)defaultServiceTime.TotalMilliseconds); + IrssLog.Info("Uninstalling IR Server service - done"); + } + catch (Exception ex) + { + IrssLog.Error("Uninstalling IR Server service - failed (see following...)"); + IrssLog.Error(ex); + } + } + + public static void ServiceStart() + { + try + { + serviceController = getServiceController(); + if (Shared.serviceControllers != null) + { + IrssLog.Info("Starting IR Server (service)"); + serviceController.Start(); + serviceController.WaitForStatus(ServiceControllerStatus.Running, defaultServiceTime); + IrssLog.Info("Starting IR Server (service) - done"); + } + } + catch (TimeoutException ex) + { + IrssLog.Error("Starting IR Server (service) - failed (timeout error)"); + IrssLog.Error(ex); + } + catch (Exception ex) + { + IrssLog.Error("Starting IR Server (service) - failed (see following...)"); + IrssLog.Error(ex); + } + } + + public static void ServiceStop() + { + try + { + serviceController = getServiceController(); + if (Shared.serviceControllers != null) + { + IrssLog.Info("Stopping IR Server (service)"); + serviceController.Stop(); + serviceController.WaitForStatus(ServiceControllerStatus.Stopped, defaultServiceTime); + IrssLog.Info("Stopping IR Server (service) - done"); + } + } + catch (TimeoutException ex) + { + IrssLog.Error("Stopping IR Server (service) - failed (timeout error)"); + IrssLog.Error(ex); + } + catch (Exception ex) + { + IrssLog.Error("Stopping IR Server (service) - failed (see following...)"); + IrssLog.Error(ex); + } + } + + public static void RestartIRS() + { + IrssLog.Info("Restarting IR Server"); + + switch (Shared._irsStatus) + { + case IrsStatus.RunningService: + { + ServiceStop(); + ServiceStart(); + break; + } + case IrsStatus.RunningApplication: + { + ApplicationStop(); + ApplicationStart(); + break; + } + } + IrssLog.Info("Restarting IR Server - done"); + } + + public static void ApplicationStart() + { + try + { + IrssLog.Info("Starting IR Server (application)"); + Process IRServer = Process.Start(IRServerFile); + waitCount = 0; + while (Win32.FindWindowByTitle(Shared.ServerWindowName) == IntPtr.Zero) + { + waitCount++; + if (waitCount > 150) throw new TimeoutException(); + Thread.Sleep(200); + } + IrssLog.Info("Starting IR Server (application) - done"); + } + catch (TimeoutException ex) + { + IrssLog.Error("Starting IR Server (application) - failed (timeout error)"); + IrssLog.Error(ex); + } + catch (Exception ex) + { + IrssLog.Error("Starting IR Server (application) - failed (see following...)"); + IrssLog.Error(ex); + } + } + + public static void ApplicationStop() + { + try + { + IrssLog.Info("Stopping IR Server (application)"); + IntPtr irssWindow = Win32.FindWindowByTitle(ServerWindowName); + IntPtr result = Win32.SendWindowsMessage(irssWindow, 16, 0, 0); + waitCount = 0; + while (Win32.FindWindowByTitle(ServerWindowName) != IntPtr.Zero) + { + waitCount++; + if (waitCount > 150) throw new TimeoutException(); + Thread.Sleep(200); + } + IrssLog.Info("Stopping IR Server (application) - done"); + } + catch (TimeoutException ex) + { + IrssLog.Error("Stopping IR Server (application) - failed (timeout error)"); + IrssLog.Error(ex); + } + catch (Exception ex) + { + IrssLog.Error("Stopping IR Server (application) - failed (see following...)"); + IrssLog.Error(ex); + } + } + + #endregion + #region detect hardware /// <summary> @@ -138,7 +325,7 @@ #endregion - #region + #region getstatus public static void getStatus() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2010-11-24 12:13:48
|
Revision: 3973 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3973&view=rev Author: chef_koch Date: 2010-11-24 12:13:42 +0000 (Wed, 24 Nov 2010) Log Message: ----------- added separate setting for monitoring in tray Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs 2010-11-24 09:32:55 UTC (rev 3972) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server Tray/Program.cs 2010-11-24 12:13:42 UTC (rev 3973) @@ -72,7 +72,7 @@ _notifyIcon.Visible = true; Settings.LoadSettings(); - if (Settings.RestartOnUSBChanges) + if (Settings.RestartOnUSBChangesTray) { _hardwareMonitor = new HardwareMonitor(); _hardwareMonitor.DeviceConnected += new HardwareMonitor.HardwareMonitorEvent(OnDeviceConnected); @@ -86,8 +86,11 @@ Application.Run(); thread.Abort(); - _hardwareMonitor.Stop(); - _hardwareMonitor = null; + if (Settings.RestartOnUSBChangesTray) + { + _hardwareMonitor.Stop(); + _hardwareMonitor = null; + } _notifyIcon.Visible = false; _notifyIcon = null; Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs 2010-11-24 09:32:55 UTC (rev 3972) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IRServer.Shared/Settings.cs 2010-11-24 12:13:42 UTC (rev 3973) @@ -20,9 +20,10 @@ public static IRServerMode Mode { get; set; } public static string HostComputer { get; set; } public static string ProcessPriority { get; set; } - public static bool RestartOnUSBChanges { get; set; } public static string[] PluginNameReceive { get; set; } public static string PluginNameTransmit { get; set; } + public static bool RestartOnUSBChanges { get; set; } + public static bool RestartOnUSBChangesTray { get; set; } /// <summary> /// Loads settings from XML-File to <see cref="Settings"/> class. @@ -35,10 +36,12 @@ Mode = IRServerMode.ServerMode; HostComputer = String.Empty; ProcessPriority = "No Change"; - RestartOnUSBChanges = false; PluginNameReceive = null; PluginNameTransmit = String.Empty; + RestartOnUSBChanges = false; + RestartOnUSBChangesTray = false; + XmlDocument doc = new XmlDocument(); try @@ -116,6 +119,15 @@ try { + RestartOnUSBChangesTray = bool.Parse(doc.DocumentElement.Attributes["RestartOnUSBChangesTray"].Value); + } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } + + try + { PluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; } catch (Exception ex) @@ -157,6 +169,7 @@ writer.WriteAttributeString("HostComputer", HostComputer); writer.WriteAttributeString("ProcessPriority", ProcessPriority); writer.WriteAttributeString("RestartOnUSBChanges", RestartOnUSBChanges.ToString()); + writer.WriteAttributeString("RestartOnUSBChangesTray", RestartOnUSBChangesTray.ToString()); writer.WriteAttributeString("PluginTransmit", PluginNameTransmit); if (PluginNameReceive != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2011-05-03 19:42:58
|
Revision: 4202 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4202&view=rev Author: chemelli_sf Date: 2011-05-03 19:42:52 +0000 (Tue, 03 May 2011) Log Message: ----------- Added support for latest "iMon ultrabay kit" Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Volume Knob.xml trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Navigation Knob.xml Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml 2011-05-03 19:39:22 UTC (rev 4201) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Front Panel.xml 2011-05-03 19:42:52 UTC (rev 4202) @@ -4,13 +4,13 @@ <RemoteTable RawCode="3019" AbstractButton="Down" /> <RemoteTable RawCode="3020" AbstractButton="Left" /> <RemoteTable RawCode="3021" AbstractButton="Right" /> - <RemoteTable RawCode="3022" AbstractButton="OK" /> <RemoteTable RawCode="3015" AbstractButton="Start" /> <RemoteTable RawCode="3023" AbstractButton="Back" /> <RemoteTable RawCode="3045" AbstractButton="Info" /> <RemoteTable RawCode="3044" AbstractButton="Home" /> <RemoteTable RawCode="3043" AbstractButton="Power" /> <RemoteTable RawCode="3002" AbstractButton="Play" /> + <RemoteTable RawCode="3060" AbstractButton="PlayPause" /> <RemoteTable RawCode="3004" AbstractButton="Stop" /> <RemoteTable RawCode="3008" AbstractButton="FastForward" /> <RemoteTable RawCode="3007" AbstractButton="Rewind" /> Added: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Navigation Knob.xml =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Navigation Knob.xml (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Navigation Knob.xml 2011-05-03 19:42:52 UTC (rev 4202) @@ -0,0 +1,6 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="4011" AbstractButton="Up" /> + <RemoteTable RawCode="4012" AbstractButton="Down" /> + <RemoteTable RawCode="3061" AbstractButton="OK" /> +</DocumentElement> Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Volume Knob.xml =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Volume Knob.xml 2011-05-03 19:39:22 UTC (rev 4201) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server/IR Server/Abstract Remote Maps/iMon USB/Imon Volume Knob.xml 2011-05-03 19:42:52 UTC (rev 4202) @@ -1,5 +1,6 @@ <?xml version="1.0" standalone="yes"?> <DocumentElement> + <RemoteTable RawCode="3001" AbstractButton="Mute" /> <RemoteTable RawCode="4001" AbstractButton="VolumeUp" /> <RemoteTable RawCode="4002" AbstractButton="VolumeDown" /> </DocumentElement> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2011-05-03 19:39:22 UTC (rev 4201) +++ trunk/plugins/IR Server Suite/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2011-05-03 19:42:52 UTC (rev 4202) @@ -110,6 +110,8 @@ private const uint IMON_PANEL_BUTTON = 3000; private const uint IMON_VOLUME_DOWN = 4002; private const uint IMON_VOLUME_UP = 4001; + private const uint IMON_NAVIGATION_DOWN = 4012; + private const uint IMON_NAVIGATION_UP = 4011; private static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "iMon USB Receivers.xml"); @@ -356,7 +358,8 @@ "Vid_15c2&Pid_003c", "Vid_15c2&Pid_0038", "Vid_15c2&Pid_0036", - "Vid_15c2&Pid_0035" + "Vid_15c2&Pid_0035", + "Vid_15c2&Pid_0039" }; private RawInput.RAWINPUTDEVICE[] _deviceTree; @@ -1602,6 +1605,10 @@ RemoteEvent(IMON_VOLUME_DOWN, true); if (newArray[2] == 0x01) RemoteEvent(IMON_VOLUME_UP, true); + if (newArray[4] == 0x01) + RemoteEvent(IMON_NAVIGATION_UP, true); + if (newArray[3] == 0x01) + RemoteEvent(IMON_NAVIGATION_DOWN, true); } else if ((newArray[1] & 0xFC) == 0x68) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |