diff --git a/VAR.Toolbox/Code/DirectShow/IAMCameraControl.cs b/VAR.Toolbox/Code/DirectShow/IAMCameraControl.cs index f62b58a..a88ce2a 100644 --- a/VAR.Toolbox/Code/DirectShow/IAMCameraControl.cs +++ b/VAR.Toolbox/Code/DirectShow/IAMCameraControl.cs @@ -8,8 +8,8 @@ /// or shutter speed. To obtain this interface, query the filter that controls the camera. /// [ComImport, - Guid( "C6E13370-30AC-11d0-A18C-00A0C9118956" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("C6E13370-30AC-11d0-A18C-00A0C9118956"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IAMCameraControl { /// diff --git a/VAR.Toolbox/Code/DirectShow/IAMCrossbar.cs b/VAR.Toolbox/Code/DirectShow/IAMCrossbar.cs index faef3fe..50de5f1 100644 --- a/VAR.Toolbox/Code/DirectShow/IAMCrossbar.cs +++ b/VAR.Toolbox/Code/DirectShow/IAMCrossbar.cs @@ -7,8 +7,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The IAMCrossbar interface routes signals from an analog or digital source to a video capture filter. /// [ComImport, System.Security.SuppressUnmanagedCodeSecurity, - Guid( "C6E13380-30AC-11D0-A18C-00A0C9118956" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("C6E13380-30AC-11D0-A18C-00A0C9118956"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IAMCrossbar { /// @@ -21,8 +21,8 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_PinCounts( [Out] out int outputPinCount, [Out] out int inputPinCount ); - + int get_PinCounts([Out] out int outputPinCount, [Out] out int inputPinCount); + /// /// Queries whether a specified input pin can be routed to a specified output pin. /// @@ -33,7 +33,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int CanRoute( [In] int outputPinIndex, [In] int inputPinIndex ); + int CanRoute([In] int outputPinIndex, [In] int inputPinIndex); /// /// Routes an input pin to an output pin. @@ -45,7 +45,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Route( [In] int outputPinIndex, [In] int inputPinIndex ); + int Route([In] int outputPinIndex, [In] int inputPinIndex); /// /// Retrieves the input pin that is currently routed to the specified output pin. @@ -57,7 +57,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_IsRoutedTo( [In] int outputPinIndex, [Out] out int inputPinIndex ); + int get_IsRoutedTo([In] int outputPinIndex, [Out] out int inputPinIndex); /// /// Retrieves information about a specified pin. @@ -72,9 +72,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int get_CrossbarPinInfo( - [In, MarshalAs( UnmanagedType.Bool )] bool isInputPin, + [In, MarshalAs(UnmanagedType.Bool)] bool isInputPin, [In] int pinIndex, [Out] out int pinIndexRelated, - [Out] out PhysicalConnectorType physicalType ); + [Out] out PhysicalConnectorType physicalType); } } diff --git a/VAR.Toolbox/Code/DirectShow/IAMStreamConfig.cs b/VAR.Toolbox/Code/DirectShow/IAMStreamConfig.cs index d14e163..f8230dd 100644 --- a/VAR.Toolbox/Code/DirectShow/IAMStreamConfig.cs +++ b/VAR.Toolbox/Code/DirectShow/IAMStreamConfig.cs @@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "C6E13340-30AC-11d0-A18C-00A0C9118956" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("C6E13340-30AC-11d0-A18C-00A0C9118956"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IAMStreamConfig { /// @@ -22,7 +22,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetFormat( [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int SetFormat([In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Retrieves the audio or video stream's format. @@ -33,7 +33,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetFormat( [Out, MarshalAs( UnmanagedType.LPStruct )] out AMMediaType mediaType ); + int GetFormat([Out, MarshalAs(UnmanagedType.LPStruct)] out AMMediaType mediaType); /// /// Retrieve the number of format capabilities that this pin supports. @@ -45,7 +45,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetNumberOfCapabilities( out int count, out int size ); + int GetNumberOfCapabilities(out int count, out int size); /// /// Retrieve a set of format capabilities. @@ -60,8 +60,8 @@ namespace VAR.Toolbox.Code.DirectShow [PreserveSig] int GetStreamCaps( [In] int index, - [Out, MarshalAs( UnmanagedType.LPStruct )] out AMMediaType mediaType, - [In, MarshalAs( UnmanagedType.LPStruct )] VideoStreamConfigCaps streamConfigCaps + [Out, MarshalAs(UnmanagedType.LPStruct)] out AMMediaType mediaType, + [In, MarshalAs(UnmanagedType.LPStruct)] VideoStreamConfigCaps streamConfigCaps ); } } diff --git a/VAR.Toolbox/Code/DirectShow/IAMVideoControl.cs b/VAR.Toolbox/Code/DirectShow/IAMVideoControl.cs index b15e655..d183d59 100644 --- a/VAR.Toolbox/Code/DirectShow/IAMVideoControl.cs +++ b/VAR.Toolbox/Code/DirectShow/IAMVideoControl.cs @@ -9,8 +9,8 @@ /// /// [ComImport, - Guid( "6A2E0670-28E4-11D0-A18c-00A0C9118956" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("6A2E0670-28E4-11D0-A18c-00A0C9118956"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IAMVideoControl { /// @@ -23,7 +23,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetCaps( [In] IPin pin, [Out, MarshalAs( UnmanagedType.I4 )] out VideoControlFlags flags ); + int GetCaps([In] IPin pin, [Out, MarshalAs(UnmanagedType.I4)] out VideoControlFlags flags); /// /// Sets the video control mode of operation. @@ -35,7 +35,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int SetMode( [In] IPin pin, [In, MarshalAs( UnmanagedType.I4 )] VideoControlFlags mode ); + int SetMode([In] IPin pin, [In, MarshalAs(UnmanagedType.I4)] VideoControlFlags mode); /// /// Retrieves the video control mode of operation. @@ -47,7 +47,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetMode( [In] IPin pin, [Out, MarshalAs( UnmanagedType.I4 )] out VideoControlFlags mode ); + int GetMode([In] IPin pin, [Out, MarshalAs(UnmanagedType.I4)] out VideoControlFlags mode); /// /// The method retrieves the actual frame rate, expressed as a frame duration in 100-nanosecond units. @@ -61,8 +61,8 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetCurrentActualFrameRate( [In] IPin pin, [Out, MarshalAs( UnmanagedType.I8 )] out long actualFrameRate ); - + int GetCurrentActualFrameRate([In] IPin pin, [Out, MarshalAs(UnmanagedType.I8)] out long actualFrameRate); + /// /// Retrieves the maximum frame rate currently available based on bus bandwidth usage for connections /// such as USB and IEEE 1394 camera devices where the maximum frame rate can be limited by bandwidth @@ -78,9 +78,9 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetMaxAvailableFrameRate( [In] IPin pin, [In] int index, + int GetMaxAvailableFrameRate([In] IPin pin, [In] int index, [In] System.Drawing.Size dimensions, - [Out] out long maxAvailableFrameRate ); + [Out] out long maxAvailableFrameRate); /// /// Retrieves a list of available frame rates. @@ -96,9 +96,9 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetFrameRateList( [In] IPin pin, [In] int index, + int GetFrameRateList([In] IPin pin, [In] int index, [In] System.Drawing.Size dimensions, [Out] out int listSize, - [Out] out IntPtr frameRate ); + [Out] out IntPtr frameRate); } } diff --git a/VAR.Toolbox/Code/DirectShow/IBaseFilter.cs b/VAR.Toolbox/Code/DirectShow/IBaseFilter.cs index 42d1d92..0491d97 100644 --- a/VAR.Toolbox/Code/DirectShow/IBaseFilter.cs +++ b/VAR.Toolbox/Code/DirectShow/IBaseFilter.cs @@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A86895-0AD4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A86895-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IBaseFilter { // --- IPersist Methods @@ -24,7 +24,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetClassID( [Out] out Guid ClassID ); + int GetClassID([Out] out Guid ClassID); // --- IMediaFilter Methods @@ -35,7 +35,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Stop( ); + int Stop(); /// /// Pauses the filter. @@ -44,7 +44,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Pause( ); + int Pause(); /// /// Runs the filter. @@ -55,7 +55,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Run( long start ); + int Run(long start); /// /// Retrieves the state of the filter (running, stopped, or paused). @@ -67,7 +67,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetState( int milliSecsTimeout, [Out] out int filterState ); + int GetState(int milliSecsTimeout, [Out] out int filterState); /// /// Sets the reference clock for the filter or the filter graph. @@ -78,7 +78,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetSyncSource( [In] IntPtr clock ); + int SetSyncSource([In] IntPtr clock); /// /// Retrieves the current reference clock. @@ -89,7 +89,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetSyncSource( [Out] out IntPtr clock ); + int GetSyncSource([Out] out IntPtr clock); // --- IBaseFilter Methods @@ -102,7 +102,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EnumPins( [Out] out IEnumPins enumPins ); + int EnumPins([Out] out IEnumPins enumPins); /// /// Retrieves the pin with the specified identifier. @@ -114,7 +114,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int FindPin( [In, MarshalAs( UnmanagedType.LPWStr )] string id, [Out] out IPin pin ); + int FindPin([In, MarshalAs(UnmanagedType.LPWStr)] string id, [Out] out IPin pin); /// /// Retrieves information about the filter. @@ -125,7 +125,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryFilterInfo( [Out] out FilterInfo filterInfo ); + int QueryFilterInfo([Out] out FilterInfo filterInfo); /// /// Notifies the filter that it has joined or left the filter graph. @@ -138,7 +138,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int JoinFilterGraph( [In] IFilterGraph graph, [In, MarshalAs( UnmanagedType.LPWStr )] string name ); + int JoinFilterGraph([In] IFilterGraph graph, [In, MarshalAs(UnmanagedType.LPWStr)] string name); /// /// Retrieves a string containing vendor information. @@ -149,6 +149,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryVendorInfo( [Out, MarshalAs( UnmanagedType.LPWStr )] out string vendorInfo ); + int QueryVendorInfo([Out, MarshalAs(UnmanagedType.LPWStr)] out string vendorInfo); } } diff --git a/VAR.Toolbox/Code/DirectShow/ICaptureGraphBuilder2.cs b/VAR.Toolbox/Code/DirectShow/ICaptureGraphBuilder2.cs index 7a1ce42..1354f5b 100644 --- a/VAR.Toolbox/Code/DirectShow/ICaptureGraphBuilder2.cs +++ b/VAR.Toolbox/Code/DirectShow/ICaptureGraphBuilder2.cs @@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ICaptureGraphBuilder2 { /// @@ -21,7 +21,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetFiltergraph( [In] IGraphBuilder graphBuilder ); + int SetFiltergraph([In] IGraphBuilder graphBuilder); /// /// Retrieve the filter graph that the builder is using. @@ -32,7 +32,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetFiltergraph( [Out] out IGraphBuilder graphBuilder ); + int GetFiltergraph([Out] out IGraphBuilder graphBuilder); /// /// Create file writing section of the filter graph. @@ -48,8 +48,8 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int SetOutputFileName( - [In, MarshalAs( UnmanagedType.LPStruct )] Guid type, - [In, MarshalAs( UnmanagedType.LPWStr )] string fileName, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid type, + [In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [Out] out IBaseFilter baseFilter, [Out] out IntPtr fileSinkFilter ); @@ -68,11 +68,11 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int FindInterface( - [In, MarshalAs( UnmanagedType.LPStruct )] Guid category, - [In, MarshalAs( UnmanagedType.LPStruct )] Guid type, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid category, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid type, [In] IBaseFilter baseFilter, - [In, MarshalAs( UnmanagedType.LPStruct )] Guid interfaceID , - [Out, MarshalAs( UnmanagedType.IUnknown )] out object retInterface + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceID, + [Out, MarshalAs(UnmanagedType.IUnknown)] out object retInterface ); /// @@ -89,9 +89,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int RenderStream( - [In, MarshalAs( UnmanagedType.LPStruct )] Guid category, - [In, MarshalAs( UnmanagedType.LPStruct )] Guid mediaType, - [In, MarshalAs( UnmanagedType.IUnknown )] object source, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid category, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid mediaType, + [In, MarshalAs(UnmanagedType.IUnknown)] object source, [In] IBaseFilter compressor, [In] IBaseFilter renderer ); @@ -114,9 +114,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int ControlStream( - [In, MarshalAs( UnmanagedType.LPStruct )] Guid category, - [In, MarshalAs( UnmanagedType.LPStruct )] Guid mediaType, - [In, MarshalAs( UnmanagedType.Interface )] IBaseFilter filter, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid category, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid mediaType, + [In, MarshalAs(UnmanagedType.Interface)] IBaseFilter filter, [In] long start, [In] long stop, [In] short startCookie, @@ -134,7 +134,7 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int AllocCapFile( - [In, MarshalAs( UnmanagedType.LPWStr )] string fileName, + [In, MarshalAs(UnmanagedType.LPWStr)] string fileName, [In] long size ); @@ -151,9 +151,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int CopyCaptureFile( - [In, MarshalAs( UnmanagedType.LPWStr )] string oldFileName, - [In, MarshalAs( UnmanagedType.LPWStr )] string newFileName, - [In, MarshalAs( UnmanagedType.Bool )] bool allowEscAbort, + [In, MarshalAs(UnmanagedType.LPWStr)] string oldFileName, + [In, MarshalAs(UnmanagedType.LPWStr)] string newFileName, + [In, MarshalAs(UnmanagedType.Bool)] bool allowEscAbort, [In] IntPtr callback ); @@ -173,13 +173,13 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int FindPin( - [In, MarshalAs( UnmanagedType.IUnknown )] object source, + [In, MarshalAs(UnmanagedType.IUnknown)] object source, [In] PinDirection pinDirection, - [In, MarshalAs( UnmanagedType.LPStruct )] Guid category, - [In, MarshalAs( UnmanagedType.LPStruct )] Guid mediaType, - [In, MarshalAs( UnmanagedType.Bool )] bool unconnected, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid category, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid mediaType, + [In, MarshalAs(UnmanagedType.Bool)] bool unconnected, [In] int index, - [Out, MarshalAs( UnmanagedType.Interface )] out IPin pin + [Out, MarshalAs(UnmanagedType.Interface)] out IPin pin ); } } diff --git a/VAR.Toolbox/Code/DirectShow/ICreateDevEnum.cs b/VAR.Toolbox/Code/DirectShow/ICreateDevEnum.cs index c2e36ae..fbe1357 100644 --- a/VAR.Toolbox/Code/DirectShow/ICreateDevEnum.cs +++ b/VAR.Toolbox/Code/DirectShow/ICreateDevEnum.cs @@ -10,8 +10,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "29840822-5B84-11D0-BD3B-00A0C911CE86" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ICreateDevEnum { /// @@ -25,6 +25,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int CreateClassEnumerator( [In] ref Guid type, [Out] out IEnumMoniker enumMoniker, [In] int flags ); + int CreateClassEnumerator([In] ref Guid type, [Out] out IEnumMoniker enumMoniker, [In] int flags); } } diff --git a/VAR.Toolbox/Code/DirectShow/IEnumFilters.cs b/VAR.Toolbox/Code/DirectShow/IEnumFilters.cs index 9d5272d..bbbfcb6 100644 --- a/VAR.Toolbox/Code/DirectShow/IEnumFilters.cs +++ b/VAR.Toolbox/Code/DirectShow/IEnumFilters.cs @@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A86893-0AD4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A86893-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IEnumFilters { /// @@ -24,9 +24,9 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Next( [In] int cFilters, - [Out, MarshalAs( UnmanagedType.LPArray, SizeParamIndex = 0 )] IBaseFilter[] filters, - [Out] out int filtersFetched ); + int Next([In] int cFilters, + [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IBaseFilter[] filters, + [Out] out int filtersFetched); /// /// Skips a specified number of filters in the enumeration sequence. @@ -37,7 +37,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Skip( [In] int cFilters ); + int Skip([In] int cFilters); /// /// Resets the enumeration sequence to the beginning. @@ -46,7 +46,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Reset( ); + int Reset(); /// /// Makes a copy of the enumerator with the same enumeration state. @@ -59,6 +59,6 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [PreserveSig] - int Clone( [Out] out IEnumFilters enumFilters ); + int Clone([Out] out IEnumFilters enumFilters); } } diff --git a/VAR.Toolbox/Code/DirectShow/IEnumPins.cs b/VAR.Toolbox/Code/DirectShow/IEnumPins.cs index 9d72823..d258a40 100644 --- a/VAR.Toolbox/Code/DirectShow/IEnumPins.cs +++ b/VAR.Toolbox/Code/DirectShow/IEnumPins.cs @@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A86892-0AD4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A86892-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IEnumPins { /// @@ -23,9 +23,9 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Next( [In] int cPins, - [Out, MarshalAs( UnmanagedType.LPArray, SizeParamIndex = 0 )] IPin[] pins, - [Out] out int pinsFetched ); + int Next([In] int cPins, + [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IPin[] pins, + [Out] out int pinsFetched); /// /// Skips a specified number of pins in the enumeration sequence. @@ -36,7 +36,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Skip( [In] int cPins ); + int Skip([In] int cPins); /// /// Resets the enumeration sequence to the beginning. @@ -45,7 +45,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Reset( ); + int Reset(); /// /// Makes a copy of the enumerator with the same enumeration state. @@ -56,6 +56,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Clone( [Out] out IEnumPins enumPins ); + int Clone([Out] out IEnumPins enumPins); } } diff --git a/VAR.Toolbox/Code/DirectShow/IFileSourceFilter.cs b/VAR.Toolbox/Code/DirectShow/IFileSourceFilter.cs index c3cceaf..474b50e 100644 --- a/VAR.Toolbox/Code/DirectShow/IFileSourceFilter.cs +++ b/VAR.Toolbox/Code/DirectShow/IFileSourceFilter.cs @@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A868A6-0Ad4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A868A6-0Ad4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IFileSourceFilter { /// @@ -22,8 +22,8 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Load( [In, MarshalAs( UnmanagedType.LPWStr )] string fileName, - [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int Load([In, MarshalAs(UnmanagedType.LPWStr)] string fileName, + [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Retrieves the current file. @@ -35,7 +35,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetCurFile([Out, MarshalAs( UnmanagedType.LPWStr )] out string fileName, - [Out, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int GetCurFile([Out, MarshalAs(UnmanagedType.LPWStr)] out string fileName, + [Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); } } diff --git a/VAR.Toolbox/Code/DirectShow/IFilterGraph.cs b/VAR.Toolbox/Code/DirectShow/IFilterGraph.cs index af1bb74..1cf6046 100644 --- a/VAR.Toolbox/Code/DirectShow/IFilterGraph.cs +++ b/VAR.Toolbox/Code/DirectShow/IFilterGraph.cs @@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A8689F-0AD4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A8689F-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IFilterGraph { /// @@ -23,7 +23,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int AddFilter( [In] IBaseFilter filter, [In, MarshalAs( UnmanagedType.LPWStr )] string name ); + int AddFilter([In] IBaseFilter filter, [In, MarshalAs(UnmanagedType.LPWStr)] string name); /// /// Removes a filter from the graph. @@ -34,7 +34,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int RemoveFilter( [In] IBaseFilter filter ); + int RemoveFilter([In] IBaseFilter filter); /// /// Provides an enumerator for all filters in the graph. @@ -45,7 +45,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EnumFilters( [Out] out IntPtr enumerator ); + int EnumFilters([Out] out IntPtr enumerator); /// /// Finds a filter that was added with a specified name. @@ -57,7 +57,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int FindFilterByName( [In, MarshalAs( UnmanagedType.LPWStr )] string name, [Out] out IBaseFilter filter ); + int FindFilterByName([In, MarshalAs(UnmanagedType.LPWStr)] string name, [Out] out IBaseFilter filter); /// /// Connects two pins directly (without intervening filters). @@ -70,7 +70,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ConnectDirect( [In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int ConnectDirect([In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Breaks the existing pin connection and reconnects it to the same pin. @@ -81,7 +81,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Reconnect( [In] IPin pin ); + int Reconnect([In] IPin pin); /// /// Disconnects a specified pin. @@ -92,7 +92,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Disconnect( [In] IPin pin ); + int Disconnect([In] IPin pin); /// /// Sets the reference clock to the default clock. @@ -101,6 +101,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetDefaultSyncSource( ); + int SetDefaultSyncSource(); } } diff --git a/VAR.Toolbox/Code/DirectShow/IFilterGraph2.cs b/VAR.Toolbox/Code/DirectShow/IFilterGraph2.cs index 213754c..3cd3301 100644 --- a/VAR.Toolbox/Code/DirectShow/IFilterGraph2.cs +++ b/VAR.Toolbox/Code/DirectShow/IFilterGraph2.cs @@ -26,7 +26,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int AddFilter( [In] IBaseFilter filter, [In, MarshalAs( UnmanagedType.LPWStr )] string name ); + int AddFilter([In] IBaseFilter filter, [In, MarshalAs(UnmanagedType.LPWStr)] string name); /// /// Removes a filter from the graph. @@ -37,7 +37,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int RemoveFilter( [In] IBaseFilter filter ); + int RemoveFilter([In] IBaseFilter filter); /// /// Provides an enumerator for all filters in the graph. @@ -48,7 +48,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EnumFilters( [Out] out IEnumFilters enumerator ); + int EnumFilters([Out] out IEnumFilters enumerator); /// /// Finds a filter that was added with a specified name. @@ -60,7 +60,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int FindFilterByName( [In, MarshalAs( UnmanagedType.LPWStr )] string name, [Out] out IBaseFilter filter ); + int FindFilterByName([In, MarshalAs(UnmanagedType.LPWStr)] string name, [Out] out IBaseFilter filter); /// /// Connects two pins directly (without intervening filters). @@ -73,7 +73,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ConnectDirect( [In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int ConnectDirect([In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Breaks the existing pin connection and reconnects it to the same pin. @@ -84,7 +84,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Reconnect( [In] IPin pin ); + int Reconnect([In] IPin pin); /// /// Disconnects a specified pin. @@ -95,7 +95,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Disconnect( [In] IPin pin ); + int Disconnect([In] IPin pin); /// /// Sets the reference clock to the default clock. @@ -104,7 +104,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetDefaultSyncSource( ); + int SetDefaultSyncSource(); // --- IGraphBuilder methods @@ -118,7 +118,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Connect( [In] IPin pinOut, [In] IPin pinIn ); + int Connect([In] IPin pinOut, [In] IPin pinIn); /// /// Adds a chain of filters to a specified output pin to render it. @@ -129,7 +129,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Render( [In] IPin pinOut ); + int Render([In] IPin pinOut); /// /// Builds a filter graph that renders the specified file. @@ -142,8 +142,8 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int RenderFile( - [In, MarshalAs( UnmanagedType.LPWStr )] string file, - [In, MarshalAs( UnmanagedType.LPWStr )] string playList ); + [In, MarshalAs(UnmanagedType.LPWStr)] string file, + [In, MarshalAs(UnmanagedType.LPWStr)] string playList); /// /// Adds a source filter to the filter graph for a specific file. @@ -157,9 +157,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int AddSourceFilter( - [In, MarshalAs( UnmanagedType.LPWStr )] string fileName, - [In, MarshalAs( UnmanagedType.LPWStr )] string filterName, - [Out] out IBaseFilter filter ); + [In, MarshalAs(UnmanagedType.LPWStr)] string fileName, + [In, MarshalAs(UnmanagedType.LPWStr)] string filterName, + [Out] out IBaseFilter filter); /// /// Sets the file for logging actions taken when attempting to perform an operation. @@ -170,7 +170,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetLogFile( IntPtr hFile ); + int SetLogFile(IntPtr hFile); /// /// Requests that the graph builder return as soon as possible from its current task. @@ -179,7 +179,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Abort( ); + int Abort(); /// /// Queries whether the current operation should continue. @@ -188,7 +188,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ShouldOperationContinue( ); + int ShouldOperationContinue(); // --- IFilterGraph2 methods @@ -209,7 +209,7 @@ namespace VAR.Toolbox.Code.DirectShow int AddSourceFilterForMoniker( [In] IMoniker moniker, [In] IBindCtx bindContext, - [In, MarshalAs( UnmanagedType.LPWStr )] string filterName, + [In, MarshalAs(UnmanagedType.LPWStr)] string filterName, [Out] out IBaseFilter filter ); @@ -226,7 +226,7 @@ namespace VAR.Toolbox.Code.DirectShow [PreserveSig] int ReconnectEx( [In] IPin pin, - [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType + [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType ); /// diff --git a/VAR.Toolbox/Code/DirectShow/IGraphBuilder.cs b/VAR.Toolbox/Code/DirectShow/IGraphBuilder.cs index 3f97930..b2a6c8d 100644 --- a/VAR.Toolbox/Code/DirectShow/IGraphBuilder.cs +++ b/VAR.Toolbox/Code/DirectShow/IGraphBuilder.cs @@ -8,12 +8,12 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A868A9-0AD4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A868A9-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IGraphBuilder { // --- IFilterGraph Methods - + /// /// Adds a filter to the graph and gives it a name. /// @@ -24,7 +24,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int AddFilter( [In] IBaseFilter filter, [In, MarshalAs( UnmanagedType.LPWStr )] string name ); + int AddFilter([In] IBaseFilter filter, [In, MarshalAs(UnmanagedType.LPWStr)] string name); /// /// Removes a filter from the graph. @@ -35,7 +35,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int RemoveFilter( [In] IBaseFilter filter ); + int RemoveFilter([In] IBaseFilter filter); /// /// Provides an enumerator for all filters in the graph. @@ -46,7 +46,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EnumFilters( [Out] out IEnumFilters enumerator ); + int EnumFilters([Out] out IEnumFilters enumerator); /// /// Finds a filter that was added with a specified name. @@ -58,7 +58,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int FindFilterByName( [In, MarshalAs( UnmanagedType.LPWStr )] string name, [Out] out IBaseFilter filter ); + int FindFilterByName([In, MarshalAs(UnmanagedType.LPWStr)] string name, [Out] out IBaseFilter filter); /// /// Connects two pins directly (without intervening filters). @@ -71,7 +71,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ConnectDirect( [In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int ConnectDirect([In] IPin pinOut, [In] IPin pinIn, [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Breaks the existing pin connection and reconnects it to the same pin. @@ -82,7 +82,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Reconnect( [In] IPin pin ); + int Reconnect([In] IPin pin); /// /// Disconnects a specified pin. @@ -93,7 +93,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Disconnect( [In] IPin pin ); + int Disconnect([In] IPin pin); /// /// Sets the reference clock to the default clock. @@ -102,10 +102,10 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetDefaultSyncSource( ); + int SetDefaultSyncSource(); // --- IGraphBuilder methods - + /// /// Connects two pins. If they will not connect directly, this method connects them with intervening transforms. /// @@ -116,7 +116,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Connect( [In] IPin pinOut, [In] IPin pinIn ); + int Connect([In] IPin pinOut, [In] IPin pinIn); /// /// Adds a chain of filters to a specified output pin to render it. @@ -127,7 +127,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Render( [In] IPin pinOut ); + int Render([In] IPin pinOut); /// /// Builds a filter graph that renders the specified file. @@ -140,8 +140,8 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int RenderFile( - [In, MarshalAs( UnmanagedType.LPWStr )] string file, - [In, MarshalAs( UnmanagedType.LPWStr )] string playList); + [In, MarshalAs(UnmanagedType.LPWStr)] string file, + [In, MarshalAs(UnmanagedType.LPWStr)] string playList); /// /// Adds a source filter to the filter graph for a specific file. @@ -155,9 +155,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int AddSourceFilter( - [In, MarshalAs( UnmanagedType.LPWStr )] string fileName, - [In, MarshalAs( UnmanagedType.LPWStr )] string filterName, - [Out] out IBaseFilter filter ); + [In, MarshalAs(UnmanagedType.LPWStr)] string fileName, + [In, MarshalAs(UnmanagedType.LPWStr)] string filterName, + [Out] out IBaseFilter filter); /// /// Sets the file for logging actions taken when attempting to perform an operation. @@ -168,7 +168,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetLogFile( IntPtr hFile ); + int SetLogFile(IntPtr hFile); /// /// Requests that the graph builder return as soon as possible from its current task. @@ -177,7 +177,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Abort( ); + int Abort(); /// /// Queries whether the current operation should continue. @@ -186,6 +186,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ShouldOperationContinue( ); + int ShouldOperationContinue(); } } diff --git a/VAR.Toolbox/Code/DirectShow/IMediaControl.cs b/VAR.Toolbox/Code/DirectShow/IMediaControl.cs index c000863..d71f968 100644 --- a/VAR.Toolbox/Code/DirectShow/IMediaControl.cs +++ b/VAR.Toolbox/Code/DirectShow/IMediaControl.cs @@ -9,7 +9,7 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A868B1-0AD4-11CE-B03A-0020AF0BA770" ), + Guid("56A868B1-0AD4-11CE-B03A-0020AF0BA770"), InterfaceType(ComInterfaceType.InterfaceIsDual)] internal interface IMediaControl { @@ -20,7 +20,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Run( ); + int Run(); /// /// Pauses all filters in the filter graph. @@ -29,7 +29,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Pause( ); + int Pause(); /// /// Stops all the filters in the filter graph. @@ -38,7 +38,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Stop( ); + int Stop(); /// /// Retrieves the state of the filter graph. @@ -50,7 +50,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetState( int timeout, out int filterState ); + int GetState(int timeout, out int filterState); /// /// Builds a filter graph that renders the specified file. @@ -61,7 +61,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int RenderFile( string fileName ); + int RenderFile(string fileName); /// /// Adds a source filter to the filter graph, for a specified file. @@ -73,7 +73,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int AddSourceFilter( [In] string fileName, [Out, MarshalAs( UnmanagedType.IDispatch )] out object filterInfo ); + int AddSourceFilter([In] string fileName, [Out, MarshalAs(UnmanagedType.IDispatch)] out object filterInfo); /// /// Retrieves a collection of the filters in the filter graph. @@ -85,7 +85,7 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int get_FilterCollection( - [Out, MarshalAs( UnmanagedType.IDispatch )] out object collection ); + [Out, MarshalAs(UnmanagedType.IDispatch)] out object collection); /// /// Retrieves a collection of all the filters listed in the registry. @@ -97,7 +97,7 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int get_RegFilterCollection( - [Out, MarshalAs( UnmanagedType.IDispatch )] out object collection ); + [Out, MarshalAs(UnmanagedType.IDispatch)] out object collection); /// /// Pauses the filter graph, allowing filters to queue data, and then stops the filter graph. @@ -106,6 +106,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int StopWhenReady( ); + int StopWhenReady(); } } diff --git a/VAR.Toolbox/Code/DirectShow/IMediaEventEx.cs b/VAR.Toolbox/Code/DirectShow/IMediaEventEx.cs index ddc1c87..d9cd1a9 100644 --- a/VAR.Toolbox/Code/DirectShow/IMediaEventEx.cs +++ b/VAR.Toolbox/Code/DirectShow/IMediaEventEx.cs @@ -7,9 +7,9 @@ /// The interface inherits contains methods for retrieving event notifications and for overriding the /// filter graph's default handling of events. /// - [ComVisible( true ), ComImport, - Guid( "56a868c0-0ad4-11ce-b03a-0020af0ba770" ), - InterfaceType( ComInterfaceType.InterfaceIsDual )] + [ComVisible(true), ComImport, + Guid("56a868c0-0ad4-11ce-b03a-0020af0ba770"), + InterfaceType(ComInterfaceType.InterfaceIsDual)] internal interface IMediaEventEx { /// @@ -20,7 +20,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetEventHandle( out IntPtr hEvent ); + int GetEventHandle(out IntPtr hEvent); /// /// Retrieves the next event notification from the event queue. @@ -34,7 +34,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetEvent( [Out, MarshalAs( UnmanagedType.I4 )] out DsEvCode lEventCode, [Out] out IntPtr lParam1, [Out] out IntPtr lParam2, int msTimeout ); + int GetEvent([Out, MarshalAs(UnmanagedType.I4)] out DsEvCode lEventCode, [Out] out IntPtr lParam1, [Out] out IntPtr lParam2, int msTimeout); /// /// Waits for the filter graph to render all available data. @@ -46,7 +46,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int WaitForCompletion( int msTimeout, [Out] out int pEvCode ); + int WaitForCompletion(int msTimeout, [Out] out int pEvCode); /// /// Cancels the Filter Graph Manager's default handling for a specified event. @@ -57,7 +57,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int CancelDefaultHandling( int lEvCode ); + int CancelDefaultHandling(int lEvCode); /// /// Restores the Filter Graph Manager's default handling for a specified event. @@ -67,7 +67,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int RestoreDefaultHandling( int lEvCode ); + int RestoreDefaultHandling(int lEvCode); /// /// Frees resources associated with the parameters of an event. @@ -79,7 +79,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int FreeEventParams( [In, MarshalAs( UnmanagedType.I4 )] DsEvCode lEvCode, IntPtr lParam1, IntPtr lParam2 ); + int FreeEventParams([In, MarshalAs(UnmanagedType.I4)] DsEvCode lEvCode, IntPtr lParam1, IntPtr lParam2); /// /// Registers a window to process event notifications. @@ -92,7 +92,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int SetNotifyWindow( IntPtr hwnd, int lMsg, IntPtr lInstanceData ); + int SetNotifyWindow(IntPtr hwnd, int lMsg, IntPtr lInstanceData); /// /// Enables or disables event notifications. @@ -103,7 +103,7 @@ /// Return's HRESULT error code. /// [PreserveSig] - int SetNotifyFlags( int lNoNotifyFlags ); + int SetNotifyFlags(int lNoNotifyFlags); /// /// Determines whether event notifications are enabled. @@ -114,6 +114,6 @@ /// Return's HRESULT error code. /// [PreserveSig] - int GetNotifyFlags( out int lplNoNotifyFlags ); + int GetNotifyFlags(out int lplNoNotifyFlags); } } diff --git a/VAR.Toolbox/Code/DirectShow/IMediaFilter.cs b/VAR.Toolbox/Code/DirectShow/IMediaFilter.cs index d07ed04..7df8231 100644 --- a/VAR.Toolbox/Code/DirectShow/IMediaFilter.cs +++ b/VAR.Toolbox/Code/DirectShow/IMediaFilter.cs @@ -9,15 +9,15 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, System.Security.SuppressUnmanagedCodeSecurity, - Guid( "56a86899-0ad4-11ce-b03a-0020af0ba770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56a86899-0ad4-11ce-b03a-0020af0ba770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IMediaFilter : IPersist { #region IPersist Methods [PreserveSig] new int GetClassID( - [Out] out Guid pClassID ); + [Out] out Guid pClassID); #endregion @@ -28,7 +28,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Stop( ); + int Stop(); /// /// This method informs the filter to transition to the new state. @@ -37,7 +37,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Pause( ); + int Pause(); /// /// This method informs the filter to transition to the new (running) state. Passes a time value to synchronize independent streams. @@ -48,7 +48,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Run( [In] long tStart ); + int Run([In] long tStart); /// /// This method determines the filter's state. @@ -62,7 +62,7 @@ namespace VAR.Toolbox.Code.DirectShow [PreserveSig] int GetState( [In] int dwMilliSecsTimeout, - [Out] out FilterState filtState ); + [Out] out FilterState filtState); /// /// This method identifies the reference clock to which the filter should synchronize activity. @@ -73,7 +73,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetSyncSource( [In] IReferenceClock pClock ); + int SetSyncSource([In] IReferenceClock pClock); /// /// This method retrieves the current reference clock in use by this filter. @@ -85,7 +85,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetSyncSource( [Out] out IReferenceClock pClock ); + int GetSyncSource([Out] out IReferenceClock pClock); } } diff --git a/VAR.Toolbox/Code/DirectShow/IPin.cs b/VAR.Toolbox/Code/DirectShow/IPin.cs index b91b418..9353888 100644 --- a/VAR.Toolbox/Code/DirectShow/IPin.cs +++ b/VAR.Toolbox/Code/DirectShow/IPin.cs @@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "56A86891-0AD4-11CE-B03A-0020AF0BA770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56A86891-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IPin { /// @@ -22,7 +22,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Connect( [In] IPin receivePin, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int Connect([In] IPin receivePin, [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Makes a connection to this pin and is called by a connecting pin. @@ -34,7 +34,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ReceiveConnection( [In] IPin receivePin, [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int ReceiveConnection([In] IPin receivePin, [In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Breaks the current pin connection. @@ -43,7 +43,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Disconnect( ); + int Disconnect(); /// /// Returns a pointer to the connecting pin. @@ -54,7 +54,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ConnectedTo( [Out] out IPin pin ); + int ConnectedTo([Out] out IPin pin); /// /// Returns the media type of this pin's connection. @@ -68,7 +68,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int ConnectionMediaType( [Out, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int ConnectionMediaType([Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Retrieves information about this pin (for example, the name, owning filter, and direction). @@ -79,7 +79,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryPinInfo( [Out] out PinInfo pinInfo ); + int QueryPinInfo([Out] out PinInfo pinInfo); /// /// Retrieves the direction for this pin. @@ -90,7 +90,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryDirection( out PinDirection pinDirection ); + int QueryDirection(out PinDirection pinDirection); /// /// Retrieves an identifier for the pin. @@ -101,7 +101,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryId( [Out, MarshalAs( UnmanagedType.LPWStr )] out string id ); + int QueryId([Out, MarshalAs(UnmanagedType.LPWStr)] out string id); /// /// Queries whether a given media type is acceptable by the pin. @@ -112,7 +112,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryAccept( [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int QueryAccept([In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Provides an enumerator for this pin's preferred media types. @@ -123,7 +123,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EnumMediaTypes( IntPtr enumerator ); + int EnumMediaTypes(IntPtr enumerator); /// /// Provides an array of the pins to which this pin internally connects. @@ -136,7 +136,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int QueryInternalConnections( IntPtr apPin, [In, Out] ref int nPin ); + int QueryInternalConnections(IntPtr apPin, [In, Out] ref int nPin); /// /// Notifies the pin that no additional data is expected. @@ -145,7 +145,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EndOfStream( ); + int EndOfStream(); /// /// Begins a flush operation. @@ -154,7 +154,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int BeginFlush( ); + int BeginFlush(); /// /// Ends a flush operation. @@ -163,7 +163,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int EndFlush( ); + int EndFlush(); /// /// Specifies that samples following this call are grouped as a segment with a given start time, stop time, and rate. @@ -179,6 +179,6 @@ namespace VAR.Toolbox.Code.DirectShow int NewSegment( long start, long stop, - double rate ); + double rate); } } diff --git a/VAR.Toolbox/Code/DirectShow/IPropertyBag.cs b/VAR.Toolbox/Code/DirectShow/IPropertyBag.cs index 1536bb3..668e4c9 100644 --- a/VAR.Toolbox/Code/DirectShow/IPropertyBag.cs +++ b/VAR.Toolbox/Code/DirectShow/IPropertyBag.cs @@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "55272A00-42CB-11CE-8135-00AA004BB851" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("55272A00-42CB-11CE-8135-00AA004BB851"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IPropertyBag { /// @@ -25,9 +25,9 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int Read( - [In, MarshalAs( UnmanagedType.LPWStr )] string propertyName, - [In, Out, MarshalAs( UnmanagedType.Struct )] ref object pVar, - [In] IntPtr pErrorLog ); + [In, MarshalAs(UnmanagedType.LPWStr)] string propertyName, + [In, Out, MarshalAs(UnmanagedType.Struct)] ref object pVar, + [In] IntPtr pErrorLog); /// /// Write property to property bag. @@ -40,7 +40,7 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int Write( - [In, MarshalAs( UnmanagedType.LPWStr )] string propertyName, - [In, MarshalAs( UnmanagedType.Struct )] ref object pVar ); + [In, MarshalAs(UnmanagedType.LPWStr)] string propertyName, + [In, MarshalAs(UnmanagedType.Struct)] ref object pVar); } } diff --git a/VAR.Toolbox/Code/DirectShow/IReferenceClock.cs b/VAR.Toolbox/Code/DirectShow/IReferenceClock.cs index b63ac3e..805e1e2 100644 --- a/VAR.Toolbox/Code/DirectShow/IReferenceClock.cs +++ b/VAR.Toolbox/Code/DirectShow/IReferenceClock.cs @@ -11,8 +11,8 @@ namespace VAR.Toolbox.Code.DirectShow /// retrieve the current reference time, or to request notification of an elapsed time. /// [ComImport, System.Security.SuppressUnmanagedCodeSecurity, - Guid( "56a86897-0ad4-11ce-b03a-0020af0ba770" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("56a86897-0ad4-11ce-b03a-0020af0ba770"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface IReferenceClock { /// @@ -24,7 +24,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetTime( [Out] out long pTime ); + int GetTime([Out] out long pTime); /// /// The AdviseTime method creates a one-shot advise request. @@ -42,7 +42,7 @@ namespace VAR.Toolbox.Code.DirectShow [In] long baseTime, [In] long streamTime, [In] IntPtr hEvent, - [Out] out int pdwAdviseCookie ); + [Out] out int pdwAdviseCookie); /// /// The AdvisePeriodic method creates a periodic advise request. @@ -60,7 +60,7 @@ namespace VAR.Toolbox.Code.DirectShow [In] long startTime, [In] long periodTime, [In] IntPtr hSemaphore, - [Out] out int pdwAdviseCookie ); + [Out] out int pdwAdviseCookie); /// /// The Unadvise method removes a pending advise request. @@ -71,6 +71,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int Unadvise( [In] int dwAdviseCookie ); + int Unadvise([In] int dwAdviseCookie); } } diff --git a/VAR.Toolbox/Code/DirectShow/ISampleGrabber.cs b/VAR.Toolbox/Code/DirectShow/ISampleGrabber.cs index 987d8a3..e60bb0a 100644 --- a/VAR.Toolbox/Code/DirectShow/ISampleGrabber.cs +++ b/VAR.Toolbox/Code/DirectShow/ISampleGrabber.cs @@ -9,10 +9,10 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + Guid("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ISampleGrabber - { + { /// /// Specifies whether the filter should stop the graph after receiving one sample. /// @@ -22,7 +22,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetOneShot( [In, MarshalAs( UnmanagedType.Bool )] bool oneShot ); + int SetOneShot([In, MarshalAs(UnmanagedType.Bool)] bool oneShot); /// /// Specifies the media type for the connection on the Sample Grabber's input pin. @@ -33,7 +33,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetMediaType( [In, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int SetMediaType([In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Retrieves the media type for the connection on the Sample Grabber's input pin. @@ -44,7 +44,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetConnectedMediaType( [Out, MarshalAs( UnmanagedType.LPStruct )] AMMediaType mediaType ); + int GetConnectedMediaType([Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType); /// /// Specifies whether to copy sample data into a buffer as it goes through the filter. @@ -56,7 +56,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetBufferSamples( [In, MarshalAs( UnmanagedType.Bool )] bool bufferThem ); + int SetBufferSamples([In, MarshalAs(UnmanagedType.Bool)] bool bufferThem); /// /// Retrieves a copy of the sample that the filter received most recently. @@ -68,7 +68,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetCurrentBuffer( ref int bufferSize, IntPtr buffer ); + int GetCurrentBuffer(ref int bufferSize, IntPtr buffer); /// /// Not currently implemented. @@ -79,7 +79,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetCurrentSample( IntPtr sample ); + int GetCurrentSample(IntPtr sample); /// /// Specifies a callback method to call on incoming samples. @@ -91,6 +91,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetCallback( ISampleGrabberCB callback, int whichMethodToCallback ); + int SetCallback(ISampleGrabberCB callback, int whichMethodToCallback); } } diff --git a/VAR.Toolbox/Code/DirectShow/ISampleGrabberCB.cs b/VAR.Toolbox/Code/DirectShow/ISampleGrabberCB.cs index 680701f..f1ffa65 100644 --- a/VAR.Toolbox/Code/DirectShow/ISampleGrabberCB.cs +++ b/VAR.Toolbox/Code/DirectShow/ISampleGrabberCB.cs @@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid("0579154A-2B53-4994-B0D0-E773148EFF85"), - InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + Guid("0579154A-2B53-4994-B0D0-E773148EFF85"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ISampleGrabberCB { /// @@ -22,7 +22,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SampleCB( double sampleTime, IntPtr sample ); + int SampleCB(double sampleTime, IntPtr sample); /// /// Callback method that receives a pointer to the sample bufferþ @@ -35,6 +35,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int BufferCB( double sampleTime, IntPtr buffer, int bufferLen ); + int BufferCB(double sampleTime, IntPtr buffer, int bufferLen); } } diff --git a/VAR.Toolbox/Code/DirectShow/ISpecifyPropertyPages.cs b/VAR.Toolbox/Code/DirectShow/ISpecifyPropertyPages.cs index e0ccd89..b77a721 100644 --- a/VAR.Toolbox/Code/DirectShow/ISpecifyPropertyPages.cs +++ b/VAR.Toolbox/Code/DirectShow/ISpecifyPropertyPages.cs @@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid( "B196B28B-BAB4-101A-B69C-00AA00341D07" ), - InterfaceType( ComInterfaceType.InterfaceIsIUnknown )] + Guid("B196B28B-BAB4-101A-B69C-00AA00341D07"), + InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] internal interface ISpecifyPropertyPages { /// @@ -24,6 +24,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetPages( out CAUUID pPages ); + int GetPages(out CAUUID pPages); } } diff --git a/VAR.Toolbox/Code/DirectShow/IVideoWindow.cs b/VAR.Toolbox/Code/DirectShow/IVideoWindow.cs index a073122..7253e52 100644 --- a/VAR.Toolbox/Code/DirectShow/IVideoWindow.cs +++ b/VAR.Toolbox/Code/DirectShow/IVideoWindow.cs @@ -8,10 +8,10 @@ namespace VAR.Toolbox.Code.DirectShow /// /// [ComImport, - Guid("56A868B4-0AD4-11CE-B03A-0020AF0BA770"), - InterfaceType(ComInterfaceType.InterfaceIsDual)] + Guid("56A868B4-0AD4-11CE-B03A-0020AF0BA770"), + InterfaceType(ComInterfaceType.InterfaceIsDual)] internal interface IVideoWindow - { + { /// /// Sets the video window caption. /// @@ -21,7 +21,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Caption( string caption ); + int put_Caption(string caption); /// /// Retrieves the video window caption. @@ -32,7 +32,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Caption( [Out] out string caption ); + int get_Caption([Out] out string caption); /// /// Sets the window style on the video window. @@ -43,7 +43,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_WindowStyle( int windowStyle ); + int put_WindowStyle(int windowStyle); /// /// Retrieves the window style on the video window. @@ -54,7 +54,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_WindowStyle( out int windowStyle ); + int get_WindowStyle(out int windowStyle); /// /// Sets the extended window style on the video window. @@ -65,7 +65,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_WindowStyleEx( int windowStyleEx ); + int put_WindowStyleEx(int windowStyleEx); /// /// Retrieves the extended window style on the video window. @@ -76,7 +76,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_WindowStyleEx( out int windowStyleEx ); + int get_WindowStyleEx(out int windowStyleEx); /// /// Specifies whether the video renderer automatically shows the video window when it receives video data. @@ -87,7 +87,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_AutoShow( [In, MarshalAs( UnmanagedType.Bool )] bool autoShow ); + int put_AutoShow([In, MarshalAs(UnmanagedType.Bool)] bool autoShow); /// /// Queries whether the video renderer automatically shows the video window when it receives video data. @@ -98,7 +98,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_AutoShow( [Out, MarshalAs( UnmanagedType.Bool )] out bool autoShow ); + int get_AutoShow([Out, MarshalAs(UnmanagedType.Bool)] out bool autoShow); /// /// Shows, hides, minimizes, or maximizes the video window. @@ -109,7 +109,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_WindowState( int windowState ); + int put_WindowState(int windowState); /// /// Queries whether the video window is visible, hidden, minimized, or maximized. @@ -120,7 +120,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_WindowState( out int windowState ); + int get_WindowState(out int windowState); /// /// Specifies whether the video window realizes its palette in the background. @@ -131,7 +131,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_BackgroundPalette( [In, MarshalAs( UnmanagedType.Bool )] bool backgroundPalette ); + int put_BackgroundPalette([In, MarshalAs(UnmanagedType.Bool)] bool backgroundPalette); /// /// Queries whether the video window realizes its palette in the background. @@ -142,7 +142,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_BackgroundPalette( [Out, MarshalAs( UnmanagedType.Bool )] out bool backgroundPalette ); + int get_BackgroundPalette([Out, MarshalAs(UnmanagedType.Bool)] out bool backgroundPalette); /// /// Shows or hides the video window. @@ -153,7 +153,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Visible( [In, MarshalAs( UnmanagedType.Bool )] bool visible ); + int put_Visible([In, MarshalAs(UnmanagedType.Bool)] bool visible); /// /// Queries whether the video window is visible. @@ -164,7 +164,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Visible( [Out, MarshalAs( UnmanagedType.Bool )] out bool visible ); + int get_Visible([Out, MarshalAs(UnmanagedType.Bool)] out bool visible); /// /// Sets the video window's x-coordinate. @@ -175,7 +175,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Left( int left ); + int put_Left(int left); /// /// Retrieves the video window's x-coordinate. @@ -186,7 +186,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Left( out int left ); + int get_Left(out int left); /// /// Sets the width of the video window. @@ -197,7 +197,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Width( int width ); + int put_Width(int width); /// /// Retrieves the width of the video window. @@ -208,7 +208,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Width( out int width ); + int get_Width(out int width); /// /// Sets the video window's y-coordinate. @@ -219,7 +219,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Top( int top ); + int put_Top(int top); /// /// Retrieves the video window's y-coordinate. @@ -230,7 +230,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Top( out int top ); + int get_Top(out int top); /// /// Sets the height of the video window. @@ -241,7 +241,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Height( int height ); + int put_Height(int height); /// /// Retrieves the height of the video window. @@ -252,7 +252,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Height( out int height ); + int get_Height(out int height); /// /// Specifies a parent window for the video windowþ @@ -263,7 +263,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_Owner( IntPtr owner ); + int put_Owner(IntPtr owner); /// /// Retrieves the video window's parent window, if anyþ @@ -274,7 +274,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_Owner( out IntPtr owner ); + int get_Owner(out IntPtr owner); /// /// Specifies a window to receive mouse and keyboard messages from the video window. @@ -285,7 +285,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_MessageDrain( IntPtr drain ); + int put_MessageDrain(IntPtr drain); /// /// Retrieves the window that receives mouse and keyboard messages from the video window, if any. @@ -296,7 +296,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_MessageDrain( out IntPtr drain ); + int get_MessageDrain(out IntPtr drain); /// /// Retrieves the color that appears around the edges of the destination rectangle. @@ -307,7 +307,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int get_BorderColor( out int color ); + int get_BorderColor(out int color); /// /// Sets the color that appears around the edges of the destination rectangle. @@ -318,7 +318,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_BorderColor( int color ); + int put_BorderColor(int color); /// /// Queries whether the video renderer is in full-screen mode. @@ -330,7 +330,7 @@ namespace VAR.Toolbox.Code.DirectShow /// [PreserveSig] int get_FullScreenMode( - [Out, MarshalAs( UnmanagedType.Bool )] out bool fullScreenMode ); + [Out, MarshalAs(UnmanagedType.Bool)] out bool fullScreenMode); /// /// Enables or disables full-screen mode. @@ -341,7 +341,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int put_FullScreenMode( [In, MarshalAs( UnmanagedType.Bool )] bool fullScreenMode ); + int put_FullScreenMode([In, MarshalAs(UnmanagedType.Bool)] bool fullScreenMode); /// /// Places the video window at the top of the Z order. @@ -352,7 +352,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetWindowForeground( int focus ); + int SetWindowForeground(int focus); /// /// Forwards a message to the video window. @@ -366,7 +366,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int NotifyOwnerMessage( IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam ); + int NotifyOwnerMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam); /// /// Sets the position of the video windowþ @@ -380,7 +380,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int SetWindowPosition( int left, int top, int width, int height ); + int SetWindowPosition(int left, int top, int width, int height); /// /// Retrieves the position of the video window. @@ -394,7 +394,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetWindowPosition( out int left, out int top, out int width, out int height ); + int GetWindowPosition(out int left, out int top, out int width, out int height); /// /// Retrieves the minimum ideal size for the video image. @@ -406,7 +406,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetMinIdealImageSize( out int width, out int height ); + int GetMinIdealImageSize(out int width, out int height); /// /// Retrieves the maximum ideal size for the video image. @@ -418,7 +418,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetMaxIdealImageSize( out int width, out int height ); + int GetMaxIdealImageSize(out int width, out int height); /// /// Retrieves the restored window position. @@ -432,7 +432,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int GetRestorePosition( out int left, out int top, out int width, out int height ); + int GetRestorePosition(out int left, out int top, out int width, out int height); /// /// Hides the cursor. @@ -443,7 +443,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int HideCursor( [In, MarshalAs( UnmanagedType.Bool )] bool hideCursor ); + int HideCursor([In, MarshalAs(UnmanagedType.Bool)] bool hideCursor); /// /// Queries whether the cursor is hidden. @@ -454,6 +454,6 @@ namespace VAR.Toolbox.Code.DirectShow /// Return's HRESULT error code. /// [PreserveSig] - int IsCursorHidden( [Out, MarshalAs( UnmanagedType.Bool )] out bool hideCursor ); + int IsCursorHidden([Out, MarshalAs(UnmanagedType.Bool)] out bool hideCursor); } } diff --git a/VAR.Toolbox/Code/DirectShow/Structures.cs b/VAR.Toolbox/Code/DirectShow/Structures.cs index 21b7062..1e7cc6b 100644 --- a/VAR.Toolbox/Code/DirectShow/Structures.cs +++ b/VAR.Toolbox/Code/DirectShow/Structures.cs @@ -10,7 +10,7 @@ namespace VAR.Toolbox.Code.DirectShow /// This enumeration indicates a pin's direction. /// /// - [ComVisible( false )] + [ComVisible(false)] internal enum PinDirection { /// @@ -30,8 +30,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The structure describes the format of a media sample. /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential)] internal class AMMediaType : IDisposable { /// @@ -47,13 +47,13 @@ namespace VAR.Toolbox.Code.DirectShow /// /// If true, samples are of a fixed size. /// - [MarshalAs( UnmanagedType.Bool )] + [MarshalAs(UnmanagedType.Bool)] public bool FixedSizeSamples = true; /// /// If true, samples are compressed using temporal (interframe) compression. /// - [MarshalAs( UnmanagedType.Bool )] + [MarshalAs(UnmanagedType.Bool)] public bool TemporalCompression; /// @@ -85,20 +85,20 @@ namespace VAR.Toolbox.Code.DirectShow /// Destroys the instance of the class. /// /// - ~AMMediaType( ) + ~AMMediaType() { - Dispose( false ); + Dispose(false); } /// /// Dispose the object. /// /// - public void Dispose( ) + public void Dispose() { - Dispose( true ); + Dispose(true); // remove me from the Finalization queue - GC.SuppressFinalize( this ); + GC.SuppressFinalize(this); } /// @@ -107,17 +107,17 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Indicates if disposing was initiated manually. /// - protected virtual void Dispose( bool disposing ) + protected virtual void Dispose(bool disposing) { - if ( ( FormatSize != 0 ) && ( FormatPtr != IntPtr.Zero ) ) + if ((FormatSize != 0) && (FormatPtr != IntPtr.Zero)) { - Marshal.FreeCoTaskMem( FormatPtr ); + Marshal.FreeCoTaskMem(FormatPtr); FormatSize = 0; } - if ( unkPtr != IntPtr.Zero ) + if (unkPtr != IntPtr.Zero) { - Marshal.Release( unkPtr ); + Marshal.Release(unkPtr); unkPtr = IntPtr.Zero; } } @@ -130,8 +130,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The structure contains information about a pin. /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)] internal struct PinInfo { /// @@ -147,19 +147,19 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Name of the pin. /// - [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 128 )] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string Name; } // FILTER_INFO - [ComVisible( false ), - StructLayout( LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)] internal struct FilterInfo { /// /// Filter's name. /// - [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 128 )] + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string Name; /// @@ -174,8 +174,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The structure describes the bitmap and color information for a video image. /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential)] internal struct VideoInfoHeader { /// @@ -215,8 +215,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The structure describes the bitmap and color information for a video image (v2). /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential)] internal struct VideoInfoHeader2 { /// @@ -284,8 +284,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The structure contains information about the dimensions and color format of a device-independent bitmap (DIB). /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential, Pack = 2 )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential, Pack = 2)] internal struct BitmapInfoHeader { /// @@ -350,8 +350,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The structure defines the coordinates of the upper-left and lower-right corners of a rectangle. /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential)] internal struct RECT { /// @@ -381,8 +381,8 @@ namespace VAR.Toolbox.Code.DirectShow /// The CAUUID structure is a Counted Array of UUID or GUID types. /// /// - [ComVisible( false ), - StructLayout( LayoutKind.Sequential )] + [ComVisible(false), + StructLayout(LayoutKind.Sequential)] internal struct CAUUID { /// @@ -401,14 +401,14 @@ namespace VAR.Toolbox.Code.DirectShow /// /// A managed representation of pElems. /// - public Guid[] ToGuidArray( ) + public Guid[] ToGuidArray() { Guid[] retval = new Guid[cElems]; - for ( int i = 0; i < cElems; i++ ) + for (int i = 0; i < cElems; i++) { - IntPtr ptr = new IntPtr( pElems.ToInt64( ) + i * Marshal.SizeOf( typeof( Guid ) ) ); - retval[i] = (Guid) Marshal.PtrToStructure( ptr, typeof( Guid ) ); + IntPtr ptr = new IntPtr(pElems.ToInt64() + i * Marshal.SizeOf(typeof(Guid))); + retval[i] = (Guid)Marshal.PtrToStructure(ptr, typeof(Guid)); } return retval; @@ -421,70 +421,70 @@ namespace VAR.Toolbox.Code.DirectShow internal enum DsEvCode { None, - Complete = 0x01, // EC_COMPLETE + Complete = 0x01, // EC_COMPLETE DeviceLost = 0x1F, // EC_DEVICE_LOST //(...) not yet interested in other events } - [Flags, ComVisible( false )] + [Flags, ComVisible(false)] internal enum AnalogVideoStandard { - None = 0x00000000, // This is a digital sensor - NTSC_M = 0x00000001, // 75 IRE Setup - NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup - NTSC_433 = 0x00000004, - PAL_B = 0x00000010, - PAL_D = 0x00000020, - PAL_G = 0x00000040, - PAL_H = 0x00000080, - PAL_I = 0x00000100, - PAL_M = 0x00000200, - PAL_N = 0x00000400, - PAL_60 = 0x00000800, - SECAM_B = 0x00001000, - SECAM_D = 0x00002000, - SECAM_G = 0x00004000, - SECAM_H = 0x00008000, - SECAM_K = 0x00010000, - SECAM_K1 = 0x00020000, - SECAM_L = 0x00040000, - SECAM_L1 = 0x00080000, + None = 0x00000000, // This is a digital sensor + NTSC_M = 0x00000001, // 75 IRE Setup + NTSC_M_J = 0x00000002, // Japan, 0 IRE Setup + NTSC_433 = 0x00000004, + PAL_B = 0x00000010, + PAL_D = 0x00000020, + PAL_G = 0x00000040, + PAL_H = 0x00000080, + PAL_I = 0x00000100, + PAL_M = 0x00000200, + PAL_N = 0x00000400, + PAL_60 = 0x00000800, + SECAM_B = 0x00001000, + SECAM_D = 0x00002000, + SECAM_G = 0x00004000, + SECAM_H = 0x00008000, + SECAM_K = 0x00010000, + SECAM_K1 = 0x00020000, + SECAM_L = 0x00040000, + SECAM_L1 = 0x00080000, PAL_N_COMBO = 0x00100000 // Argentina } - [Flags, ComVisible( false )] + [Flags, ComVisible(false)] internal enum VideoControlFlags { - FlipHorizontal = 0x0001, - FlipVertical = 0x0002, + FlipHorizontal = 0x0001, + FlipVertical = 0x0002, ExternalTriggerEnable = 0x0004, - Trigger = 0x0008 + Trigger = 0x0008 } - [StructLayout( LayoutKind.Sequential ), ComVisible( false )] + [StructLayout(LayoutKind.Sequential), ComVisible(false)] internal class VideoStreamConfigCaps // VIDEO_STREAM_CONFIG_CAPS { - public Guid Guid; - public AnalogVideoStandard VideoStandard; - public Size InputSize; - public Size MinCroppingSize; - public Size MaxCroppingSize; - public int CropGranularityX; - public int CropGranularityY; - public int CropAlignX; - public int CropAlignY; - public Size MinOutputSize; - public Size MaxOutputSize; - public int OutputGranularityX; - public int OutputGranularityY; - public int StretchTapsX; - public int StretchTapsY; - public int ShrinkTapsX; - public int ShrinkTapsY; - public long MinFrameInterval; - public long MaxFrameInterval; - public int MinBitsPerSecond; - public int MaxBitsPerSecond; + public Guid Guid; + public AnalogVideoStandard VideoStandard; + public Size InputSize; + public Size MinCroppingSize; + public Size MaxCroppingSize; + public int CropGranularityX; + public int CropGranularityY; + public int CropAlignX; + public int CropAlignY; + public Size MinOutputSize; + public Size MaxOutputSize; + public int OutputGranularityX; + public int OutputGranularityY; + public int StretchTapsX; + public int StretchTapsY; + public int ShrinkTapsX; + public int ShrinkTapsY; + public long MinFrameInterval; + public long MaxFrameInterval; + public int MinBitsPerSecond; + public int MaxBitsPerSecond; } /// diff --git a/VAR.Toolbox/Code/DirectShow/Tools.cs b/VAR.Toolbox/Code/DirectShow/Tools.cs index dd0cc08..3e5731e 100644 --- a/VAR.Toolbox/Code/DirectShow/Tools.cs +++ b/VAR.Toolbox/Code/DirectShow/Tools.cs @@ -18,13 +18,13 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Returns filter's pin. /// - public static IPin GetPin( IBaseFilter filter, PinDirection dir, int num ) + public static IPin GetPin(IBaseFilter filter, PinDirection dir, int num) { IPin[] pin = new IPin[1]; IEnumPins pinsEnum = null; // enum filter pins - if ( filter.EnumPins( out pinsEnum ) == 0 ) + if (filter.EnumPins(out pinsEnum) == 0) { PinDirection pinDir; int n; @@ -32,25 +32,25 @@ namespace VAR.Toolbox.Code.DirectShow try { // get next pin - while ( pinsEnum.Next( 1, pin, out n ) == 0 ) + while (pinsEnum.Next(1, pin, out n) == 0) { // query pin`s direction - pin[0].QueryDirection( out pinDir ); + pin[0].QueryDirection(out pinDir); - if ( pinDir == dir ) + if (pinDir == dir) { - if ( num == 0 ) + if (num == 0) return pin[0]; num--; } - Marshal.ReleaseComObject( pin[0] ); + Marshal.ReleaseComObject(pin[0]); pin[0] = null; } } finally { - Marshal.ReleaseComObject( pinsEnum ); + Marshal.ReleaseComObject(pinsEnum); } } return null; @@ -65,9 +65,9 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Returns filter's pin. /// - public static IPin GetInPin( IBaseFilter filter, int num ) + public static IPin GetInPin(IBaseFilter filter, int num) { - return GetPin( filter, PinDirection.Input, num ); + return GetPin(filter, PinDirection.Input, num); } /// @@ -79,9 +79,9 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Returns filter's pin. /// - public static IPin GetOutPin( IBaseFilter filter, int num ) + public static IPin GetOutPin(IBaseFilter filter, int num) { - return GetPin( filter, PinDirection.Output, num ); + return GetPin(filter, PinDirection.Output, num); } } } diff --git a/VAR.Toolbox/Code/DirectShow/Uuids.cs b/VAR.Toolbox/Code/DirectShow/Uuids.cs index 98270b2..87ae20f 100644 --- a/VAR.Toolbox/Code/DirectShow/Uuids.cs +++ b/VAR.Toolbox/Code/DirectShow/Uuids.cs @@ -6,7 +6,7 @@ namespace VAR.Toolbox.Code.DirectShow /// /// DirectShow class IDs. /// - [ComVisible( false )] + [ComVisible(false)] static internal class Clsid { /// @@ -16,7 +16,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to CLSID_SystemDeviceEnum. /// public static readonly Guid SystemDeviceEnum = - new Guid( 0x62BE5D10, 0x60EB, 0x11D0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86 ); + new Guid(0x62BE5D10, 0x60EB, 0x11D0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86); /// /// Filter graph. @@ -25,7 +25,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to CLSID_FilterGraph. /// public static readonly Guid FilterGraph = - new Guid( 0xE436EBB3, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EBB3, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// Sample grabber. @@ -34,7 +34,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to CLSID_SampleGrabber. /// public static readonly Guid SampleGrabber = - new Guid( 0xC1F400A0, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37 ); + new Guid(0xC1F400A0, 0x3F08, 0x11D3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37); /// /// Capture graph builder. @@ -43,7 +43,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to CLSID_CaptureGraphBuilder2. /// public static readonly Guid CaptureGraphBuilder2 = - new Guid( 0xBF87B6E1, 0x8C27, 0x11D0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5 ); + new Guid(0xBF87B6E1, 0x8C27, 0x11D0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5); /// /// Async reader. @@ -52,7 +52,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to CLSID_AsyncReader. /// public static readonly Guid AsyncReader = - new Guid( 0xE436EBB5, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EBB5, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); public static readonly Guid NullRenderer = @@ -64,7 +64,7 @@ namespace VAR.Toolbox.Code.DirectShow /// DirectShow format types. /// /// - [ComVisible( false )] + [ComVisible(false)] static internal class FormatType { /// @@ -74,7 +74,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to FORMAT_VideoInfo. /// public static readonly Guid VideoInfo = - new Guid( 0x05589F80, 0xC356, 0x11CE, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A ); + new Guid(0x05589F80, 0xC356, 0x11CE, 0xBF, 0x01, 0x00, 0xAA, 0x00, 0x55, 0x59, 0x5A); /// /// VideoInfo2. @@ -83,14 +83,14 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to FORMAT_VideoInfo2. /// public static readonly Guid VideoInfo2 = - new Guid( 0xf72A76A0, 0xEB0A, 0x11D0, 0xAC, 0xE4, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA ); + new Guid(0xf72A76A0, 0xEB0A, 0x11D0, 0xAC, 0xE4, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA); } /// /// DirectShow media types. /// /// - [ComVisible( false )] + [ComVisible(false)] static internal class MediaType { /// @@ -100,7 +100,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIATYPE_Video. /// public static readonly Guid Video = - new Guid( 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// Interleaved. Used by Digital Video (DV). @@ -109,7 +109,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIATYPE_Interleaved. /// public static readonly Guid Interleaved = - new Guid( 0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x73766169, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// Audio. @@ -118,7 +118,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIATYPE_Audio. /// public static readonly Guid Audio = - new Guid( 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// Text. @@ -127,7 +127,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIATYPE_Text. /// public static readonly Guid Text = - new Guid( 0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x73747874, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// Byte stream with no time stamps. @@ -136,14 +136,14 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIATYPE_Stream. /// public static readonly Guid Stream = - new Guid( 0xE436EB83, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB83, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); } /// /// DirectShow media subtypes. /// /// - [ComVisible( false )] + [ComVisible(false)] static internal class MediaSubType { /// @@ -153,7 +153,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_YUYV. /// public static readonly Guid YUYV = - new Guid( 0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x56595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// IYUV. @@ -162,7 +162,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_IYUV. /// public static readonly Guid IYUV = - new Guid( 0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x56555949, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// A DV encoding format. (FOURCC 'DVSD') @@ -171,7 +171,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_DVSD. /// public static readonly Guid DVSD = - new Guid( 0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 ); + new Guid(0x44535644, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); /// /// RGB, 1 bit per pixel (bpp), palettized. @@ -180,7 +180,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB1. /// public static readonly Guid RGB1 = - new Guid( 0xE436EB78, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB78, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// RGB, 4 bpp, palettized. @@ -189,7 +189,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB4. /// public static readonly Guid RGB4 = - new Guid( 0xE436EB79, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB79, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// RGB, 8 bpp. @@ -198,7 +198,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB8. /// public static readonly Guid RGB8 = - new Guid( 0xE436EB7A, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB7A, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// RGB 565, 16 bpp. @@ -207,7 +207,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB565. /// public static readonly Guid RGB565 = - new Guid( 0xE436EB7B, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB7B, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// RGB 555, 16 bpp. @@ -216,7 +216,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB555. /// public static readonly Guid RGB555 = - new Guid( 0xE436EB7C, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB7C, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// RGB, 24 bpp. @@ -225,7 +225,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB24. /// public static readonly Guid RGB24 = - new Guid( 0xE436Eb7D, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436Eb7D, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// RGB, 32 bpp, no alpha channel. @@ -234,7 +234,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_RGB32. /// public static readonly Guid RGB32 = - new Guid( 0xE436EB7E, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB7E, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// Data from AVI file. @@ -243,7 +243,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_Avi. /// public static readonly Guid Avi = - new Guid( 0xE436EB88, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70 ); + new Guid(0xE436EB88, 0x524F, 0x11CE, 0x9F, 0x53, 0x00, 0x20, 0xAF, 0x0B, 0xA7, 0x70); /// /// Advanced Streaming Format (ASF). @@ -252,14 +252,14 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to MEDIASUBTYPE_Asf. /// public static readonly Guid Asf = - new Guid( 0x3DB80F90, 0x9412, 0x11D1, 0xAD, 0xED, 0x00, 0x00, 0xF8, 0x75, 0x4B, 0x99 ); + new Guid(0x3DB80F90, 0x9412, 0x11D1, 0xAD, 0xED, 0x00, 0x00, 0xF8, 0x75, 0x4B, 0x99); } /// /// DirectShow pin categories. /// /// - [ComVisible( false )] + [ComVisible(false)] static internal class PinCategory { /// @@ -269,7 +269,7 @@ namespace VAR.Toolbox.Code.DirectShow /// Equals to PIN_CATEGORY_CAPTURE. /// public static readonly Guid Capture = - new Guid( 0xFB6C4281, 0x0353, 0x11D1, 0x90, 0x5F, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA ); + new Guid(0xFB6C4281, 0x0353, 0x11D1, 0x90, 0x5F, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA); /// /// Preview pin. diff --git a/VAR.Toolbox/Code/Mouse.cs b/VAR.Toolbox/Code/Mouse.cs index da03ae8..6454d6b 100644 --- a/VAR.Toolbox/Code/Mouse.cs +++ b/VAR.Toolbox/Code/Mouse.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using VAR.Toolbox.Code.Windows; namespace VAR.Toolbox.Code { diff --git a/VAR.Toolbox/Code/ProxyCmdExecutorWMIC.cs b/VAR.Toolbox/Code/ProxyCmdExecutorWMIC.cs index da60e1d..5e8517c 100644 --- a/VAR.Toolbox/Code/ProxyCmdExecutorWMIC.cs +++ b/VAR.Toolbox/Code/ProxyCmdExecutorWMIC.cs @@ -2,7 +2,7 @@ namespace VAR.Toolbox.Code { - internal class ProxyCmdExecutorWMIC : IProxyCmdExecutor + public class ProxyCmdExecutorWMIC : IProxyCmdExecutor { private string _configWMIC; diff --git a/VAR.Toolbox/Code/Screenshooter.cs b/VAR.Toolbox/Code/Screenshooter.cs index 534da6e..1937ed4 100644 --- a/VAR.Toolbox/Code/Screenshooter.cs +++ b/VAR.Toolbox/Code/Screenshooter.cs @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Windows.Forms; +using VAR.Toolbox.Code.Windows; namespace VAR.Toolbox.Code { diff --git a/VAR.Toolbox/Code/TextCoderHexToAscii.cs b/VAR.Toolbox/Code/TextCoderHexToAscii.cs index c315d2a..6422867 100644 --- a/VAR.Toolbox/Code/TextCoderHexToAscii.cs +++ b/VAR.Toolbox/Code/TextCoderHexToAscii.cs @@ -1,9 +1,8 @@ -using System; -using System.Text; +using System.Text; namespace VAR.Toolbox.Code { - class TextCoderHexToAscii : ITextCoder + public class TextCoderHexToAscii : ITextCoder { public const string Name = "HexToAscii"; diff --git a/VAR.Toolbox/Code/TextCoderHexToUtf8.cs b/VAR.Toolbox/Code/TextCoderHexToUtf8.cs index 0a4547a..17594cb 100644 --- a/VAR.Toolbox/Code/TextCoderHexToUtf8.cs +++ b/VAR.Toolbox/Code/TextCoderHexToUtf8.cs @@ -1,9 +1,8 @@ -using System; -using System.Text; +using System.Text; namespace VAR.Toolbox.Code { - class TextCoderHexToUtf8 : ITextCoder + public class TextCoderHexToUtf8 : ITextCoder { public const string Name = "HexToUtf8"; diff --git a/VAR.Toolbox/Code/Webcam.cs b/VAR.Toolbox/Code/Webcam.cs index 4b4c513..6268b51 100644 --- a/VAR.Toolbox/Code/Webcam.cs +++ b/VAR.Toolbox/Code/Webcam.cs @@ -5,6 +5,7 @@ using System.Drawing.Imaging; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using VAR.Toolbox.Code.DirectShow; +using VAR.Toolbox.Code.Windows; namespace VAR.Toolbox.Code { diff --git a/VAR.Toolbox/Code/Win32API.cs b/VAR.Toolbox/Code/Win32API.cs deleted file mode 100644 index 14f6a95..0000000 --- a/VAR.Toolbox/Code/Win32API.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace VAR.Toolbox.Code -{ - public class Win32API - { - [DllImport("PowrProf.dll")] - public static extern Boolean SetSuspendState(Boolean Hibernate, Boolean ForceCritical, Boolean DisableWakeEvent); - - public static uint GetLastInputTime() - { - uint idleTime = 0; - User32.LASTINPUTINFO lastInputInfo = new User32.LASTINPUTINFO(); - lastInputInfo.cbSize = (uint)Marshal.SizeOf(lastInputInfo); - lastInputInfo.dwTime = 0; - uint envTicks = (uint)Environment.TickCount; - if (User32.GetLastInputInfo(ref lastInputInfo)) - { - uint lastInputTick = lastInputInfo.dwTime; - idleTime = envTicks - lastInputTick; - } - return ((idleTime > 0) ? (idleTime / 1000) : 0); - } - } -} \ No newline at end of file diff --git a/VAR.Toolbox/Code/GDI32.cs b/VAR.Toolbox/Code/Windows/GDI32.cs similarity index 93% rename from VAR.Toolbox/Code/GDI32.cs rename to VAR.Toolbox/Code/Windows/GDI32.cs index c401163..bc88d66 100644 --- a/VAR.Toolbox/Code/GDI32.cs +++ b/VAR.Toolbox/Code/Windows/GDI32.cs @@ -1,9 +1,9 @@ using System; using System.Runtime.InteropServices; -namespace VAR.Toolbox.Code +namespace VAR.Toolbox.Code.Windows { - public class GDI32 + public static class GDI32 { public const int SRCCOPY = 0x00CC0020; // BitBlt dwRop parameter diff --git a/VAR.Toolbox/Code/User32.cs b/VAR.Toolbox/Code/Windows/User32.cs similarity index 98% rename from VAR.Toolbox/Code/User32.cs rename to VAR.Toolbox/Code/Windows/User32.cs index 32ee234..f4ec416 100644 --- a/VAR.Toolbox/Code/User32.cs +++ b/VAR.Toolbox/Code/Windows/User32.cs @@ -1,9 +1,9 @@ using System; using System.Runtime.InteropServices; -namespace VAR.Toolbox.Code +namespace VAR.Toolbox.Code.Windows { - public class User32 + public static class User32 { [StructLayout(LayoutKind.Sequential)] public struct INPUT @@ -142,7 +142,7 @@ namespace VAR.Toolbox.Code [DllImport("user32.dll")] public static extern bool ReleaseCapture(); - + [StructLayout(LayoutKind.Sequential)] public struct RECT { diff --git a/VAR.Toolbox/Code/DirectShow/Win32.cs b/VAR.Toolbox/Code/Windows/Win32.cs similarity index 71% rename from VAR.Toolbox/Code/DirectShow/Win32.cs rename to VAR.Toolbox/Code/Windows/Win32.cs index 7751789..a5cf4d7 100644 --- a/VAR.Toolbox/Code/DirectShow/Win32.cs +++ b/VAR.Toolbox/Code/Windows/Win32.cs @@ -1,14 +1,10 @@ -namespace VAR.Toolbox.Code.DirectShow -{ - using System; - using System.Runtime.InteropServices; - using System.Runtime.InteropServices.ComTypes; +using System; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; - /// - /// Some Win32 API used internally. - /// - /// - internal static class Win32 +namespace VAR.Toolbox.Code.Windows +{ + public static class Win32 { /// /// Supplies a pointer to an implementation of IBindCtx (a bind context object). @@ -21,9 +17,9 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Returns S_OK on success. /// - [DllImport( "ole32.dll" )] + [DllImport("ole32.dll")] public static extern - int CreateBindCtx( int reserved, out IBindCtx ppbc ); + int CreateBindCtx(int reserved, out IBindCtx ppbc); /// /// Converts a string into a moniker that identifies the object named by the string. @@ -37,10 +33,10 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Returns S_OK on success. /// - [DllImport( "ole32.dll", CharSet = CharSet.Unicode )] + [DllImport("ole32.dll", CharSet = CharSet.Unicode)] public static extern - int MkParseDisplayName( IBindCtx pbc, string szUserName, - ref int pchEaten, out IMoniker ppmk ); + int MkParseDisplayName(IBindCtx pbc, string szUserName, + ref int pchEaten, out IMoniker ppmk); /// /// Copy a block of memory. @@ -76,19 +72,37 @@ namespace VAR.Toolbox.Code.DirectShow /// /// Returns S_OK on success. /// - [DllImport( "oleaut32.dll" )] + [DllImport("oleaut32.dll")] public static extern int OleCreatePropertyFrame( IntPtr hwndOwner, int x, int y, - [MarshalAs( UnmanagedType.LPWStr )] string caption, + [MarshalAs(UnmanagedType.LPWStr)] string caption, int cObjects, - [MarshalAs( UnmanagedType.Interface, ArraySubType = UnmanagedType.IUnknown )] + [MarshalAs( UnmanagedType.Interface, ArraySubType = UnmanagedType.IUnknown )] ref object ppUnk, int cPages, IntPtr lpPageClsID, int lcid, int dwReserved, - IntPtr lpvReserved ); + IntPtr lpvReserved); + + [DllImport("PowrProf.dll")] + public static extern Boolean SetSuspendState(Boolean Hibernate, Boolean ForceCritical, Boolean DisableWakeEvent); + + public static uint GetLastInputTime() + { + uint idleTime = 0; + User32.LASTINPUTINFO lastInputInfo = new User32.LASTINPUTINFO(); + lastInputInfo.cbSize = (uint)Marshal.SizeOf(lastInputInfo); + lastInputInfo.dwTime = 0; + uint envTicks = (uint)Environment.TickCount; + if (User32.GetLastInputInfo(ref lastInputInfo)) + { + uint lastInputTick = lastInputInfo.dwTime; + idleTime = envTicks - lastInputTick; + } + return ((idleTime > 0) ? (idleTime / 1000) : 0); + } } -} +} \ No newline at end of file diff --git a/VAR.Toolbox/Controls/CtrImageViewer.cs b/VAR.Toolbox/Controls/CtrImageViewer.cs index 341cdf3..7da89b0 100644 --- a/VAR.Toolbox/Controls/CtrImageViewer.cs +++ b/VAR.Toolbox/Controls/CtrImageViewer.cs @@ -8,7 +8,7 @@ namespace VAR.Toolbox.Controls { #region Declarations - Image _imageShow = null; + private Image _imageShow = null; // Image projection private double offsetX = 0; @@ -34,14 +34,14 @@ namespace VAR.Toolbox.Controls } #endregion - + #region Control life cycle public CtrImageViewer() { BackColor = Color.Black; } - + protected override void OnPaint(PaintEventArgs pe) { base.OnPaint(pe); diff --git a/VAR.Toolbox/Program.cs b/VAR.Toolbox/Program.cs index 32912db..a1f7037 100644 --- a/VAR.Toolbox/Program.cs +++ b/VAR.Toolbox/Program.cs @@ -5,13 +5,13 @@ using VAR.Toolbox.UI; namespace VAR.Toolbox { - static class Program + public static class Program { /// /// The main entry point for the application. /// [STAThread] - static void Main() + private static void Main() { Application.ThreadException += Application_ThreadException; diff --git a/VAR.Toolbox/UI/FrmCoder.Designer.cs b/VAR.Toolbox/UI/FrmCoder.Designer.cs index 56fe260..5916ee6 100644 --- a/VAR.Toolbox/UI/FrmCoder.Designer.cs +++ b/VAR.Toolbox/UI/FrmCoder.Designer.cs @@ -44,8 +44,8 @@ // // txtInput // - this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtInput.Location = new System.Drawing.Point(9, 9); this.txtInput.Multiline = true; @@ -67,8 +67,8 @@ // // txtOutput // - this.txtOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.txtOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtOutput.Location = new System.Drawing.Point(7, 9); this.txtOutput.Multiline = true; @@ -80,8 +80,8 @@ // // splitContainer1 // - this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Name = "splitContainer1"; @@ -104,7 +104,7 @@ // // txtKey // - this.txtKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.txtKey.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtKey.Location = new System.Drawing.Point(9, 325); this.txtKey.Multiline = true; diff --git a/VAR.Toolbox/UI/FrmCover.cs b/VAR.Toolbox/UI/FrmCover.cs index ced6fe5..fede8be 100644 --- a/VAR.Toolbox/UI/FrmCover.cs +++ b/VAR.Toolbox/UI/FrmCover.cs @@ -5,7 +5,7 @@ using VAR.Toolbox.Code; namespace VAR.Toolbox.UI { - internal class FrmCover : Form + public class FrmCover : Form { #region Declarations diff --git a/VAR.Toolbox/UI/FrmIPScan.Designer.cs b/VAR.Toolbox/UI/FrmIPScan.Designer.cs index 2b0246c..567bb59 100644 --- a/VAR.Toolbox/UI/FrmIPScan.Designer.cs +++ b/VAR.Toolbox/UI/FrmIPScan.Designer.cs @@ -37,8 +37,8 @@ // // lsvResult // - this.ctrOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.ctrOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ctrOutput.Location = new System.Drawing.Point(9, 59); this.ctrOutput.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); diff --git a/VAR.Toolbox/UI/FrmIPScan.cs b/VAR.Toolbox/UI/FrmIPScan.cs index f528aaa..7dd1150 100644 --- a/VAR.Toolbox/UI/FrmIPScan.cs +++ b/VAR.Toolbox/UI/FrmIPScan.cs @@ -24,7 +24,7 @@ namespace VAR.Toolbox.UI private void PrintStatus(string status) { - if (lblStatus.IsDisposed) { return; } + if (lblStatus.IsDisposed) { return; } if (lblStatus.InvokeRequired) { lblStatus.Invoke((MethodInvoker)(() => { lblStatus.Text = string.Format("Status: {0}", status); })); @@ -35,7 +35,7 @@ namespace VAR.Toolbox.UI Application.DoEvents(); } } - + private void Control_SetEnabled(Control ctrl, bool enabled) { if (ctrl.IsDisposed) { return; } diff --git a/VAR.Toolbox/UI/FrmProxyCmd.Designer.cs b/VAR.Toolbox/UI/FrmProxyCmd.Designer.cs index 4e46845..66d7ea9 100644 --- a/VAR.Toolbox/UI/FrmProxyCmd.Designer.cs +++ b/VAR.Toolbox/UI/FrmProxyCmd.Designer.cs @@ -41,8 +41,8 @@ // // splitMain // - this.splitMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.splitMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitMain.BackColor = System.Drawing.SystemColors.ControlDark; this.splitMain.Location = new System.Drawing.Point(0, 28); @@ -93,7 +93,7 @@ // // ddlCurrentConfig // - this.ddlCurrentConfig.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.ddlCurrentConfig.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ddlCurrentConfig.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.ddlCurrentConfig.FormattingEnabled = true; diff --git a/VAR.Toolbox/UI/FrmProxyCmd.cs b/VAR.Toolbox/UI/FrmProxyCmd.cs index 25ca0d7..0cb18ab 100644 --- a/VAR.Toolbox/UI/FrmProxyCmd.cs +++ b/VAR.Toolbox/UI/FrmProxyCmd.cs @@ -172,7 +172,7 @@ namespace VAR.Toolbox.UI public void LoadConfig() { CleanProxyCmdExecutor(); - + List configItems = FrmProxyCmdConfig.GetConfigurationItems(); string previousSelectedName = null; diff --git a/VAR.Toolbox/UI/FrmProxyCmdConfig.Designer.cs b/VAR.Toolbox/UI/FrmProxyCmdConfig.Designer.cs index c55dad4..b5ce637 100644 --- a/VAR.Toolbox/UI/FrmProxyCmdConfig.Designer.cs +++ b/VAR.Toolbox/UI/FrmProxyCmdConfig.Designer.cs @@ -38,7 +38,7 @@ // // lsvCmdProxyConfigs // - this.lsvCmdProxyConfigs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.lsvCmdProxyConfigs.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.lsvCmdProxyConfigs.FormattingEnabled = true; this.lsvCmdProxyConfigs.Location = new System.Drawing.Point(13, 13); @@ -49,7 +49,7 @@ // // txtCmdProxyConfigName // - this.txtCmdProxyConfigName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtCmdProxyConfigName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtCmdProxyConfigName.Location = new System.Drawing.Point(169, 13); this.txtCmdProxyConfigName.Name = "txtCmdProxyConfigName"; @@ -91,8 +91,8 @@ // // txtCmdProxyConfigContent // - this.txtCmdProxyConfigContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.txtCmdProxyConfigContent.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtCmdProxyConfigContent.Location = new System.Drawing.Point(168, 39); this.txtCmdProxyConfigContent.Multiline = true; diff --git a/VAR.Toolbox/UI/FrmScreenshooter.Designer.cs b/VAR.Toolbox/UI/FrmScreenshooter.Designer.cs index 266057d..30e880f 100644 --- a/VAR.Toolbox/UI/FrmScreenshooter.Designer.cs +++ b/VAR.Toolbox/UI/FrmScreenshooter.Designer.cs @@ -46,8 +46,8 @@ // // picViewer // - this.picViewer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.picViewer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.picViewer.BackColor = System.Drawing.Color.Black; this.picViewer.ImageShow = null; diff --git a/VAR.Toolbox/UI/FrmTestRestService.Designer.cs b/VAR.Toolbox/UI/FrmTestRestService.Designer.cs index db0de02..9cd8f56 100644 --- a/VAR.Toolbox/UI/FrmTestRestService.Designer.cs +++ b/VAR.Toolbox/UI/FrmTestRestService.Designer.cs @@ -43,7 +43,7 @@ // // txtUrl // - this.txtUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtUrl.Location = new System.Drawing.Point(123, 12); this.txtUrl.Name = "txtUrl"; @@ -52,7 +52,7 @@ // // txtUrlApiMethod // - this.txtUrlApiMethod.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtUrlApiMethod.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtUrlApiMethod.Location = new System.Drawing.Point(123, 39); this.txtUrlApiMethod.Name = "txtUrlApiMethod"; @@ -61,7 +61,7 @@ // // txtParameters // - this.txtParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtParameters.Location = new System.Drawing.Point(123, 66); this.txtParameters.Multiline = true; @@ -72,7 +72,7 @@ // // txtBody // - this.txtBody.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtBody.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtBody.Location = new System.Drawing.Point(123, 122); this.txtBody.Multiline = true; @@ -130,8 +130,8 @@ // // txtResult // - this.txtResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.txtResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtResult.Location = new System.Drawing.Point(12, 216); this.txtResult.Multiline = true; diff --git a/VAR.Toolbox/UI/FrmTestRestService.cs b/VAR.Toolbox/UI/FrmTestRestService.cs index 4f36dd4..710a9e0 100644 --- a/VAR.Toolbox/UI/FrmTestRestService.cs +++ b/VAR.Toolbox/UI/FrmTestRestService.cs @@ -39,7 +39,7 @@ namespace VAR.Toolbox.UI txtResult.Text = sbException.ToString(); } } - + /// /// Deseria una cadena a un diccionario string,string /// @@ -105,7 +105,7 @@ namespace VAR.Toolbox.UI return strs; } - + private static CookieContainer _cookieJar = new CookieContainer(); public static string CallApi(string urlService, string urlApiMethod, Dictionary prms, string content) @@ -130,7 +130,7 @@ namespace VAR.Toolbox.UI http.Accept = "application/json"; http.ContentType = "application/json; charset=utf-8"; http.Method = "POST"; - + UTF8Encoding encoding = new UTF8Encoding(); byte[] bytes = encoding.GetBytes(content); @@ -147,6 +147,6 @@ namespace VAR.Toolbox.UI var sr = new StreamReader(stream); return sr.ReadToEnd(); } - + } } diff --git a/VAR.Toolbox/UI/FrmTestSoapService.Designer.cs b/VAR.Toolbox/UI/FrmTestSoapService.Designer.cs index 025ec55..7d7970e 100644 --- a/VAR.Toolbox/UI/FrmTestSoapService.Designer.cs +++ b/VAR.Toolbox/UI/FrmTestSoapService.Designer.cs @@ -79,7 +79,7 @@ // // txtUrl // - this.txtUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtUrl.Location = new System.Drawing.Point(98, 13); this.txtUrl.Name = "txtUrl"; @@ -88,7 +88,7 @@ // // txtInterface // - this.txtInterface.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtInterface.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtInterface.Location = new System.Drawing.Point(98, 40); this.txtInterface.Name = "txtInterface"; @@ -97,7 +97,7 @@ // // txtMethod // - this.txtMethod.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtMethod.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtMethod.Location = new System.Drawing.Point(98, 67); this.txtMethod.Name = "txtMethod"; @@ -106,7 +106,7 @@ // // txtParameters // - this.txtParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtParameters.Location = new System.Drawing.Point(98, 94); this.txtParameters.Multiline = true; @@ -117,8 +117,8 @@ // // txtResult // - this.txtResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.txtResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtResult.Location = new System.Drawing.Point(12, 234); this.txtResult.Multiline = true; diff --git a/VAR.Toolbox/UI/FrmTestSoapService.cs b/VAR.Toolbox/UI/FrmTestSoapService.cs index 9938afe..8bd0400 100644 --- a/VAR.Toolbox/UI/FrmTestSoapService.cs +++ b/VAR.Toolbox/UI/FrmTestSoapService.cs @@ -30,7 +30,7 @@ namespace VAR.Toolbox.UI catch (Exception ex) { StringBuilder sbException = new StringBuilder(); - while(ex != null) + while (ex != null) { sbException.AppendFormat("{0}\r\n{1}\r\n\r\n", ex.Message, ex.StackTrace); ex = ex.InnerException; @@ -104,7 +104,7 @@ namespace VAR.Toolbox.UI return strs; } - + /// /// Llama a un metodo SOAP. Esto requiere que el binding del servicio WCF sea de tipo "basicHttpBinding" /// @@ -132,7 +132,7 @@ namespace VAR.Toolbox.UI foreach (KeyValuePair parm in parms) { sbData.AppendFormat("<{0}>{1}\n", parm.Key, parm.Value); - + // FIXME: Accept null values //sbData.AppendFormat("<{0} i:nil=\"true\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" />\n", parm.Key); } diff --git a/VAR.Toolbox/UI/FrmToolbox.Designer.cs b/VAR.Toolbox/UI/FrmToolbox.Designer.cs index 3bc5c7a..9e073ec 100644 --- a/VAR.Toolbox/UI/FrmToolbox.Designer.cs +++ b/VAR.Toolbox/UI/FrmToolbox.Designer.cs @@ -85,7 +85,7 @@ // // lblToolbox // - this.lblToolbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.lblToolbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblToolbox.Font = new System.Drawing.Font("Microsoft Sans Serif", 27.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblToolbox.Location = new System.Drawing.Point(9, 9); @@ -116,7 +116,7 @@ // // btnExit // - this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.btnExit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.btnExit.Location = new System.Drawing.Point(12, 359); this.btnExit.Name = "btnExit"; diff --git a/VAR.Toolbox/UI/FrmToolbox.cs b/VAR.Toolbox/UI/FrmToolbox.cs index 3a3a131..444d65f 100644 --- a/VAR.Toolbox/UI/FrmToolbox.cs +++ b/VAR.Toolbox/UI/FrmToolbox.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; -using VAR.Toolbox.Code; +using VAR.Toolbox.Code.Windows; namespace VAR.Toolbox.UI { diff --git a/VAR.Toolbox/UI/FrmTunnelTCP.Designer.cs b/VAR.Toolbox/UI/FrmTunnelTCP.Designer.cs index 73dd430..dfe9e81 100644 --- a/VAR.Toolbox/UI/FrmTunnelTCP.Designer.cs +++ b/VAR.Toolbox/UI/FrmTunnelTCP.Designer.cs @@ -90,7 +90,7 @@ // // txtRemoteHost // - this.txtRemoteHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtRemoteHost.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtRemoteHost.Location = new System.Drawing.Point(118, 12); this.txtRemoteHost.Name = "txtRemoteHost"; @@ -113,8 +113,8 @@ // // lsbOutput // - this.ctrOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.ctrOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.ctrOutput.Location = new System.Drawing.Point(12, 108); this.ctrOutput.Name = "lsbOutput"; diff --git a/VAR.Toolbox/UI/FrmTunnelTCP.cs b/VAR.Toolbox/UI/FrmTunnelTCP.cs index 9b743b7..ac9478e 100644 --- a/VAR.Toolbox/UI/FrmTunnelTCP.cs +++ b/VAR.Toolbox/UI/FrmTunnelTCP.cs @@ -56,17 +56,17 @@ namespace VAR.Toolbox.UI }); thread.Start(); } - + private void TunnelTCP(string remoteHost, int remotePort, int localPort) { try { Socket sock; - + sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); sock.Bind(new IPEndPoint(IPAddress.Any, localPort)); sock.Listen(1000); - + while (_running) { if (sock.Poll(100, SelectMode.SelectRead)) @@ -74,7 +74,7 @@ namespace VAR.Toolbox.UI Socket sockCliente = sock.Accept(); sockCliente.Blocking = false; sockCliente.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true); - + ConnectedClient client = new ConnectedClient { hostRemoto = remoteHost, diff --git a/VAR.Toolbox/UI/FrmWebcam.Designer.cs b/VAR.Toolbox/UI/FrmWebcam.Designer.cs index 90a6f0f..9200086 100644 --- a/VAR.Toolbox/UI/FrmWebcam.Designer.cs +++ b/VAR.Toolbox/UI/FrmWebcam.Designer.cs @@ -48,7 +48,7 @@ // // cboWebcams // - this.cboWebcams.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.cboWebcams.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboWebcams.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboWebcams.FormattingEnabled = true; @@ -60,8 +60,8 @@ // // picWebcam // - this.picWebcam.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.picWebcam.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.picWebcam.BackColor = System.Drawing.Color.Black; this.picWebcam.ImageShow = null; diff --git a/VAR.Toolbox/UI/FrmWebcam.cs b/VAR.Toolbox/UI/FrmWebcam.cs index 63213a4..050e657 100644 --- a/VAR.Toolbox/UI/FrmWebcam.cs +++ b/VAR.Toolbox/UI/FrmWebcam.cs @@ -20,14 +20,15 @@ namespace VAR.Toolbox cboWebcams_LoadData(); } - void webcam_NewFrame(object sender, Bitmap frame) + private void webcam_NewFrame(object sender, Bitmap frame) { picWebcam.ImageShow = frame; } private void FrmWebcam_FormClosed(object sender, FormClosedEventArgs e) { - if(webcam!=null){ + if (webcam != null) + { webcam.Stop(); } } diff --git a/VAR.Toolbox/UI/PnlCover.cs b/VAR.Toolbox/UI/PnlCover.cs index 1d87ec6..75b2587 100644 --- a/VAR.Toolbox/UI/PnlCover.cs +++ b/VAR.Toolbox/UI/PnlCover.cs @@ -1,6 +1,6 @@ using System; using System.Windows.Forms; -using VAR.Toolbox.Code; +using VAR.Toolbox.Code.Windows; namespace VAR.Toolbox.UI { @@ -15,7 +15,7 @@ namespace VAR.Toolbox.UI { if (DesignMode) { return; } bool userInactive = false; - uint inactiveTime = Win32API.GetLastInputTime(); + uint inactiveTime = Win32.GetLastInputTime(); lblInactive.Text = String.Format("Inactive by {0} seconds", inactiveTime); @@ -45,7 +45,7 @@ namespace VAR.Toolbox.UI private void CoverScreen() { if (DesignMode) { return; } - if(_frmCover != null) + if (_frmCover != null) { _frmCover.Show(); return; diff --git a/VAR.Toolbox/UI/PnlSuspension.cs b/VAR.Toolbox/UI/PnlSuspension.cs index f9dac64..779a57e 100644 --- a/VAR.Toolbox/UI/PnlSuspension.cs +++ b/VAR.Toolbox/UI/PnlSuspension.cs @@ -1,13 +1,13 @@ using System; using System.Windows.Forms; -using VAR.Toolbox.Code; +using VAR.Toolbox.Code.Windows; namespace VAR.Toolbox.UI { public partial class PnlSuspension : UserControl { private Random rnd = new Random(); - + public PnlSuspension() { InitializeComponent(); @@ -38,16 +38,16 @@ namespace VAR.Toolbox.UI if (ddlCustomHour.SelectedIndex >= 0 && ddlCustomMinute.SelectedIndex >= 0) { - DateTime dtSuspendAtCustom = + DateTime dtSuspendAtCustom = new DateTime( - now.Year, - now.Month, + now.Year, + now.Month, now.Day, ddlCustomHour.SelectedIndex, - ddlCustomMinute.SelectedIndex, + ddlCustomMinute.SelectedIndex, 0) .AddSeconds(Convert.ToInt32(numOffset.Value)); - + if (DateTime.Compare(now, dtSuspendAtCustom) > 0) { if (chkSuspendAtCustom.Checked) @@ -139,7 +139,7 @@ namespace VAR.Toolbox.UI private void SuspendSystem() { - Win32API.SetSuspendState(false, true, false); + Win32.SetSuspendState(false, true, false); } } diff --git a/VAR.Toolbox/VAR.Toolbox.csproj b/VAR.Toolbox/VAR.Toolbox.csproj index 5b2b9cb..b596776 100644 --- a/VAR.Toolbox/VAR.Toolbox.csproj +++ b/VAR.Toolbox/VAR.Toolbox.csproj @@ -42,13 +42,9 @@ - - - - @@ -86,8 +82,7 @@ - - + @@ -100,9 +95,9 @@ - + - + Component