Changes recommended by Rider/Resharper
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,5 +4,6 @@
|
||||
*/bin/*
|
||||
*/obj/*
|
||||
*.csproj.user
|
||||
*.DotSettings.user
|
||||
*.suo
|
||||
.vs
|
||||
|
||||
13
.idea/.idea.VAR.Toolbox/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.VAR.Toolbox/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/contentModel.xml
|
||||
/.idea.VAR.Json.iml
|
||||
/modules.xml
|
||||
/projectSettingsUpdater.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
3
.idea/.idea.VAR.Toolbox/.idea/dictionaries/VAR.xml
generated
Normal file
3
.idea/.idea.VAR.Toolbox/.idea/dictionaries/VAR.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="VAR" />
|
||||
</component>
|
||||
4
.idea/.idea.VAR.Toolbox/.idea/encodings.xml
generated
Normal file
4
.idea/.idea.VAR.Toolbox/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||
</project>
|
||||
8
.idea/.idea.VAR.Toolbox/.idea/indexLayout.xml
generated
Normal file
8
.idea/.idea.VAR.Toolbox/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/.idea.VAR.Toolbox/.idea/vcs.xml
generated
Normal file
8
.idea/.idea.VAR.Toolbox/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/VAR.HttpServer" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/VAR.Json" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -10,8 +10,8 @@ namespace VAR.Toolbox.TestPlugin
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string ToolName { get { return "Test"; } }
|
||||
public string ToolName => "Test";
|
||||
|
||||
public bool HasIcon { get { return false; } }
|
||||
public bool HasIcon => false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,12 @@
|
||||
* Build as class library.
|
||||
* Add reference to ```VAR.Toolbox``` for interface declarations and utilities.
|
||||
* Use the interfaces to extend functionality:
|
||||
* ```IToolForm```: Tool window.
|
||||
* ```IToolPanel```: Tool panels in the main window. Try to fit all on 200px width.
|
||||
* ```ITextCoder```: Text codification clases.
|
||||
* ```IProxyCmdExecutor```: Proxy command executors, mainly for remote executions.
|
||||
* ```IToolForm```: Tool window.
|
||||
* ```IToolPanel```: Tool panels in the main window. Try to fit all on 200px width.
|
||||
* ```ITextCoder```: Text codification clases.
|
||||
* ```IProxyCmdExecutor```: Proxy command executors, mainly for remote executions.
|
||||
|
||||
## Usage
|
||||
|
||||
Put the generated assembly near ```VAR.Toolbox.exe``` it will load as plug-ins any assembly that starts with ```VAR.Toolbox```
|
||||
Put the generated assembly near ```VAR.Toolbox.exe``` it will load as plug-ins any assembly that starts
|
||||
with ```VAR.Toolbox```
|
||||
@@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -9,9 +9,10 @@
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>VAR.Toolbox.TestPlugin</RootNamespace>
|
||||
<AssemblyName>VAR.Toolbox.TestPlugin</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
||||
63
VAR.Toolbox.sln.DotSettings
Normal file
63
VAR.Toolbox.sln.DotSettings
Normal file
@@ -0,0 +1,63 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">NotRequired</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/TRAILING_COMMA_IN_MULTILINE_LISTS/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/TRAILING_COMMA_IN_SINGLELINE_LISTS/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/EMPTY_BLOCK_STYLE/@EntryValue">TOGETHER_SAME_LINE</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_EMBEDDED_BLOCK_ARRANGEMENT/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/PLACE_SIMPLE_EMBEDDED_BLOCK_ON_SAME_LINE/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/HtmlFormatter/ALLOW_FAR_ALIGNMENT/@EntryValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/HtmlFormatter/NormalizeTagNames/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/HtmlFormatter/ProcessingInstructionAttributeIndenting/@EntryValue">OneStep</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/HtmlFormatter/TagAttributeIndenting/@EntryValue">OneStep</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/HtmlFormatter/TagSpaceBeforeHeaderEnd1/@EntryValue">True</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForBuiltInTypes/@EntryValue">UseVarWhenEvident</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/CSharpVarKeywordUsage/ForOtherTypes/@EntryValue">UseVarWhenEvident</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AES/@EntryIndexedValue">AES</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AM/@EntryIndexedValue">AM</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AUX/@EntryIndexedValue">AUX</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BPP/@EntryIndexedValue">BPP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DC/@EntryIndexedValue">DC</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DES/@EntryIndexedValue">DES</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=EPM/@EntryIndexedValue">EPM</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GDI/@EntryIndexedValue">GDI</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RECT/@EntryIndexedValue">RECT</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=RGB/@EntryIndexedValue">RGB</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SCART/@EntryIndexedValue">SCART</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SPDIF/@EntryIndexedValue">SPDIF</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SRCCOPY/@EntryIndexedValue">SRCCOPY</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TCP/@EntryIndexedValue">TCP</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=USB/@EntryIndexedValue">USB</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VAR/@EntryIndexedValue">VAR</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WMIC/@EntryIndexedValue">WMIC</s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=YRYBY/@EntryIndexedValue">YRYBY</s:String>
|
||||
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">False</s:Boolean>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb"><ExtraRule Prefix="T" Suffix="" Style="AaBb_AaBb" /></Policy></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Interfaces/@EntryIndexedValue"><Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=LocalConstants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Locals/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Method/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Parameters/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Property/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=bitblt/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Deserializa/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Screenshooter/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=tbps/@EntryIndexedValue">True</s:Boolean>
|
||||
</wpf:ResourceDictionary>
|
||||
@@ -6,7 +6,8 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
public abstract class BaseFactory<T> where T : INamed
|
||||
{
|
||||
private static Dictionary<string, Type> _dictTypes = null;
|
||||
// ReSharper disable once StaticMemberInGenericType
|
||||
private static Dictionary<string, Type> _dictTypes;
|
||||
|
||||
private static Dictionary<string, Type> GetDict()
|
||||
{
|
||||
@@ -37,8 +38,10 @@ namespace VAR.Toolbox.Code
|
||||
Dictionary<string, Type> dict = GetDict();
|
||||
if (dict.ContainsKey(name) == false)
|
||||
{
|
||||
throw new NotImplementedException(string.Format("Cant create {1} with this name: {0}", name, typeof(T).Name));
|
||||
throw new NotImplementedException(string.Format("Cant create {1} with this name: {0}", name,
|
||||
typeof(T).Name));
|
||||
}
|
||||
|
||||
Type type = dict[name];
|
||||
|
||||
T instance = (T)Activator.CreateInstance(type);
|
||||
@@ -55,10 +58,13 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
return (T)(object)null;
|
||||
}
|
||||
|
||||
if (dict.ContainsKey(name) == false)
|
||||
{
|
||||
throw new NotImplementedException(string.Format("Cant create {1} with this config: {0}", config, typeof(T).Name));
|
||||
throw new NotImplementedException(string.Format("Cant create {1} with this config: {0}", config,
|
||||
typeof(T).Name));
|
||||
}
|
||||
|
||||
Type type = dict[name];
|
||||
|
||||
T instance = (T)Activator.CreateInstance(type, new object[] { nextConfig });
|
||||
@@ -70,4 +76,4 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,26 +11,32 @@
|
||||
/// Pan control.
|
||||
/// </summary>
|
||||
Pan = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Tilt control.
|
||||
/// </summary>
|
||||
Tilt,
|
||||
|
||||
/// <summary>
|
||||
/// Roll control.
|
||||
/// </summary>
|
||||
Roll,
|
||||
|
||||
/// <summary>
|
||||
/// Zoom control.
|
||||
/// </summary>
|
||||
Zoom,
|
||||
|
||||
/// <summary>
|
||||
/// Exposure control.
|
||||
/// </summary>
|
||||
Exposure,
|
||||
|
||||
/// <summary>
|
||||
/// Iris control.
|
||||
/// </summary>
|
||||
Iris,
|
||||
|
||||
/// <summary>
|
||||
/// Focus control.
|
||||
/// </summary>
|
||||
@@ -47,13 +53,15 @@
|
||||
/// No control flag.
|
||||
/// </summary>
|
||||
None = 0x0,
|
||||
|
||||
/// <summary>
|
||||
/// Auto control Flag.
|
||||
/// </summary>
|
||||
Auto = 0x0001,
|
||||
|
||||
/// <summary>
|
||||
/// Manual control Flag.
|
||||
/// </summary>
|
||||
Manual = 0x0002
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
@@ -8,15 +7,15 @@
|
||||
/// or shutter speed. To obtain this interface, query the filter that controls the camera.
|
||||
/// </summary>
|
||||
[ComImport,
|
||||
Guid("C6E13370-30AC-11d0-A18C-00A0C9118956"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("C6E13370-30AC-11d0-A18C-00A0C9118956"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMCameraControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the range and default value of a specified camera property.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="Property">Specifies the property to query.</param>
|
||||
/// <param name="property">Specifies the property to query.</param>
|
||||
/// <param name="pMin">Receives the minimum value of the property.</param>
|
||||
/// <param name="pMax">Receives the maximum value of the property.</param>
|
||||
/// <param name="pSteppingDelta">Receives the step size for the property.</param>
|
||||
@@ -27,47 +26,47 @@
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetRange(
|
||||
[In] CameraControlProperty Property,
|
||||
[In] CameraControlProperty property,
|
||||
[Out] out int pMin,
|
||||
[Out] out int pMax,
|
||||
[Out] out int pSteppingDelta,
|
||||
[Out] out int pDefault,
|
||||
[Out] out CameraControlFlags pCapsFlags
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a specified property on the camera.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="Property">Specifies the property to set.</param>
|
||||
/// <param name="property">Specifies the property to set.</param>
|
||||
/// <param name="lValue">Specifies the new value of the property.</param>
|
||||
/// <param name="Flags">Specifies the desired control setting, as a member of the CameraControlFlags enumeration.</param>
|
||||
/// <param name="flags">Specifies the desired control setting, as a member of the CameraControlFlags enumeration.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Set(
|
||||
[In] CameraControlProperty Property,
|
||||
[In] CameraControlProperty property,
|
||||
[In] int lValue,
|
||||
[In] CameraControlFlags Flags
|
||||
);
|
||||
[In] CameraControlFlags flags
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current setting of a camera property.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="Property">Specifies the property to retrieve.</param>
|
||||
/// <param name="property">Specifies the property to retrieve.</param>
|
||||
/// <param name="lValue">Receives the value of the property.</param>
|
||||
/// <param name="Flags">Receives a member of the CameraControlFlags enumeration.
|
||||
/// <param name="flags">Receives a member of the CameraControlFlags enumeration.
|
||||
/// The returned value indicates whether the setting is controlled manually or automatically.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int Get(
|
||||
[In] CameraControlProperty Property,
|
||||
[In] CameraControlProperty property,
|
||||
[Out] out int lValue,
|
||||
[Out] out CameraControlFlags Flags
|
||||
);
|
||||
[Out] out CameraControlFlags flags
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma warning disable IDE1006
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
@@ -9,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// The IAMCrossbar interface routes signals from an analog or digital source to a video capture filter.
|
||||
/// </summary>
|
||||
[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
|
||||
{
|
||||
/// <summary>
|
||||
@@ -79,4 +78,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[Out] out int pinIndexRelated,
|
||||
[Out] out PhysicalConnectorType physicalType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
@@ -9,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("C6E13340-30AC-11d0-A18C-00A0C9118956"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("C6E13340-30AC-11d0-A18C-00A0C9118956"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMStreamConfig
|
||||
{
|
||||
/// <summary>
|
||||
@@ -60,8 +59,10 @@ 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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("6A2E0670-28E4-11D0-A18c-00A0C9118956"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("6A2E0670-28E4-11D0-A18c-00A0C9118956"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IAMVideoControl
|
||||
{
|
||||
/// <summary>
|
||||
@@ -101,4 +101,4 @@
|
||||
[Out] out int listSize,
|
||||
[Out] out IntPtr frameRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A86895-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A86895-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IBaseFilter
|
||||
{
|
||||
// --- IPersist Methods
|
||||
@@ -19,12 +19,12 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// Returns the class identifier (CLSID) for the component object.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="ClassID">Points to the location of the CLSID on return.</param>
|
||||
/// <param name="classID">Points to the location of the CLSID on return.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetClassID([Out] out Guid ClassID);
|
||||
int GetClassID([Out] out Guid classID);
|
||||
|
||||
// --- IMediaFilter Methods
|
||||
|
||||
@@ -151,4 +151,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int QueryVendorInfo([Out, MarshalAs(UnmanagedType.LPWStr)] out string vendorInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
// ReSharper disable IdentifierTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
@@ -8,8 +10,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ICaptureGraphBuilder2
|
||||
{
|
||||
/// <summary>
|
||||
@@ -48,14 +50,15 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetOutputFileName(
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] Guid type,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)]
|
||||
Guid type,
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[Out] out IBaseFilter baseFilter,
|
||||
[Out] out IntPtr fileSinkFilter
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Searche the graph for a specified interface, starting from a specified filter.
|
||||
/// Search the graph for a specified interface, starting from a specified filter.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="category">GUID that specifies the search criteria.</param>
|
||||
@@ -68,12 +71,16 @@ 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
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Connect an output pin on a source filter to a rendering filter, optionally through a compression filter.
|
||||
@@ -89,12 +96,15 @@ 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
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Set the start and stop times for one or more streams of captured data.
|
||||
@@ -114,14 +124,17 @@ 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,
|
||||
[In] short stopCookie
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Preallocate a capture file to a specified size.
|
||||
@@ -136,7 +149,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
int AllocCapFile(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[In] long size
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Copy the valid media data from a capture file.
|
||||
@@ -155,7 +168,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string newFileName,
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool allowEscAbort,
|
||||
[In] IntPtr callback
|
||||
);
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -173,13 +186,17 @@ 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.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
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("29840822-5B84-11D0-BD3B-00A0C911CE86"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ICreateDevEnum
|
||||
{
|
||||
/// <summary>
|
||||
@@ -27,4 +27,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int CreateClassEnumerator([In] ref Guid type, [Out] out IEnumMoniker enumMoniker, [In] int flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
@@ -9,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A86893-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A86893-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IEnumFilters
|
||||
{
|
||||
/// <summary>
|
||||
@@ -25,7 +24,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int Next([In] int cFilters,
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IBaseFilter[] filters,
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]
|
||||
IBaseFilter[] filters,
|
||||
[Out] out int filtersFetched);
|
||||
|
||||
/// <summary>
|
||||
@@ -61,4 +61,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int Clone([Out] out IEnumFilters enumFilters);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
@@ -8,8 +7,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A86892-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A86892-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IEnumPins
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,7 +23,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int Next([In] int cPins,
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IPin[] pins,
|
||||
[Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]
|
||||
IPin[] pins,
|
||||
[Out] out int pinsFetched);
|
||||
|
||||
/// <summary>
|
||||
@@ -58,4 +58,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int Clone([Out] out IEnumPins enumPins);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
@@ -8,8 +7,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A868A6-0Ad4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A868A6-0Ad4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IFileSourceFilter
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,7 +22,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int Load([In, MarshalAs(UnmanagedType.LPWStr)] string fileName,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the current file.
|
||||
@@ -36,6 +36,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int GetCurFile([Out, MarshalAs(UnmanagedType.LPWStr)] out string fileName,
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType);
|
||||
[Out, MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A8689F-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A8689F-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IFilterGraph
|
||||
{
|
||||
/// <summary>
|
||||
@@ -70,7 +70,9 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[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);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin.
|
||||
@@ -103,4 +105,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int SetDefaultSyncSource();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("36B73882-C2C8-11CF-8B46-00805F6CEF60"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("36B73882-C2C8-11CF-8B46-00805F6CEF60"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IFilterGraph2
|
||||
{
|
||||
// --- IFilterGraph Methods
|
||||
@@ -73,7 +73,9 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[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);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin.
|
||||
@@ -226,8 +228,9 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int ReconnectEx(
|
||||
[In] IPin pin,
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)] AMMediaType mediaType
|
||||
);
|
||||
[In, MarshalAs(UnmanagedType.LPStruct)]
|
||||
AMMediaType mediaType
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Render an output pin, with an option to use existing renderers only.
|
||||
@@ -244,7 +247,6 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[In] IPin outputPin,
|
||||
[In] int flags,
|
||||
[In] IntPtr context
|
||||
);
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A868A9-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A868A9-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IGraphBuilder
|
||||
{
|
||||
// --- IFilterGraph Methods
|
||||
@@ -71,7 +71,9 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[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);
|
||||
|
||||
/// <summary>
|
||||
/// Breaks the existing pin connection and reconnects it to the same pin.
|
||||
@@ -188,4 +190,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int ShouldOperationContinue();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma warning disable IDE1006
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
@@ -11,8 +10,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A868B1-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
Guid("56A868B1-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
internal interface IMediaControl
|
||||
{
|
||||
/// <summary>
|
||||
@@ -47,7 +46,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="timeout">Duration of the time-out, in milliseconds, or INFINITE to specify an infinite time-out.</param>
|
||||
/// <param name="filterState">Ìariable that receives a member of the <b>FILTER_STATE</b> enumeration.</param>
|
||||
/// <param name="filterState">Variable that receives a member of the <b>FILTER_STATE</b> enumeration.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
@@ -87,7 +86,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_FilterCollection(
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)] out object collection);
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)]
|
||||
out object collection);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a collection of all the filters listed in the registry.
|
||||
@@ -99,7 +99,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
[PreserveSig]
|
||||
int get_RegFilterCollection(
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)] out object collection);
|
||||
[Out, MarshalAs(UnmanagedType.IDispatch)]
|
||||
out object collection);
|
||||
|
||||
/// <summary>
|
||||
/// Pauses the filter graph, allowing filters to queue data, and then stops the filter graph.
|
||||
@@ -110,4 +111,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int StopWhenReady();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@
|
||||
/// filter graph's default handling of events.
|
||||
/// </summary>
|
||||
[ComVisible(true), ComImport,
|
||||
Guid("56a868c0-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
Guid("56a868c0-0ad4-11ce-b03a-0020af0ba770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
internal interface IMediaEventEx
|
||||
{
|
||||
/// <summary>
|
||||
@@ -34,7 +34,8 @@
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[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);
|
||||
|
||||
/// <summary>
|
||||
/// Waits for the filter graph to render all available data.
|
||||
@@ -85,14 +86,14 @@
|
||||
/// Registers a window to process event notifications.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="hwnd">Handle to the window, or <see cref="IntPtr.Zero"/> to stop receiving event messages.</param>
|
||||
/// <param name="hWnd">Handle to the window, or <see cref="IntPtr.Zero"/> to stop receiving event messages.</param>
|
||||
/// <param name="lMsg">Window message to be passed as the notification.</param>
|
||||
/// <param name="lInstanceData">Value to be passed as the <i>lParam</i> parameter for the <i>lMsg</i> message.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int SetNotifyWindow(IntPtr hwnd, int lMsg, IntPtr lInstanceData);
|
||||
int SetNotifyWindow(IntPtr hWnd, int lMsg, IntPtr lInstanceData);
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables event notifications.
|
||||
@@ -116,4 +117,4 @@
|
||||
[PreserveSig]
|
||||
int GetNotifyFlags(out int lplNoNotifyFlags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
// ReSharper disable IdentifierTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
@@ -9,8 +11,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[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
|
||||
@@ -87,5 +89,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int GetSyncSource([Out] out IReferenceClock pClock);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// handler to use in the client process, as it is used in the default implementation of marshaling.
|
||||
/// </summary>
|
||||
[ComImport,
|
||||
Guid("0000010c-0000-0000-C000-000000000046"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
Guid("0000010c-0000-0000-C000-000000000046"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
internal interface IPersist
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,4 +20,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int GetClassID([Out] out Guid pClassID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A86891-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("56A86891-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IPin
|
||||
{
|
||||
/// <summary>
|
||||
@@ -181,4 +181,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
long stop,
|
||||
double rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("55272A00-42CB-11CE-8135-00AA004BB851"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("55272A00-42CB-11CE-8135-00AA004BB851"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface IPropertyBag
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,7 +26,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int Read(
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string propertyName,
|
||||
[In, Out, MarshalAs(UnmanagedType.Struct)] ref object pVar,
|
||||
[In, Out, MarshalAs(UnmanagedType.Struct)]
|
||||
ref object pVar,
|
||||
[In] IntPtr pErrorLog);
|
||||
|
||||
/// <summary>
|
||||
@@ -43,4 +44,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[In, MarshalAs(UnmanagedType.LPWStr)] string propertyName,
|
||||
[In, MarshalAs(UnmanagedType.Struct)] ref object pVar);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,6 @@
|
||||
// ReSharper disable CommentTypo
|
||||
// ReSharper disable IdentifierTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
@@ -11,8 +14,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// retrieve the current reference time, or to request notification of an elapsed time.
|
||||
/// </summary>
|
||||
[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
|
||||
{
|
||||
/// <summary>
|
||||
@@ -73,4 +76,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int Unadvise([In] int dwAdviseCookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("6B652FFF-11FE-4FCE-92AD-0266B5D7C78F"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ISampleGrabber
|
||||
{
|
||||
/// <summary>
|
||||
@@ -93,4 +93,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int SetCallback(ISampleGrabberCB callback, int whichMethodToCallback);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("0579154A-2B53-4994-B0D0-E773148EFF85"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("0579154A-2B53-4994-B0D0-E773148EFF85"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ISampleGrabberCB
|
||||
{
|
||||
/// <summary>
|
||||
@@ -25,7 +25,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
int SampleCB(double sampleTime, IntPtr sample);
|
||||
|
||||
/// <summary>
|
||||
/// Callback method that receives a pointer to the sample bufferþ
|
||||
/// Callback method that receives a pointer to the sample buffer
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="sampleTime">Starting time of the sample, in seconds.</param>
|
||||
@@ -37,4 +37,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int BufferCB(double sampleTime, IntPtr buffer, int bufferLen);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
// ReSharper disable CommentTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
@@ -8,8 +9,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("B196B28B-BAB4-101A-B69C-00AA00341D07"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
Guid("B196B28B-BAB4-101A-B69C-00AA00341D07"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
|
||||
internal interface ISpecifyPropertyPages
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,4 +27,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int GetPages(out CAUUID pPages);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComImport,
|
||||
Guid("56A868B4-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
Guid("56A868B4-0AD4-11CE-B03A-0020AF0BA770"),
|
||||
InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
internal interface IVideoWindow
|
||||
{
|
||||
/// <summary>
|
||||
@@ -95,7 +95,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// Queries whether the video renderer automatically shows the video window when it receives video data.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="autoShow">REceives window auto show flag.</param>
|
||||
/// <param name="autoShow">Receives window auto show flag.</param>
|
||||
///
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
@@ -257,7 +257,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
int get_Height(out int height);
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a parent window for the video windowþ
|
||||
/// Specifies a parent window for the video window
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="owner">Specifies a handle to the parent window.</param>
|
||||
@@ -268,7 +268,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
int put_Owner(IntPtr owner);
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the video window's parent window, if anyþ
|
||||
/// Retrieves the video window's parent window, if any
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="owner">Parent window's handle.</param>
|
||||
@@ -360,7 +360,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// Forwards a message to the video window.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="hwnd">Handle to the window.</param>
|
||||
/// <param name="hWnd">Handle to the window.</param>
|
||||
/// <param name="msg">Specifies the message.</param>
|
||||
/// <param name="wParam">Message parameter.</param>
|
||||
/// <param name="lParam">Message parameter.</param>
|
||||
@@ -368,10 +368,10 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// <returns>Return's <b>HRESULT</b> error code.</returns>
|
||||
///
|
||||
[PreserveSig]
|
||||
int NotifyOwnerMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);
|
||||
int NotifyOwnerMessage(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the position of the video windowþ
|
||||
/// Sets the position of the video window
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="left">Specifies the x-coordinate, in pixels.</param>
|
||||
@@ -458,4 +458,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
[PreserveSig]
|
||||
int IsCursorHidden([Out, MarshalAs(UnmanagedType.Bool)] out bool hideCursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
// ReSharper disable CommentTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the physical type of pin (audio or video).
|
||||
@@ -10,62 +12,77 @@
|
||||
/// connection type should not be changed (input) or was not determined (output).
|
||||
/// </summary>
|
||||
Default = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a tuner pin for video.
|
||||
/// </summary>
|
||||
VideoTuner = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a composite pin for video.
|
||||
/// </summary>
|
||||
VideoComposite,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an S-Video (Y/C video) pin.
|
||||
/// </summary>
|
||||
VideoSVideo,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an RGB pin for video.
|
||||
/// </summary>
|
||||
VideoRGB,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a YRYBY (Y, R–Y, B–Y) pin for video.
|
||||
/// </summary>
|
||||
VideoYRYBY,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a serial digital pin for video.
|
||||
/// </summary>
|
||||
VideoSerialDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a parallel digital pin for video.
|
||||
/// </summary>
|
||||
VideoParallelDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a SCSI (Small Computer System Interface) pin for video.
|
||||
/// </summary>
|
||||
VideoSCSI,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an AUX (auxiliary) pin for video.
|
||||
/// </summary>
|
||||
VideoAUX,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an IEEE 1394 pin for video.
|
||||
/// </summary>
|
||||
Video1394,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a USB (Universal Serial Bus) pin for video.
|
||||
/// </summary>
|
||||
VideoUSB,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a video decoder pin.
|
||||
/// </summary>
|
||||
VideoDecoder,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a video encoder pin.
|
||||
/// </summary>
|
||||
VideoEncoder,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a SCART (Peritel) pin for video.
|
||||
/// </summary>
|
||||
VideoSCART,
|
||||
|
||||
/// <summary>
|
||||
/// Not used.
|
||||
/// </summary>
|
||||
@@ -75,41 +92,50 @@
|
||||
/// Specifies a tuner pin for audio.
|
||||
/// </summary>
|
||||
AudioTuner = 4096,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a line pin for audio.
|
||||
/// </summary>
|
||||
AudioLine,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a microphone pin.
|
||||
/// </summary>
|
||||
AudioMic,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an AES/EBU (Audio Engineering Society/European Broadcast Union) digital pin for audio.
|
||||
/// </summary>
|
||||
AudioAESDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an S/PDIF (Sony/Philips Digital Interface Format) digital pin for audio.
|
||||
/// </summary>
|
||||
AudioSPDIFDigital,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a SCSI pin for audio.
|
||||
/// </summary>
|
||||
AudioSCSI,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an AUX pin for audio.
|
||||
/// </summary>
|
||||
AudioAUX,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an IEEE 1394 pin for audio.
|
||||
/// </summary>
|
||||
Audio1394,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies a USB pin for audio.
|
||||
/// </summary>
|
||||
AudioUSB,
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an audio decoder pin.
|
||||
/// </summary>
|
||||
AudioDecoder
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable CommentTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
@@ -31,7 +35,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
internal class AMMediaType : IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
@@ -47,14 +51,12 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// <summary>
|
||||
/// If <b>true</b>, samples are of a fixed size.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool FixedSizeSamples = true;
|
||||
[MarshalAs(UnmanagedType.Bool)] public bool FixedSizeSamples = true;
|
||||
|
||||
/// <summary>
|
||||
/// If <b>true</b>, samples are compressed using temporal (interframe) compression.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.Bool)]
|
||||
public bool TemporalCompression;
|
||||
[MarshalAs(UnmanagedType.Bool)] public bool TemporalCompression;
|
||||
|
||||
/// <summary>
|
||||
/// Size of the sample in bytes. For compressed data, the value can be zero.
|
||||
@@ -131,7 +133,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
||||
StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
||||
internal struct PinInfo
|
||||
{
|
||||
/// <summary>
|
||||
@@ -153,7 +155,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
|
||||
// FILTER_INFO
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
||||
StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
|
||||
internal struct FilterInfo
|
||||
{
|
||||
/// <summary>
|
||||
@@ -175,7 +177,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
internal struct VideoInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
@@ -216,7 +218,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
internal struct VideoInfoHeader2
|
||||
{
|
||||
/// <summary>
|
||||
@@ -285,7 +287,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||
StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||
internal struct BitmapInfoHeader
|
||||
{
|
||||
/// <summary>
|
||||
@@ -351,7 +353,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
internal struct RECT
|
||||
{
|
||||
/// <summary>
|
||||
@@ -382,7 +384,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false),
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
StructLayout(LayoutKind.Sequential)]
|
||||
internal struct CAUUID
|
||||
{
|
||||
/// <summary>
|
||||
@@ -421,17 +423,18 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
internal enum DsEvCode
|
||||
{
|
||||
None,
|
||||
Complete = 0x01, // EC_COMPLETE
|
||||
DeviceLost = 0x1F, // EC_DEVICE_LOST
|
||||
Complete = 0x01, // EC_COMPLETE
|
||||
DeviceLost = 0x1F, // EC_DEVICE_LOST
|
||||
//(...) not yet interested in other events
|
||||
}
|
||||
|
||||
[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
|
||||
// ReSharper disable InconsistentNaming
|
||||
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,
|
||||
@@ -449,7 +452,9 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
SECAM_K1 = 0x00020000,
|
||||
SECAM_L = 0x00040000,
|
||||
SECAM_L1 = 0x00080000,
|
||||
PAL_N_COMBO = 0x00100000 // Argentina
|
||||
|
||||
PAL_N_COMBO = 0x00100000 // Argentina
|
||||
// ReSharper restore InconsistentNaming
|
||||
}
|
||||
|
||||
[Flags, ComVisible(false)]
|
||||
@@ -462,7 +467,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential), ComVisible(false)]
|
||||
internal class VideoStreamConfigCaps // VIDEO_STREAM_CONFIG_CAPS
|
||||
internal class VideoStreamConfigCaps // VIDEO_STREAM_CONFIG_CAPS
|
||||
{
|
||||
public Guid Guid;
|
||||
public AnalogVideoStandard VideoStandard;
|
||||
@@ -507,4 +512,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
State_Running
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,24 +20,20 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
/// <returns>Returns filter's pin.</returns>
|
||||
///
|
||||
public static IPin GetPin(IBaseFilter filter, PinDirection dir, int num)
|
||||
private 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 IEnumPins pinsEnum) == 0)
|
||||
{
|
||||
PinDirection pinDir;
|
||||
int n;
|
||||
|
||||
try
|
||||
{
|
||||
// get next pin
|
||||
while (pinsEnum.Next(1, pin, out n) == 0)
|
||||
while (pinsEnum.Next(1, pin, out int _) == 0)
|
||||
{
|
||||
// query pin`s direction
|
||||
pin[0].QueryDirection(out pinDir);
|
||||
pin[0].QueryDirection(out PinDirection pinDir);
|
||||
|
||||
if (pinDir == dir)
|
||||
{
|
||||
@@ -55,6 +51,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
Marshal.ReleaseComObject(pinsEnum);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -86,4 +83,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
return GetPin(filter, PinDirection.Output, num);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
// ReSharper disable CommentTypo
|
||||
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace VAR.Toolbox.Code.DirectShow
|
||||
{
|
||||
using System;
|
||||
@@ -7,7 +12,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// DirectShow class IDs.
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
static internal class Clsid
|
||||
internal static class Clsid
|
||||
{
|
||||
/// <summary>
|
||||
/// System device enumerator.
|
||||
@@ -57,7 +62,6 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
|
||||
public static readonly Guid NullRenderer =
|
||||
new Guid(0xC1F400A4, 0x3F08, 0x11d3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -65,7 +69,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
static internal class FormatType
|
||||
internal static class FormatType
|
||||
{
|
||||
/// <summary>
|
||||
/// VideoInfo.
|
||||
@@ -91,7 +95,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
static internal class MediaType
|
||||
internal static class MediaType
|
||||
{
|
||||
/// <summary>
|
||||
/// Video.
|
||||
@@ -144,7 +148,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
static internal class MediaSubType
|
||||
internal static class MediaSubType
|
||||
{
|
||||
/// <summary>
|
||||
/// YUY2 (packed 4:2:2).
|
||||
@@ -260,7 +264,7 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
/// </summary>
|
||||
///
|
||||
[ComVisible(false)]
|
||||
static internal class PinCategory
|
||||
internal static class PinCategory
|
||||
{
|
||||
/// <summary>
|
||||
/// Capture pin.
|
||||
@@ -279,7 +283,6 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
///
|
||||
public static readonly Guid Preview =
|
||||
new Guid(0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -324,4 +327,4 @@ namespace VAR.Toolbox.Code.DirectShow
|
||||
public static readonly Guid AudioCompressorCategory =
|
||||
new Guid(0x33D9A761, 0x90C8, 0x11D0, 0xBD, 0x43, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
public static class EventDispatcher
|
||||
{
|
||||
private static List<IEventListener> _eventListeners = null;
|
||||
private static List<IEventListener> _eventListeners;
|
||||
|
||||
private static IEnumerable<IEventListener> GetEventListeners()
|
||||
{
|
||||
@@ -19,8 +19,7 @@ namespace VAR.Toolbox.Code
|
||||
_eventListeners = new List<IEventListener>();
|
||||
foreach (Type eventListener in eventListeners)
|
||||
{
|
||||
IEventListener eventListenerInstance = Activator.CreateInstance(eventListener) as IEventListener;
|
||||
if (eventListenerInstance != null)
|
||||
if (Activator.CreateInstance(eventListener) is IEventListener eventListenerInstance)
|
||||
{
|
||||
_eventListeners.Add(eventListenerInstance);
|
||||
}
|
||||
@@ -37,6 +36,5 @@ namespace VAR.Toolbox.Code
|
||||
eventListener.ProcessEvent(eventName, eventData);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,13 +7,16 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
public static byte[] HexStringToBytes(string input)
|
||||
{
|
||||
int[] hexValues = new int[] {
|
||||
int[] hexValues = new int[]
|
||||
{
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
|
||||
};
|
||||
if (input.Length % 2 == 1)
|
||||
{
|
||||
throw new Exception("Unenven number of hex digits");
|
||||
throw new Exception("Uneven number of hex digits");
|
||||
}
|
||||
|
||||
byte[] bytes = new byte[input.Length / 2];
|
||||
int count = input.Length;
|
||||
for (int x = 0, i = 0; i < count; i += 2, x += 1)
|
||||
@@ -21,7 +24,7 @@ namespace VAR.Toolbox.Code
|
||||
bytes[x] = (byte)(
|
||||
hexValues[Char.ToUpper(input[i + 0]) - '0'] << 4 |
|
||||
hexValues[Char.ToUpper(input[i + 1]) - '0']
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
return bytes;
|
||||
@@ -38,7 +41,8 @@ namespace VAR.Toolbox.Code
|
||||
sbOutput.Append(HexAlphabet[(b >> 4)]);
|
||||
sbOutput.Append(HexAlphabet[(b & 0xF)]);
|
||||
}
|
||||
|
||||
return sbOutput.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VAR.Toolbox.Code
|
||||
namespace VAR.Toolbox.Code
|
||||
{
|
||||
public interface IEventListener
|
||||
{
|
||||
void ProcessEvent(string eventName, object eventData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,4 @@
|
||||
{
|
||||
void OutputLine(string line);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,19 +6,18 @@ namespace VAR.Toolbox.Code
|
||||
public class Logger
|
||||
{
|
||||
/// <summary>
|
||||
/// Obtiene el StreamWritter de salida
|
||||
/// Obtiene el StreamWriter de salida
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static StreamWriter GetOutputStreamWritter()
|
||||
private static StreamWriter GetOutputStreamWriter()
|
||||
{
|
||||
try
|
||||
{
|
||||
string location = System.Reflection.Assembly.GetEntryAssembly().Location;
|
||||
string location = System.Reflection.Assembly.GetEntryAssembly()?.Location;
|
||||
string path = Path.GetDirectoryName(location);
|
||||
string filenameWithoutExtension = Path.GetFileNameWithoutExtension(location);
|
||||
|
||||
string fileOut = string.Format("{0}/{1}.{2}.txt", path, filenameWithoutExtension,
|
||||
DateTime.UtcNow.ToString("yyyy-MM"));
|
||||
string fileOut = $"{path}/{filenameWithoutExtension}.{DateTime.UtcNow:yyyy-MM}.txt";
|
||||
return File.AppendText(fileOut);
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -28,10 +27,10 @@ namespace VAR.Toolbox.Code
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cierra el StreamWritter de salida
|
||||
/// Cierra el StreamWriter de salida
|
||||
/// </summary>
|
||||
/// <param name="stream">The stream.</param>
|
||||
private static void CloseOutputStreamWritter(StreamWriter stream)
|
||||
private static void CloseOutputStreamWriter(StreamWriter stream)
|
||||
{
|
||||
if (stream != null)
|
||||
{
|
||||
@@ -50,6 +49,7 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
stream.WriteLine(line);
|
||||
}
|
||||
|
||||
Console.Out.WriteLine(line);
|
||||
}
|
||||
|
||||
@@ -61,14 +61,17 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamWriter outStream = GetOutputStreamWritter();
|
||||
StreamWriter outStream = GetOutputStreamWriter();
|
||||
WriteLine(outStream, string.Empty);
|
||||
WriteLine(outStream, string.Format("---------------------------- {0} -----------------------", text));
|
||||
WriteLine(outStream, string.Format("\\- Date: {0}", DateTime.UtcNow.ToString("s")));
|
||||
WriteLine(outStream, $"---------------------------- {text} -----------------------");
|
||||
WriteLine(outStream, $"\\- Date: {DateTime.UtcNow:s}");
|
||||
WriteLine(outStream, string.Empty);
|
||||
CloseOutputStreamWritter(outStream);
|
||||
CloseOutputStreamWriter(outStream);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
/* Nom Nom Nom */
|
||||
}
|
||||
catch (Exception) { /* Nom Nom Nom */}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -79,38 +82,45 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamWriter outStream = GetOutputStreamWritter();
|
||||
WriteLine(outStream, string.Format("{0} -- {1}", DateTime.UtcNow.ToString("s"), text));
|
||||
CloseOutputStreamWritter(outStream);
|
||||
StreamWriter outStream = GetOutputStreamWriter();
|
||||
WriteLine(outStream, $"{DateTime.UtcNow:s} -- {text}");
|
||||
CloseOutputStreamWriter(outStream);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
/* Nom Nom Nom */
|
||||
}
|
||||
catch (Exception) { /* Nom Nom Nom */}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Logea una excepcion
|
||||
/// Logea una excepción
|
||||
/// </summary>
|
||||
/// <param name="ex">The Exception.</param>
|
||||
public static void Log(Exception ex)
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamWriter outStream = GetOutputStreamWritter();
|
||||
StreamWriter outStream = GetOutputStreamWriter();
|
||||
WriteLine(outStream, string.Empty);
|
||||
WriteLine(outStream, string.Format("!!!!!!!!!!!!!!!!!!!!!!!!!!!! {0} !!!!!!!!!!!!!!!!!!!!!!!", "Exception"));
|
||||
WriteLine(outStream, string.Format("\\- Date: {0}", DateTime.UtcNow.ToString("s")));
|
||||
WriteLine(outStream,
|
||||
"!!!!!!!!!!!!!!!!!!!!!!!!!!!! Exception !!!!!!!!!!!!!!!!!!!!!!!");
|
||||
WriteLine(outStream, $"\\- Date: {DateTime.UtcNow:s}");
|
||||
WriteLine(outStream, string.Empty);
|
||||
Exception exAux = ex;
|
||||
while (exAux != null)
|
||||
{
|
||||
WriteLine(outStream, string.Format("Message: {0}", exAux.Message));
|
||||
WriteLine(outStream, string.Format("Stacktrace: {0}", exAux.StackTrace));
|
||||
WriteLine(outStream, $"Message: {exAux.Message}");
|
||||
WriteLine(outStream, $"Stacktrace: {exAux.StackTrace}");
|
||||
exAux = exAux.InnerException;
|
||||
}
|
||||
CloseOutputStreamWritter(outStream);
|
||||
}
|
||||
catch (Exception) { /* Nom Nom Nom */}
|
||||
}
|
||||
|
||||
CloseOutputStreamWriter(outStream);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
/* Nom Nom Nom */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,14 +39,17 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
input.Data.Mouse.Flags = down ? User32.MOUSEEVENTF_LEFTDOWN : User32.MOUSEEVENTF_LEFTUP;
|
||||
}
|
||||
|
||||
if (button == MouseButtons.Middle)
|
||||
{
|
||||
input.Data.Mouse.Flags = down ? User32.MOUSEEVENTF_MIDDLEDOWN : User32.MOUSEEVENTF_MIDDLEUP;
|
||||
}
|
||||
|
||||
if (button == MouseButtons.Right)
|
||||
{
|
||||
input.Data.Mouse.Flags = down ? User32.MOUSEEVENTF_RIGHTDOWN : User32.MOUSEEVENTF_RIGHTUP;
|
||||
}
|
||||
|
||||
User32.INPUT[] inputs = new User32.INPUT[] { input };
|
||||
if (User32.SendInput(1, inputs, Marshal.SizeOf(typeof(User32.INPUT))) == 0)
|
||||
throw new Exception();
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
{
|
||||
bool ExecuteCmd(string cmd, IOutputHandler outputHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,8 @@
|
||||
{
|
||||
public class ProxyCmdExecutorDummy : IProxyCmdExecutor
|
||||
{
|
||||
public string Name { get { return "Dummy"; } }
|
||||
private readonly string _config;
|
||||
public string Name => "Dummy";
|
||||
|
||||
public ProxyCmdExecutorDummy(string config)
|
||||
{
|
||||
@@ -10,12 +11,14 @@
|
||||
{
|
||||
throw new System.ArgumentNullException(nameof(config));
|
||||
}
|
||||
|
||||
_config = config;
|
||||
}
|
||||
|
||||
public bool ExecuteCmd(string cmdString, IOutputHandler outputHandler)
|
||||
{
|
||||
outputHandler.OutputLine(string.Format("DummyExecution: {0}", cmdString));
|
||||
outputHandler.OutputLine($"DummyExecution: {cmdString} | {_config}");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
||||
{
|
||||
public class ProxyCmdExecutorFactory : BaseFactory<IProxyCmdExecutor>
|
||||
{
|
||||
}
|
||||
}
|
||||
public class ProxyCmdExecutorFactory : BaseFactory<IProxyCmdExecutor> { }
|
||||
}
|
||||
@@ -5,9 +5,9 @@ namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
||||
{
|
||||
public class ProxyCmdExecutorThroughSQLServer : IProxyCmdExecutor
|
||||
{
|
||||
public string Name { get { return "SqlServer"; } }
|
||||
public string Name => "SqlServer";
|
||||
|
||||
private readonly string _connectionString = null;
|
||||
private readonly string _connectionString;
|
||||
|
||||
public ProxyCmdExecutorThroughSQLServer(string connectionString)
|
||||
{
|
||||
@@ -27,8 +27,9 @@ namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
||||
string output = Convert.ToString(reader[0]);
|
||||
outputHandler.OutputLine(output);
|
||||
}
|
||||
|
||||
cnx.Close();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
||||
{
|
||||
public class ProxyCmdExecutorWMIC : IProxyCmdExecutor
|
||||
{
|
||||
public string Name { get { return "WMIC"; } }
|
||||
public string Name => "WMIC";
|
||||
|
||||
private readonly string _configWMIC;
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
||||
|
||||
public bool ExecuteCmd(string cmd, IOutputHandler outputHandler)
|
||||
{
|
||||
string parameters = string.Format(" /node:\"{0}\" process call create \"cmd.exe /c \\\"{1}\\\"\"", _configWMIC.Replace("\"", "\\\""), cmd.Replace("\"", "\\\""));
|
||||
string parameters = string.Format(" /node:\"{0}\" process call create \"cmd.exe /c \\\"{1}\\\"\"",
|
||||
_configWMIC.Replace("\"", "\\\""), cmd.Replace("\"", "\\\""));
|
||||
Process process = new Process();
|
||||
process.StartInfo.UseShellExecute = false;
|
||||
process.StartInfo.RedirectStandardOutput = true;
|
||||
|
||||
@@ -17,6 +17,5 @@ namespace VAR.Toolbox.Code
|
||||
interfaceType.IsAssignableFrom(x) &&
|
||||
true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using VAR.Toolbox.Code.Windows;
|
||||
|
||||
namespace VAR.Toolbox.Code
|
||||
{
|
||||
public class Screenshooter
|
||||
public static class Screenshoter
|
||||
{
|
||||
public static Bitmap CaptureScreen(Bitmap bmp = null)
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace VAR.Toolbox.Code
|
||||
int screenHeight = SystemInformation.VirtualScreen.Height;
|
||||
|
||||
// Create a bitmap of the appropriate size to receive the screenshot.
|
||||
if (bmp == null || bmp?.Width != screenWidth || bmp?.Height != screenHeight)
|
||||
if (bmp == null || bmp.Width != screenWidth || bmp.Height != screenHeight)
|
||||
{
|
||||
bmp = new Bitmap(screenWidth, screenHeight);
|
||||
}
|
||||
@@ -27,6 +27,7 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
g.CopyFromScreen(screenLeft, screenTop, 0, 0, bmp.Size);
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
@@ -76,8 +77,5 @@ namespace VAR.Toolbox.Code
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,4 +7,4 @@
|
||||
string Encode(string input, string key);
|
||||
string Decode(string input, string key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
{
|
||||
public class TextCoderBase64ToAscii : ITextCoder
|
||||
{
|
||||
public string Name { get { return "Base64ToAscii"; } }
|
||||
public string Name => "Base64ToAscii";
|
||||
|
||||
public bool NeedsKey { get { return false; } }
|
||||
public bool NeedsKey => false;
|
||||
|
||||
public string Decode(string input, string key)
|
||||
{
|
||||
@@ -23,4 +23,4 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
{
|
||||
public class TextCoderBase64ToUtf8 : ITextCoder
|
||||
{
|
||||
public string Name { get { return "Base64ToUtf8"; } }
|
||||
public string Name => "Base64ToUtf8";
|
||||
|
||||
public bool NeedsKey { get { return false; } }
|
||||
public bool NeedsKey => false;
|
||||
|
||||
public string Decode(string input, string key)
|
||||
{
|
||||
@@ -23,4 +23,4 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
namespace VAR.Toolbox.Code.TextCoders
|
||||
{
|
||||
public class TextCoderFactory : BaseFactory<ITextCoder>
|
||||
{
|
||||
}
|
||||
}
|
||||
public class TextCoderFactory : BaseFactory<ITextCoder> { }
|
||||
}
|
||||
@@ -4,9 +4,9 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
{
|
||||
public class TextCoderHexToAscii : ITextCoder
|
||||
{
|
||||
public string Name { get { return "HexToAscii"; } }
|
||||
public string Name => "HexToAscii";
|
||||
|
||||
public bool NeedsKey { get { return false; } }
|
||||
public bool NeedsKey => false;
|
||||
|
||||
public string Decode(string input, string key)
|
||||
{
|
||||
@@ -20,6 +20,5 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
byte[] toEncodeAsBytes = Encoding.ASCII.GetBytes(input);
|
||||
return HexUtils.BytesToHexString(toEncodeAsBytes);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
{
|
||||
public class TextCoderHexToUtf8 : ITextCoder
|
||||
{
|
||||
public string Name { get { return "HexToUtf8"; } }
|
||||
public string Name => "HexToUtf8";
|
||||
|
||||
public bool NeedsKey { get { return false; } }
|
||||
public bool NeedsKey => false;
|
||||
|
||||
public string Decode(string input, string key)
|
||||
{
|
||||
@@ -21,4 +21,4 @@ namespace VAR.Toolbox.Code.TextCoders
|
||||
return HexUtils.BytesToHexString(toEncodeAsBytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,14 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace VAR.Toolbox.Code
|
||||
{
|
||||
public class WebServicesUtils
|
||||
public static class WebServicesUtils
|
||||
{
|
||||
private static readonly CookieContainer _cookieJar = new CookieContainer();
|
||||
|
||||
public static string CallApi(string urlService, string urlApiMethod, Dictionary<string, string> prms, object content, CookieContainer cookieJar = null, string stringContent = null, Dictionary<string, string> customHeaders = null, string verb = "POST", bool disableCertificateValidation = false)
|
||||
public static string CallApi(string urlService, string urlApiMethod, Dictionary<string, string> parameters,
|
||||
object content, CookieContainer cookieJar = null, string stringContent = null,
|
||||
Dictionary<string, string> customHeaders = null, string verb = "POST",
|
||||
bool disableCertificateValidation = false)
|
||||
{
|
||||
if (urlService?.StartsWith("!") == true)
|
||||
{
|
||||
@@ -20,11 +23,12 @@ namespace VAR.Toolbox.Code
|
||||
}
|
||||
|
||||
if (cookieJar == null) { cookieJar = _cookieJar; }
|
||||
|
||||
try
|
||||
{
|
||||
var sbRequestUrl = new StringBuilder();
|
||||
sbRequestUrl.Append(urlService);
|
||||
if (urlService.EndsWith("/") && urlApiMethod.StartsWith("/"))
|
||||
if (urlService != null && urlService.EndsWith("/") && urlApiMethod.StartsWith("/"))
|
||||
{
|
||||
sbRequestUrl.Append(urlApiMethod.Substring(1));
|
||||
}
|
||||
@@ -32,23 +36,19 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
sbRequestUrl.Append(urlApiMethod);
|
||||
}
|
||||
if (prms != null)
|
||||
|
||||
if (parameters != null)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> pair in prms)
|
||||
foreach (KeyValuePair<string, string> pair in parameters)
|
||||
{
|
||||
if (pair.Value == null)
|
||||
{
|
||||
sbRequestUrl.AppendFormat("&{0}={1}", pair.Key, string.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
sbRequestUrl.AppendFormat("&{0}={1}", pair.Key, HttpServer.HttpUtility.UrlEncode(pair.Value));
|
||||
}
|
||||
sbRequestUrl.AppendFormat("&{0}={1}", pair.Key,
|
||||
pair.Value == null ? string.Empty : HttpServer.HttpUtility.UrlEncode(pair.Value));
|
||||
}
|
||||
}
|
||||
|
||||
if (sbRequestUrl.Length > 2048)
|
||||
{
|
||||
throw new Exception(string.Format("CallApi: Request URL longer than 2048: url: \"{0}\"", sbRequestUrl.ToString()));
|
||||
throw new Exception($"CallApi: Request URL longer than 2048: url: \"{sbRequestUrl}\"");
|
||||
}
|
||||
|
||||
var http = (HttpWebRequest)WebRequest.Create(new Uri(sbRequestUrl.ToString()));
|
||||
@@ -56,7 +56,8 @@ namespace VAR.Toolbox.Code
|
||||
#if UNIFIKAS_COMMONS
|
||||
if (disableCertificateValidation)
|
||||
{
|
||||
http.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => { return true; };
|
||||
http.ServerCertificateValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) => { return true; };
|
||||
}
|
||||
#else
|
||||
if (disableCertificateValidation)
|
||||
@@ -83,6 +84,7 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
parsedContent = stringContent;
|
||||
}
|
||||
|
||||
UTF8Encoding encoding = new UTF8Encoding();
|
||||
byte[] bytes = encoding.GetBytes(parsedContent);
|
||||
|
||||
@@ -97,40 +99,47 @@ namespace VAR.Toolbox.Code
|
||||
responseTask.Wait();
|
||||
WebResponse response = responseTask.Result;
|
||||
var stream = response.GetResponseStream();
|
||||
if (stream == null) { return null; }
|
||||
|
||||
var sr = new StreamReader(stream);
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// ReSharper disable once PossibleIntendedRethrow
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
public static string CallSoapMethod(string url, string method, Dictionary<string, object> parms, string namespaceUrl = "http://tempuri.org", ICredentials credentials = null)
|
||||
public static string CallSoapMethod(string url, string method, Dictionary<string, object> parameters,
|
||||
string namespaceUrl = "http://tempuri.org", ICredentials credentials = null)
|
||||
{
|
||||
// Los servicios SOAP se llaman siempre a través de HTTP.
|
||||
if (url.ToLower().StartsWith("https://"))
|
||||
{
|
||||
url = string.Format("http://{0}", url.Substring("https://".Length));
|
||||
url = $"http://{url.Substring("https://".Length)}";
|
||||
}
|
||||
|
||||
// Construir petición
|
||||
var sbData = new StringBuilder();
|
||||
sbData.AppendFormat("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
|
||||
sbData.AppendFormat("<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">");
|
||||
sbData.AppendFormat(
|
||||
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">");
|
||||
sbData.AppendFormat("<soap:Body>");
|
||||
sbData.AppendFormat("<{0} xmlns=\"{1}\">", method, namespaceUrl);
|
||||
foreach (KeyValuePair<string, object> parm in parms)
|
||||
foreach (KeyValuePair<string, object> parameter in parameters)
|
||||
{
|
||||
if (parm.Value != null && !(parm.Value is DBNull))
|
||||
if (parameter.Value != null && !(parameter.Value is DBNull))
|
||||
{
|
||||
sbData.AppendFormat("<{0}>{1}</{0}>", parm.Key, parm.Value);
|
||||
sbData.AppendFormat("<{0}>{1}</{0}>", parameter.Key, parameter.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
sbData.AppendFormat("<{0} i:nil=\"true\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" />", parm.Key);
|
||||
sbData.AppendFormat("<{0} i:nil=\"true\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" />",
|
||||
parameter.Key);
|
||||
}
|
||||
}
|
||||
|
||||
sbData.AppendFormat("</{0}>", method);
|
||||
sbData.AppendFormat("</soap:Body>");
|
||||
sbData.AppendFormat("</soap:Envelope>");
|
||||
@@ -138,22 +147,20 @@ namespace VAR.Toolbox.Code
|
||||
byte[] postData = Encoding.UTF8.GetBytes(sbData.ToString());
|
||||
|
||||
// Realizar petición
|
||||
var client = new System.Net.WebClient();
|
||||
var client = new WebClient();
|
||||
if (credentials != null)
|
||||
{
|
||||
client.Credentials = credentials;
|
||||
}
|
||||
|
||||
client.Headers.Add("Accept", "text/xml");
|
||||
client.Headers.Add("Accept-Charset", "UTF-8");
|
||||
client.Headers.Add("Content-Type", "text/xml; charset=UTF-8");
|
||||
if (namespaceUrl.ToLower().StartsWith("http"))
|
||||
{
|
||||
client.Headers.Add("SOAPAction", string.Format("\"{0}/{1}\"", namespaceUrl, method));
|
||||
}
|
||||
else
|
||||
{
|
||||
client.Headers.Add("SOAPAction", string.Format("\"{0}:{1}\"", namespaceUrl, method));
|
||||
}
|
||||
client.Headers.Add("SOAPAction",
|
||||
namespaceUrl.ToLower().StartsWith("http")
|
||||
? $"\"{namespaceUrl}/{method}\""
|
||||
: $"\"{namespaceUrl}:{method}\"");
|
||||
|
||||
byte[] data;
|
||||
try
|
||||
{
|
||||
@@ -161,11 +168,11 @@ namespace VAR.Toolbox.Code
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception(string.Format("Failure calling SoapService: URL: {0}", url), ex);
|
||||
throw new Exception($"Failure calling SoapService: URL: {url}", ex);
|
||||
}
|
||||
string strData = System.Text.Encoding.UTF8.GetString(data);
|
||||
|
||||
string strData = Encoding.UTF8.GetString(data);
|
||||
return strData;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma warning disable IDE0018
|
||||
#pragma warning disable IDE0059
|
||||
// ReSharper disable SuspiciousTypeConversion.Global
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,26 +12,23 @@ using System.Runtime.InteropServices.ComTypes;
|
||||
using VAR.Toolbox.Code.DirectShow;
|
||||
using VAR.Toolbox.Code.Windows;
|
||||
|
||||
|
||||
namespace VAR.Toolbox.Code
|
||||
{
|
||||
public class Webcam
|
||||
{
|
||||
#region Declarations
|
||||
|
||||
private readonly IFilterGraph2 graph;
|
||||
private readonly ICaptureGraphBuilder2 capture;
|
||||
private readonly IMediaControl control;
|
||||
private readonly IBaseFilter sourceFilter;
|
||||
private readonly IBaseFilter samplegrabberfilter;
|
||||
private readonly IBaseFilter nullrenderer;
|
||||
private readonly IMediaControl _control;
|
||||
private readonly IBaseFilter _sourceFilter;
|
||||
private readonly IBaseFilter _sampleGrabberFilter;
|
||||
private readonly IBaseFilter _nullRenderer;
|
||||
|
||||
private readonly Grabber grabber;
|
||||
private readonly int _width;
|
||||
private readonly int _height;
|
||||
private readonly int _bpp;
|
||||
|
||||
private readonly int width = 0;
|
||||
private readonly int height = 0;
|
||||
private readonly int bpp = 0;
|
||||
|
||||
private bool active = false;
|
||||
private bool _active;
|
||||
|
||||
private static Dictionary<string, string> _deviceDescriptions;
|
||||
|
||||
@@ -37,11 +36,13 @@ namespace VAR.Toolbox.Code
|
||||
|
||||
#region Properties
|
||||
|
||||
public int Width { get { return width; } }
|
||||
public int Height { get { return height; } }
|
||||
public int BPP { get { return bpp; } }
|
||||
public int Width => _width;
|
||||
|
||||
public bool Active { get { return active; } }
|
||||
public int Height => _height;
|
||||
|
||||
public int BPP => _bpp;
|
||||
|
||||
public bool Active => _active;
|
||||
|
||||
#endregion Properties
|
||||
|
||||
@@ -49,33 +50,29 @@ namespace VAR.Toolbox.Code
|
||||
|
||||
public Webcam(string monikerString)
|
||||
{
|
||||
int result;
|
||||
|
||||
graph = CreateInstanceFromClsid<IFilterGraph2>(Clsid.FilterGraph);
|
||||
capture = CreateInstanceFromClsid<ICaptureGraphBuilder2>(Clsid.CaptureGraphBuilder2);
|
||||
control = (IMediaControl)graph;
|
||||
IFilterGraph2 graph = CreateInstanceFromClsid<IFilterGraph2>(Clsid.FilterGraph);
|
||||
ICaptureGraphBuilder2 capture = CreateInstanceFromClsid<ICaptureGraphBuilder2>(Clsid.CaptureGraphBuilder2);
|
||||
_control = (IMediaControl)graph;
|
||||
capture.SetFiltergraph((IGraphBuilder)graph);
|
||||
|
||||
IBindCtx bindCtx = null;
|
||||
IMoniker moniker = null;
|
||||
|
||||
int n = 0;
|
||||
|
||||
if (Win32.CreateBindCtx(0, out bindCtx) != 0)
|
||||
if (Win32.CreateBindCtx(0, out IBindCtx bindCtx) != 0)
|
||||
{
|
||||
throw new Exception("Failed to create binding context");
|
||||
}
|
||||
if (Win32.MkParseDisplayName(bindCtx, monikerString, ref n, out moniker) != 0)
|
||||
|
||||
if (Win32.MkParseDisplayName(bindCtx, monikerString, ref n, out IMoniker moniker) != 0)
|
||||
{
|
||||
throw new Exception("Failed to create binding moniker");
|
||||
}
|
||||
|
||||
graph.AddSourceFilterForMoniker(moniker, bindCtx, monikerString, out sourceFilter);
|
||||
graph.AddSourceFilterForMoniker(moniker, bindCtx, monikerString, out _sourceFilter);
|
||||
|
||||
samplegrabberfilter = CreateInstanceFromClsid<IBaseFilter>(Clsid.SampleGrabber);
|
||||
graph.AddFilter(samplegrabberfilter, string.Format("SampleGrabber {0}", monikerString));
|
||||
_sampleGrabberFilter = CreateInstanceFromClsid<IBaseFilter>(Clsid.SampleGrabber);
|
||||
graph.AddFilter(_sampleGrabberFilter, $"SampleGrabber {monikerString}");
|
||||
|
||||
ISampleGrabber sampleGrabber = (ISampleGrabber)samplegrabberfilter;
|
||||
ISampleGrabber sampleGrabber = (ISampleGrabber)_sampleGrabberFilter;
|
||||
|
||||
// Set media type
|
||||
AMMediaType mediaType = new AMMediaType
|
||||
@@ -85,15 +82,16 @@ namespace VAR.Toolbox.Code
|
||||
};
|
||||
sampleGrabber.SetMediaType(mediaType);
|
||||
|
||||
grabber = new Grabber(this);
|
||||
result = sampleGrabber.SetCallback(grabber, 1);
|
||||
var grabber = new Grabber(this);
|
||||
int result = sampleGrabber.SetCallback(grabber, 1);
|
||||
if (result < 0) throw new Exception("Failure creating Webcam device");
|
||||
|
||||
//set the null renderer
|
||||
nullrenderer = CreateInstanceFromClsid<IBaseFilter>(Clsid.NullRenderer);
|
||||
graph.AddFilter(nullrenderer, string.Format("NullRenderer {0}", monikerString));
|
||||
_nullRenderer = CreateInstanceFromClsid<IBaseFilter>(Clsid.NullRenderer);
|
||||
graph.AddFilter(_nullRenderer, $"NullRenderer {monikerString}");
|
||||
|
||||
result = capture.RenderStream(PinCategory.Preview, MediaType.Video, sourceFilter, samplegrabberfilter, nullrenderer);
|
||||
result = capture.RenderStream(PinCategory.Preview, MediaType.Video, _sourceFilter, _sampleGrabberFilter,
|
||||
_nullRenderer);
|
||||
if (result < 0) throw new Exception("Failure creating Webcam device");
|
||||
|
||||
AMMediaType queryMediaType = new AMMediaType();
|
||||
@@ -102,14 +100,15 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
if (queryMediaType.FormatType == FormatType.VideoInfo)
|
||||
{
|
||||
VideoInfoHeader videoInfo = (VideoInfoHeader)Marshal.PtrToStructure(queryMediaType.FormatPtr, typeof(VideoInfoHeader));
|
||||
width = videoInfo.BmiHeader.Width;
|
||||
height = videoInfo.BmiHeader.Height;
|
||||
bpp = videoInfo.BmiHeader.BitCount;
|
||||
VideoInfoHeader videoInfo =
|
||||
(VideoInfoHeader)Marshal.PtrToStructure(queryMediaType.FormatPtr, typeof(VideoInfoHeader));
|
||||
_width = videoInfo.BmiHeader.Width;
|
||||
_height = videoInfo.BmiHeader.Height;
|
||||
_bpp = videoInfo.BmiHeader.BitCount;
|
||||
}
|
||||
}
|
||||
|
||||
control.Run();
|
||||
_control.Run();
|
||||
Stop();
|
||||
}
|
||||
|
||||
@@ -119,41 +118,37 @@ namespace VAR.Toolbox.Code
|
||||
|
||||
public void Start()
|
||||
{
|
||||
control.Run();
|
||||
int result;
|
||||
result = nullrenderer.Run(0);
|
||||
_control.Run();
|
||||
int result = _nullRenderer.Run(0);
|
||||
if (result < 0) throw new Exception("Webcam Start failure");
|
||||
result = samplegrabberfilter.Run(0);
|
||||
result = _sampleGrabberFilter.Run(0);
|
||||
if (result < 0) throw new Exception("Webcam Start failure");
|
||||
result = sourceFilter.Run(0);
|
||||
result = _sourceFilter.Run(0);
|
||||
if (result < 0) throw new Exception("Webcam Start failure");
|
||||
active = true;
|
||||
_active = true;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
int result;
|
||||
result = sourceFilter.Stop();
|
||||
int result = _sourceFilter.Stop();
|
||||
if (result < 0) throw new Exception("Webcam Stop failure");
|
||||
result = samplegrabberfilter.Stop();
|
||||
result = _sampleGrabberFilter.Stop();
|
||||
if (result < 0) throw new Exception("Webcam Stop failure");
|
||||
result = nullrenderer.Stop();
|
||||
result = _nullRenderer.Stop();
|
||||
if (result < 0) throw new Exception("Webcam Stop failure");
|
||||
control.Stop();
|
||||
active = false;
|
||||
_control.Stop();
|
||||
_active = false;
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> ListDevices()
|
||||
{
|
||||
if (_deviceDescriptions != null) { return _deviceDescriptions; }
|
||||
|
||||
int result;
|
||||
Dictionary<string, string> devices = new Dictionary<string, string>();
|
||||
ICreateDevEnum devEnum = CreateInstanceFromClsid<ICreateDevEnum>(Clsid.SystemDeviceEnum);
|
||||
|
||||
IEnumMoniker enumMon = null;
|
||||
Guid category = FilterCategory.VideoInputDevice;
|
||||
result = devEnum.CreateClassEnumerator(ref category, out enumMon, 0);
|
||||
int result = devEnum.CreateClassEnumerator(ref category, out IEnumMoniker enumMon, 0);
|
||||
if (result != 0)
|
||||
throw new ApplicationException("No devices of the category");
|
||||
|
||||
@@ -175,6 +170,7 @@ namespace VAR.Toolbox.Code
|
||||
Marshal.ReleaseComObject(devMoniker[0]);
|
||||
devMoniker[0] = null;
|
||||
}
|
||||
|
||||
_deviceDescriptions = devices;
|
||||
|
||||
Marshal.ReleaseComObject(devEnum);
|
||||
@@ -202,8 +198,7 @@ namespace VAR.Toolbox.Code
|
||||
//
|
||||
private static string GetMonikerString(IMoniker moniker)
|
||||
{
|
||||
string str;
|
||||
moniker.GetDisplayName(null, null, out str);
|
||||
moniker.GetDisplayName(null, null, out string str);
|
||||
return str;
|
||||
}
|
||||
|
||||
@@ -213,14 +208,13 @@ namespace VAR.Toolbox.Code
|
||||
private static string GetMonikerName(IMoniker moniker)
|
||||
{
|
||||
Object bagObj = null;
|
||||
IPropertyBag bag = null;
|
||||
|
||||
try
|
||||
{
|
||||
Guid bagId = typeof(IPropertyBag).GUID;
|
||||
// get property bag of the moniker
|
||||
moniker.BindToStorage(null, null, ref bagId, out bagObj);
|
||||
bag = (IPropertyBag)bagObj;
|
||||
IPropertyBag bag = (IPropertyBag)bagObj;
|
||||
|
||||
// read FriendlyName
|
||||
object val = "";
|
||||
@@ -242,11 +236,9 @@ namespace VAR.Toolbox.Code
|
||||
finally
|
||||
{
|
||||
// release all COM objects
|
||||
bag = null;
|
||||
if (bagObj != null)
|
||||
{
|
||||
Marshal.ReleaseComObject(bagObj);
|
||||
bagObj = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,7 +259,7 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
private readonly Webcam _parent;
|
||||
|
||||
private readonly Bitmap[] _frames = null;
|
||||
private readonly Bitmap[] _frames;
|
||||
private readonly int _numFrames = 10;
|
||||
private int _currentFrameIndex = -1;
|
||||
|
||||
@@ -281,11 +273,13 @@ namespace VAR.Toolbox.Code
|
||||
{
|
||||
_currentFrameIndex = (_currentFrameIndex + 1) % _numFrames;
|
||||
Bitmap currentBitmap = _frames[_currentFrameIndex];
|
||||
if (currentBitmap == null || currentBitmap?.Width != _parent.width || currentBitmap?.Height != _parent.height)
|
||||
if (currentBitmap == null || currentBitmap.Width != _parent._width ||
|
||||
currentBitmap.Height != _parent._height)
|
||||
{
|
||||
currentBitmap = new Bitmap(_parent.width, _parent.height, PixelFormat.Format24bppRgb);
|
||||
currentBitmap = new Bitmap(_parent._width, _parent._height, PixelFormat.Format24bppRgb);
|
||||
_frames[_currentFrameIndex] = currentBitmap;
|
||||
}
|
||||
|
||||
return currentBitmap;
|
||||
}
|
||||
|
||||
@@ -299,12 +293,12 @@ namespace VAR.Toolbox.Code
|
||||
if (_parent.NewFrame != null)
|
||||
{
|
||||
// create new image
|
||||
Bitmap _image = GetNextFrame();
|
||||
Rectangle _imageRect = new Rectangle(0, 0, _parent.width, _parent.height);
|
||||
Bitmap image = GetNextFrame();
|
||||
Rectangle imageRect = new Rectangle(0, 0, _parent._width, _parent._height);
|
||||
|
||||
// lock bitmap data
|
||||
BitmapData imageData = _image.LockBits(
|
||||
_imageRect,
|
||||
BitmapData imageData = image.LockBits(
|
||||
imageRect,
|
||||
ImageLockMode.ReadWrite,
|
||||
PixelFormat.Format24bppRgb);
|
||||
|
||||
@@ -314,10 +308,10 @@ namespace VAR.Toolbox.Code
|
||||
|
||||
unsafe
|
||||
{
|
||||
byte* dst = (byte*)imageData.Scan0.ToPointer() + dstStride * (_parent.height - 1);
|
||||
byte* dst = (byte*)imageData.Scan0.ToPointer() + dstStride * (_parent._height - 1);
|
||||
byte* src = (byte*)buffer.ToPointer();
|
||||
|
||||
for (int y = 0; y < _parent.height; y++)
|
||||
for (int y = 0; y < _parent._height; y++)
|
||||
{
|
||||
Win32.memcpy(dst, src, srcStride);
|
||||
dst -= dstStride;
|
||||
@@ -326,10 +320,10 @@ namespace VAR.Toolbox.Code
|
||||
}
|
||||
|
||||
// unlock bitmap data
|
||||
_image.UnlockBits(imageData);
|
||||
image.UnlockBits(imageData);
|
||||
|
||||
// notify parent
|
||||
_parent.NewFrame?.Invoke(this, _image);
|
||||
_parent.NewFrame?.Invoke(this, image);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -338,4 +332,4 @@ namespace VAR.Toolbox.Code
|
||||
|
||||
#endregion Grabber
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,16 +11,21 @@ namespace VAR.Toolbox.Code.Windows
|
||||
public static extern bool BitBlt(IntPtr hObject, int nXDest, int nYDest,
|
||||
int nWidth, int nHeight, IntPtr hObjectSource,
|
||||
int nXSrc, int nYSrc, int dwRop);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern IntPtr CreateCompatibleBitmap(IntPtr hDC, int nWidth,
|
||||
int nHeight);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern bool DeleteDC(IntPtr hDC);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern bool DeleteObject(IntPtr hObject);
|
||||
|
||||
[DllImport("gdi32.dll")]
|
||||
public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,11 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable FieldCanBeMadeReadOnly.Global
|
||||
// ReSharper disable IdentifierTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.Windows
|
||||
{
|
||||
public static class User32
|
||||
@@ -23,14 +28,11 @@ namespace VAR.Toolbox.Code.Windows
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct MOUSEKEYBDHARDWAREINPUT
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public HARDWAREINPUT Hardware;
|
||||
[FieldOffset(0)] public HARDWAREINPUT Hardware;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public KEYBDINPUT Keyboard;
|
||||
[FieldOffset(0)] public KEYBDINPUT Keyboard;
|
||||
|
||||
[FieldOffset(0)]
|
||||
public MOUSEINPUT Mouse;
|
||||
[FieldOffset(0)] public MOUSEINPUT Mouse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -93,7 +95,7 @@ namespace VAR.Toolbox.Code.Windows
|
||||
[DllImport("User32.dll")]
|
||||
public static extern int SendInput(int nInputs, INPUT[] pInputs, int cbSize);
|
||||
|
||||
// <summary>
|
||||
/// <summary>
|
||||
/// Struct representing a point.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -111,18 +113,16 @@ namespace VAR.Toolbox.Code.Windows
|
||||
public static extern bool GetCursorPos(out POINT lpPoint);
|
||||
|
||||
[DllImport("User32.dll")]
|
||||
public static extern Boolean SetCursorPos(UInt32 X, UInt32 Y);
|
||||
public static extern Boolean SetCursorPos(UInt32 x, UInt32 y);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct LASTINPUTINFO
|
||||
{
|
||||
public static readonly int SizeOf = Marshal.SizeOf(typeof(LASTINPUTINFO));
|
||||
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public UInt32 cbSize;
|
||||
[MarshalAs(UnmanagedType.U4)] public UInt32 cbSize;
|
||||
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public UInt32 dwTime;
|
||||
[MarshalAs(UnmanagedType.U4)] public UInt32 dwTime;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@@ -139,7 +139,7 @@ namespace VAR.Toolbox.Code.Windows
|
||||
public const int HT_CAPTION = 0x2;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
|
||||
public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool ReleaseCapture();
|
||||
@@ -177,14 +177,15 @@ namespace VAR.Toolbox.Code.Windows
|
||||
|
||||
public static string GetActiveWindowTitle()
|
||||
{
|
||||
const int nChars = 256;
|
||||
StringBuilder Buff = new StringBuilder(nChars);
|
||||
const int NChars = 256;
|
||||
StringBuilder buff = new StringBuilder(NChars);
|
||||
IntPtr handle = GetForegroundWindow();
|
||||
|
||||
if (GetWindowText(handle, Buff, nChars) > 0)
|
||||
if (GetWindowText(handle, buff, NChars) > 0)
|
||||
{
|
||||
return Buff.ToString();
|
||||
return buff.ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@ using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable StringLiteralTypo
|
||||
// ReSharper disable CommentTypo
|
||||
|
||||
namespace VAR.Toolbox.Code.Windows
|
||||
{
|
||||
public static class Win32
|
||||
@@ -21,7 +25,7 @@ namespace VAR.Toolbox.Code.Windows
|
||||
///
|
||||
[DllImport("ole32.dll")]
|
||||
public static extern
|
||||
int CreateBindCtx(int reserved, out IBindCtx ppbc);
|
||||
int CreateBindCtx(int reserved, out IBindCtx ppbc);
|
||||
|
||||
/// <summary>
|
||||
/// Converts a string into a moniker that identifies the object named by the string.
|
||||
@@ -37,8 +41,8 @@ namespace VAR.Toolbox.Code.Windows
|
||||
///
|
||||
[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);
|
||||
|
||||
/// <summary>
|
||||
/// Copy a block of memory.
|
||||
@@ -51,7 +55,7 @@ namespace VAR.Toolbox.Code.Windows
|
||||
/// <returns>Return's the value of <b>dst</b> - pointer to destination.</returns>
|
||||
///
|
||||
[DllImport("ntdll.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static unsafe extern int memcpy(
|
||||
public static extern unsafe int memcpy(
|
||||
byte* dst,
|
||||
byte* src,
|
||||
int count);
|
||||
@@ -81,7 +85,7 @@ namespace VAR.Toolbox.Code.Windows
|
||||
int y,
|
||||
[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,
|
||||
@@ -90,7 +94,8 @@ namespace VAR.Toolbox.Code.Windows
|
||||
IntPtr lpvReserved);
|
||||
|
||||
[DllImport("PowrProf.dll")]
|
||||
public static extern Boolean SetSuspendState(Boolean Hibernate, Boolean ForceCritical, Boolean DisableWakeEvent);
|
||||
public static extern Boolean
|
||||
SetSuspendState(Boolean hibernate, Boolean forceCritical, Boolean disableWakeEvent);
|
||||
|
||||
public static uint GetLastInputTime()
|
||||
{
|
||||
@@ -104,6 +109,7 @@ namespace VAR.Toolbox.Code.Windows
|
||||
uint lastInputTick = lastInputInfo.dwTime;
|
||||
idleTime = envTicks - lastInputTick;
|
||||
}
|
||||
|
||||
return ((idleTime > 0) ? (idleTime / 1000) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
List<WorkLogItem> Import(Form form);
|
||||
bool Export(List<WorkLogItem> items, Form form);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
{
|
||||
public class VARTextWorkLogImporter : IWorkLogImporter
|
||||
{
|
||||
public string Name { get { return "VARText"; } }
|
||||
public string Name => "VARText";
|
||||
|
||||
//TODO: VARTextWorkLogImporter: Export WorkLigItem.Tags
|
||||
public bool Export(List<WorkLogItem> items, Form form)
|
||||
@@ -23,6 +23,7 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
{
|
||||
File.Delete(saveFileDialog.FileName);
|
||||
}
|
||||
|
||||
using (StreamWriter streamWriter = new StreamWriter(saveFileDialog.FileName))
|
||||
{
|
||||
DateTime lastDateTime = DateTime.MinValue;
|
||||
@@ -30,30 +31,33 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
List<WorkLogItem> itemsOrdered = items.OrderBy(x => x.DateStart).ToList();
|
||||
foreach (WorkLogItem item in itemsOrdered)
|
||||
{
|
||||
int weekOfYear = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(item.DateStart, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
|
||||
int weekOfYear = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(item.DateStart,
|
||||
CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
|
||||
if (weekOfYear != lastWeekOfYear)
|
||||
{
|
||||
streamWriter.WriteLine();
|
||||
streamWriter.WriteLine();
|
||||
streamWriter.WriteLine(string.Format("--- {0:0000}-{1:00}-{2:00}", item.DateStart.Year, item.DateStart.Month, item.DateStart.Day));
|
||||
streamWriter.WriteLine("--- {0:0000}-{1:00}-{2:00}", item.DateStart.Year, item.DateStart.Month,
|
||||
item.DateStart.Day);
|
||||
lastWeekOfYear = weekOfYear;
|
||||
}
|
||||
|
||||
if (lastDateTime.Day != item.DateStart.Day)
|
||||
{
|
||||
streamWriter.WriteLine();
|
||||
lastDateTime = item.DateStart;
|
||||
}
|
||||
|
||||
streamWriter.WriteLine(string.Format("{0:00}_{1:00}_{2:00} - {3:00}_{4:00}_{5:00} {6}",
|
||||
item.DateStart.Day, item.DateStart.Hour, item.DateStart.Minute,
|
||||
item.DateEnd.Day, item.DateEnd.Hour, item.DateEnd.Minute,
|
||||
item.Activity));
|
||||
streamWriter.WriteLine("{0:00}_{1:00}_{2:00} - {3:00}_{4:00}_{5:00} {6}", item.DateStart.Day,
|
||||
item.DateStart.Hour, item.DateStart.Minute, item.DateEnd.Day, item.DateEnd.Hour,
|
||||
item.DateEnd.Minute, item.Activity);
|
||||
if (string.IsNullOrEmpty(item.Description) == false)
|
||||
{
|
||||
streamWriter.WriteLine(string.Format(" {0}", item.Description));
|
||||
streamWriter.WriteLine($" {item.Description}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -82,14 +86,13 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
{
|
||||
string strDate = lineAux.Substring(4);
|
||||
string[] strDateParts = strDate.Split('-');
|
||||
if (strDateParts.Length >= 3 && strDateParts[0].Length == 4 && strDateParts[1].Length == 2 && strDateParts[2].Length == 2)
|
||||
if (strDateParts.Length >= 3 && strDateParts[0].Length == 4 && strDateParts[1].Length == 2 &&
|
||||
strDateParts[2].Length == 2)
|
||||
{
|
||||
currentDateStart = new DateTime(Convert.ToInt32(strDateParts[0]), Convert.ToInt32(strDateParts[1]), Convert.ToInt32(strDateParts[2]), 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
currentDateStart = new DateTime(Convert.ToInt32(strDateParts[0]),
|
||||
Convert.ToInt32(strDateParts[1]), Convert.ToInt32(strDateParts[2]), 0, 0, 0);
|
||||
}
|
||||
else { }
|
||||
}
|
||||
else if (lineAux.StartsWith("--"))
|
||||
{
|
||||
@@ -97,7 +100,6 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
{
|
||||
currentWorkLog.Description += lineAux + "\n";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -108,8 +110,10 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
{
|
||||
currentWorkLog.Description += lineAux + "\n";
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
int startDay = Convert.ToInt32(match.Groups[1].Value);
|
||||
int startHour = Convert.ToInt32(match.Groups[2].Value);
|
||||
int startMinute = Convert.ToInt32(match.Groups[3].Value);
|
||||
@@ -138,4 +142,4 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
return workLog;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
namespace VAR.Toolbox.Code.WorkLog
|
||||
{
|
||||
public class WorkLogImporterFactory : BaseFactory<IWorkLogImporter>
|
||||
{
|
||||
}
|
||||
}
|
||||
public class WorkLogImporterFactory : BaseFactory<IWorkLogImporter> { }
|
||||
}
|
||||
@@ -12,7 +12,7 @@ namespace VAR.Toolbox.Code.WorkLog
|
||||
|
||||
public bool Overlaps(WorkLogItem other)
|
||||
{
|
||||
return (other.DateEnd < this.DateStart || other.DateStart > this.DateEnd) == false;
|
||||
return (other.DateEnd < DateStart || other.DateStart > DateEnd) == false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,16 +4,16 @@ using System.Windows.Forms;
|
||||
|
||||
namespace VAR.Toolbox.Controls
|
||||
{
|
||||
public class CButton : System.Windows.Forms.Button
|
||||
public class CButton : Button
|
||||
{
|
||||
private Brush _foreColorBrush;
|
||||
private Brush _foreColorDisableBrush;
|
||||
private Brush _backColorBrush;
|
||||
private Brush _backColorOverBrush;
|
||||
private Brush _backColorDownBrush;
|
||||
private readonly Brush _foreColorBrush;
|
||||
private readonly Brush _foreColorDisableBrush;
|
||||
private readonly Brush _backColorBrush;
|
||||
private readonly Brush _backColorOverBrush;
|
||||
private readonly Brush _backColorDownBrush;
|
||||
|
||||
private bool _mouseIsDown = false;
|
||||
private bool _mouseIsOver = false;
|
||||
private bool _mouseIsDown;
|
||||
private bool _mouseIsOver;
|
||||
|
||||
public CButton()
|
||||
{
|
||||
@@ -47,15 +47,9 @@ namespace VAR.Toolbox.Controls
|
||||
if (mevent.Button != MouseButtons.None)
|
||||
{
|
||||
Rectangle r = ClientRectangle;
|
||||
if (!r.Contains(mevent.X, mevent.Y))
|
||||
{
|
||||
_mouseIsDown = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
_mouseIsDown = true;
|
||||
}
|
||||
_mouseIsDown = r.Contains(mevent.X, mevent.Y);
|
||||
}
|
||||
|
||||
base.OnMouseMove(mevent);
|
||||
}
|
||||
|
||||
@@ -71,7 +65,8 @@ namespace VAR.Toolbox.Controls
|
||||
base.OnMouseUp(mevent);
|
||||
}
|
||||
|
||||
private StringFormat _stringFormat = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
|
||||
private readonly StringFormat _stringFormat = new StringFormat
|
||||
{ Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pevent)
|
||||
{
|
||||
@@ -84,14 +79,7 @@ namespace VAR.Toolbox.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_mouseIsOver)
|
||||
{
|
||||
pevent.Graphics.FillRectangle(_backColorOverBrush, rectangle);
|
||||
}
|
||||
else
|
||||
{
|
||||
pevent.Graphics.FillRectangle(_backColorBrush, rectangle);
|
||||
}
|
||||
pevent.Graphics.FillRectangle(_mouseIsOver ? _backColorOverBrush : _backColorBrush, rectangle);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -99,8 +87,8 @@ namespace VAR.Toolbox.Controls
|
||||
pevent.Graphics.FillRectangle(_backColorBrush, rectangle);
|
||||
}
|
||||
|
||||
pevent.Graphics.DrawString(Text, Font, Enabled ? _foreColorBrush : _foreColorDisableBrush, rectangle, _stringFormat);
|
||||
pevent.Graphics.DrawString(Text, Font, Enabled ? _foreColorBrush : _foreColorDisableBrush, rectangle,
|
||||
_stringFormat);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,19 @@ using System.Windows.Forms;
|
||||
|
||||
namespace VAR.Toolbox.Controls
|
||||
{
|
||||
public class CComboBox : System.Windows.Forms.ComboBox
|
||||
public class CComboBox : ComboBox
|
||||
{
|
||||
public CComboBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
BackColor = Color.FromArgb(255, 0, 0, 0);
|
||||
ForeColor = Color.FromArgb(255, 192, 192, 192);
|
||||
|
||||
FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
FlatStyle = FlatStyle.Flat;
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pevent)
|
||||
@@ -19,4 +24,4 @@ namespace VAR.Toolbox.Controls
|
||||
pevent.Graphics.FillRectangle(Brushes.CadetBlue, rectangle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,14 @@ namespace VAR.Toolbox.Controls
|
||||
public class CDateTimePicker : System.Windows.Forms.DateTimePicker
|
||||
{
|
||||
public CDateTimePicker()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
BackColor = Color.DarkSlateGray;
|
||||
ForeColor = Color.Gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,26 +3,31 @@ using System.Windows.Forms;
|
||||
|
||||
namespace VAR.Toolbox.Controls
|
||||
{
|
||||
public class CGroupBox : System.Windows.Forms.GroupBox
|
||||
public class CGroupBox : GroupBox
|
||||
{
|
||||
public CGroupBox()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
BackColor = Color.FromArgb(255, 32, 32, 32);
|
||||
ForeColor = Color.FromArgb(255, 192, 192, 192);
|
||||
BorderColor = Color.FromArgb(255, 64, 64, 64);
|
||||
FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
FlatStyle = FlatStyle.Flat;
|
||||
}
|
||||
|
||||
private Color _borderColor = Color.Black;
|
||||
|
||||
public Color BorderColor
|
||||
{
|
||||
get { return this._borderColor; }
|
||||
set { this._borderColor = value; }
|
||||
get => _borderColor;
|
||||
set => _borderColor = value;
|
||||
}
|
||||
|
||||
private SolidBrush _brushBackColor = null;
|
||||
private SolidBrush _brushForeColor = null;
|
||||
private SolidBrush _brushBackColor;
|
||||
private SolidBrush _brushForeColor;
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
@@ -30,6 +35,7 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
_brushBackColor = new SolidBrush(BackColor);
|
||||
}
|
||||
|
||||
if (_brushForeColor == null || _brushForeColor.Color != ForeColor)
|
||||
{
|
||||
_brushForeColor = new SolidBrush(ForeColor);
|
||||
@@ -50,4 +56,4 @@ namespace VAR.Toolbox.Controls
|
||||
e.Graphics.DrawString(Text, Font, _brushForeColor, textRect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,14 @@ namespace VAR.Toolbox.Controls
|
||||
public class CSplitContainer : System.Windows.Forms.SplitContainer
|
||||
{
|
||||
public CSplitContainer()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
BackColor = Color.FromArgb(255, 32, 32, 32);
|
||||
ForeColor = Color.FromArgb(255, 192, 192, 192);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,8 +23,8 @@ namespace VAR.Toolbox.Controls
|
||||
if (control.InvokeRequired)
|
||||
{
|
||||
control.Invoke(new SetControlPropertyThreadSafeDelegate
|
||||
(SetControlPropertyThreadSafe),
|
||||
new object[] { control, propertyName, propertyValue });
|
||||
(SetControlPropertyThreadSafe),
|
||||
new[] { control, propertyName, propertyValue });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -33,8 +33,8 @@ namespace VAR.Toolbox.Controls
|
||||
BindingFlags.SetProperty,
|
||||
null,
|
||||
control,
|
||||
new object[] { propertyValue });
|
||||
new[] { propertyValue });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
#region Declarations
|
||||
|
||||
private Image _imageShow = null;
|
||||
private Image _imageShow;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace VAR.Toolbox.Controls
|
||||
|
||||
public Image ImageShow
|
||||
{
|
||||
get { return _imageShow; }
|
||||
// ReSharper disable once InconsistentlySynchronizedField
|
||||
get => _imageShow;
|
||||
set
|
||||
{
|
||||
lock (this)
|
||||
@@ -32,6 +33,11 @@ namespace VAR.Toolbox.Controls
|
||||
#region Control life cycle
|
||||
|
||||
public CtrImageViewer()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
BackColor = Color.Black;
|
||||
}
|
||||
@@ -46,7 +52,7 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
base.OnResize(e);
|
||||
//Redraw(null);
|
||||
this.Invalidate();
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -59,11 +65,12 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
lock (_imageShow)
|
||||
{
|
||||
if (graph == null)
|
||||
{
|
||||
graph = this.CreateGraphics();
|
||||
graph = CreateGraphics();
|
||||
}
|
||||
|
||||
// Calcular dimensiones a dibujar y centrar
|
||||
@@ -71,7 +78,7 @@ namespace VAR.Toolbox.Controls
|
||||
int imgDrawHeight;
|
||||
float imgDrawX = 0;
|
||||
float imgDrawY = 0;
|
||||
float relation = (float)_imageShow.Width / (float)_imageShow.Height;
|
||||
float relation = _imageShow.Width / (float)_imageShow.Height;
|
||||
if (relation > 0)
|
||||
{
|
||||
// Imagen mas ancha que alta
|
||||
@@ -110,6 +117,5 @@ namespace VAR.Toolbox.Controls
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
public string Text { get; set; }
|
||||
public object Data { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Text;
|
||||
@@ -62,6 +63,7 @@ namespace VAR.Toolbox.Controls
|
||||
CopyToClipboard();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.ProcessCmdKey(ref msg, keyData);
|
||||
}
|
||||
|
||||
@@ -80,6 +82,7 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
sbText.AppendLine(item.Text);
|
||||
}
|
||||
|
||||
if (sbText.Length > 0)
|
||||
{
|
||||
Clipboard.SetText(sbText.ToString());
|
||||
@@ -99,7 +102,7 @@ namespace VAR.Toolbox.Controls
|
||||
}
|
||||
}
|
||||
|
||||
private bool _updated = false;
|
||||
private bool _updated;
|
||||
private readonly List<OutputItem> _pendingOutput = new List<OutputItem>();
|
||||
|
||||
private void UpdatePosition()
|
||||
@@ -112,6 +115,7 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
_listBox.Items.Add(item);
|
||||
}
|
||||
|
||||
_pendingOutput.Clear();
|
||||
_listBox.ResumeLayout();
|
||||
|
||||
@@ -124,10 +128,12 @@ namespace VAR.Toolbox.Controls
|
||||
}
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
||||
private static extern IntPtr SendMessage(HandleRef hWnd, Int32 Msg, IntPtr wParam, IntPtr lParam);
|
||||
private static extern IntPtr SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
private static void EnableRepaint(HandleRef handle, bool enable)
|
||||
{
|
||||
// ReSharper disable once InconsistentNaming
|
||||
// ReSharper disable once IdentifierTypo
|
||||
const int WM_SETREDRAW = 0x000B;
|
||||
SendMessage(handle, WM_SETREDRAW, new IntPtr(enable ? 1 : 0), IntPtr.Zero);
|
||||
}
|
||||
@@ -161,6 +167,7 @@ namespace VAR.Toolbox.Controls
|
||||
public string GetCurrentText()
|
||||
{
|
||||
if (_listBox.SelectedItems.Count == 0) { return null; }
|
||||
|
||||
OutputItem item = (OutputItem)_listBox.SelectedItems[0];
|
||||
return item?.Text;
|
||||
}
|
||||
@@ -168,8 +175,9 @@ namespace VAR.Toolbox.Controls
|
||||
public object GetCurrentData()
|
||||
{
|
||||
if (_listBox.SelectedItems.Count == 0) { return null; }
|
||||
|
||||
OutputItem item = (OutputItem)_listBox.SelectedItems[0];
|
||||
return item?.Data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,16 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
public Frame()
|
||||
{
|
||||
Font = new System.Drawing.Font(Font.Name, ControlsUtils.GetFontSize(this, 8.25f), Font.Style, Font.Unit, Font.GdiCharSet, Font.GdiVerticalFont);
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
Font = new Font(Font.Name, ControlsUtils.GetFontSize(this, 8.25f), Font.Style, Font.Unit,
|
||||
Font.GdiCharSet, Font.GdiVerticalFont);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
BackColor = Color.FromArgb(255, 32, 32, 32);
|
||||
ForeColor = Color.FromArgb(255, 192, 192, 192);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ namespace VAR.Toolbox.Controls
|
||||
public class ListBoxMonospace : ListBox
|
||||
{
|
||||
public ListBoxMonospace()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
FormattingEnabled = true;
|
||||
Font = new Font("Consolas", ControlsUtils.GetFontSize(this, 9));
|
||||
@@ -17,17 +22,17 @@ namespace VAR.Toolbox.Controls
|
||||
|
||||
protected override void OnMouseWheel(MouseEventArgs e)
|
||||
{
|
||||
(e as HandledMouseEventArgs).Handled = true;
|
||||
const int rows = 5;
|
||||
((HandledMouseEventArgs)e).Handled = true;
|
||||
const int Rows = 5;
|
||||
if (e.Delta > 0)
|
||||
{
|
||||
if (TopIndex < rows) { TopIndex = 0; }
|
||||
else { TopIndex -= rows; }
|
||||
if (TopIndex < Rows) { TopIndex = 0; }
|
||||
else { TopIndex -= Rows; }
|
||||
}
|
||||
else
|
||||
{
|
||||
TopIndex += rows;
|
||||
TopIndex += Rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ namespace VAR.Toolbox.Controls
|
||||
public class ListBoxNormal : ListBox
|
||||
{
|
||||
public ListBoxNormal()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
FormattingEnabled = true;
|
||||
Font = new Font("Microsoft Sans Serif", ControlsUtils.GetFontSize(this, 8.25f));
|
||||
@@ -16,17 +21,17 @@ namespace VAR.Toolbox.Controls
|
||||
|
||||
protected override void OnMouseWheel(MouseEventArgs e)
|
||||
{
|
||||
(e as HandledMouseEventArgs).Handled = true;
|
||||
const int rows = 5;
|
||||
((HandledMouseEventArgs)e).Handled = true;
|
||||
const int Rows = 5;
|
||||
if (e.Delta > 0)
|
||||
{
|
||||
if (TopIndex < rows) { TopIndex = 0; }
|
||||
else { TopIndex -= rows; }
|
||||
if (TopIndex < Rows) { TopIndex = 0; }
|
||||
else { TopIndex -= Rows; }
|
||||
}
|
||||
else
|
||||
{
|
||||
TopIndex += rows;
|
||||
TopIndex += Rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,16 @@ namespace VAR.Toolbox.Controls
|
||||
{
|
||||
public SubFrame()
|
||||
{
|
||||
Font = new System.Drawing.Font(Font.Name, ControlsUtils.GetFontSize(this, 8.25f), Font.Style, Font.Unit, Font.GdiCharSet, Font.GdiVerticalFont);
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
Font = new Font(Font.Name, ControlsUtils.GetFontSize(this, 8.25f), Font.Style, Font.Unit,
|
||||
Font.GdiCharSet, Font.GdiVerticalFont);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
BackColor = Color.FromArgb(255, 32, 32, 32);
|
||||
ForeColor = Color.FromArgb(255, 192, 192, 192);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ namespace VAR.Toolbox.Controls
|
||||
public class TextBoxMonospace : TextBox
|
||||
{
|
||||
public TextBoxMonospace()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
Font = new Font("Consolas", ControlsUtils.GetFontSize(this, 9.0f));
|
||||
BackColor = Color.FromArgb(255, 0, 0, 0);
|
||||
@@ -13,4 +18,4 @@ namespace VAR.Toolbox.Controls
|
||||
BorderStyle = BorderStyle.FixedSingle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ namespace VAR.Toolbox.Controls
|
||||
public class TextBoxNormal : TextBox
|
||||
{
|
||||
public TextBoxNormal()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
Font = new Font("Microsoft Sans Serif", ControlsUtils.GetFontSize(this, 8.25f));
|
||||
BackColor = Color.FromArgb(255, 0, 0, 0);
|
||||
@@ -13,4 +18,4 @@ namespace VAR.Toolbox.Controls
|
||||
BorderStyle = BorderStyle.FixedSingle;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,234 +2,234 @@
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64"
|
||||
height="64"
|
||||
viewBox="0 0 16.933333 16.933334"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:export-filename="C:\Users\valen\source.coffebreak\VAR.Toolbox\VAR.Toolbox\Images\Toolbox.png"
|
||||
inkscape:export-xdpi="96.000008"
|
||||
inkscape:export-ydpi="96.000008"
|
||||
inkscape:version="0.92.1 r15371"
|
||||
sodipodi:docname="toolbox.svg">
|
||||
<defs
|
||||
id="defs2">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4845">
|
||||
<stop
|
||||
style="stop-color:#8d0000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop4841" />
|
||||
<stop
|
||||
style="stop-color:#ff0400;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop4843" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4839">
|
||||
<stop
|
||||
style="stop-color:#8f0000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop4835" />
|
||||
<stop
|
||||
style="stop-color:#fc0000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop4837" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4839"
|
||||
id="linearGradient4833"
|
||||
x1="10.583333"
|
||||
y1="293.95728"
|
||||
x2="10.583333"
|
||||
y2="282.84479"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4845"
|
||||
id="linearGradient4847"
|
||||
x1="9.921875"
|
||||
y1="294.03665"
|
||||
x2="9.7895832"
|
||||
y2="282.92416"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="22.659532"
|
||||
inkscape:cy="29.638443"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
units="px"
|
||||
inkscape:window-width="1821"
|
||||
inkscape:window-height="1246"
|
||||
inkscape:window-x="-11"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4485"
|
||||
originy="0" />
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4487"
|
||||
originx="0.13229167"
|
||||
originy="0.13229167"
|
||||
units="in" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Capa 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-280.06665)">
|
||||
<path
|
||||
style="fill:url(#linearGradient4833);fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4665-6"
|
||||
d="m 11.641667,285.75519 c -0.07519,0 -0.132327,-0.055 -0.131923,-0.12982 l 0.01,-1.84881 c 4.07e-4,-0.0754 -0.06708,-0.13652 -0.142114,-0.13656 l -5.8221957,-0.003 c -0.075331,-4e-5 -0.127582,0.0629 -0.1276415,0.13802 l -0.00146,1.84724 c -5.91e-5,0.0747 -0.056695,0.13196 -0.1320265,0.13202 l -3.9709303,0.003 c -0.075186,6e-5 -0.1312438,0.0554 -0.1312438,0.13006 v 2.11525 c 0,0.0745 0.061225,0.13617 0.1364114,0.13612 l 6.3458527,-0.004 c 0.075331,-5e-5 0.1374335,-0.0575 0.1368477,-0.13199 l -0.00413,-0.52582 c -5.88e-4,-0.0748 0.05546,-0.13627 0.1306467,-0.13612 l 1.0559706,0.002 c 0.075331,1.5e-4 0.1346351,0.0531 0.1346351,0.12785 v 0.5279 c 0,0.0745 0.055461,0.13821 0.1305009,0.13818 l 6.3561867,-0.002 c 0.07533,-3e-5 0.127184,-0.0554 0.127111,-0.12992 l -0.0021,-2.11732 c -7.3e-5,-0.0747 -0.05488,-0.13114 -0.130211,-0.13124 l -3.835927,-0.001 z m -5.0288563,0.006 c -0.075331,1.6e-4 -0.1282891,-0.0616 -0.1281431,-0.13641 l 0.00207,-1.05897 c 1.472e-4,-0.0754 0.050745,-0.12793 0.126076,-0.12814 l 3.7139823,-0.0103 c 0.07519,-2.1e-4 0.130354,0.0549 0.130209,0.1302 l -0.0021,1.07344 c -1.43e-4,0.0747 -0.05296,0.12177 -0.128142,0.12194 z"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssssssssssssssssssssssccsssssssss" />
|
||||
<path
|
||||
style="fill:url(#linearGradient4847);stroke:#000006;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
|
||||
id="path4669-8"
|
||||
d="m 9.128125,290.3854 c 0,0.0747 -0.088061,0.13409 -0.1632469,0.13394 l -1.0270319,-0.002 c -0.075309,-1.6e-4 -0.1284816,-0.0596 -0.1285795,-0.13434 l -0.00207,-1.57833 c -9.78e-5,-0.0747 -0.059594,-0.13424 -0.1347806,-0.13434 l -6.3458527,-0.008 c -0.075186,-10e-5 -0.1364114,0.0616 -0.1364114,0.13641 v 4.50463 c 0,0.0747 0.061225,0.13641 0.1364114,0.13641 H 15.596683 c 0.07533,0 0.136309,-0.0616 0.136412,-0.13641 l 0.0062,-4.50463 c 1.03e-4,-0.0747 -0.05178,-0.13015 -0.12711,-0.13021 l -6.3489103,-0.005 c -0.075186,-5e-5 -0.1352525,0.0558 -0.135241,0.13057 l 2.355e-4,1.5273 z"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssssssssssssssscc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49032259"
|
||||
d="m 1.4552083,286.15207 v 1.5875"
|
||||
id="path4799"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="M 5.5562499,283.90311 H 11.377083"
|
||||
id="path4809"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.4983871"
|
||||
d="M 9.2604166,288.93019 H 15.610416"
|
||||
id="path4815"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5032258"
|
||||
d="m 15.478125,289.06248 v 3.96875"
|
||||
id="path4817"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.74354839"
|
||||
d="M 15.610416,293.16352 H 1.3229166"
|
||||
id="path4819"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5016129"
|
||||
d="m 1.4552083,293.03123 v -3.96875"
|
||||
id="path4821"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.76129031"
|
||||
d="m 1.3229166,287.87186 h 6.2177083 v -0.39688 c 0.046835,-0.19876 0.1523728,-0.35185 0.396875,-0.39687 h 1.0583333 c 0.203798,0.046 0.3525696,0.15839 0.396875,0.39687 v 0.39688 h 6.2177078"
|
||||
id="path4823"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.47903225"
|
||||
d="m 15.478125,286.15207 v 1.5875"
|
||||
id="path4825"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.52741933"
|
||||
d="m 1.3229166,288.93019 h 6.35"
|
||||
id="path4849"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5016129"
|
||||
d="m 7.5406249,290.33248 c 0.053822,0.16463 0.1162818,0.32765 0.396875,0.44979 h 1.0583333 c 0.2656949,-0.11387 0.3463096,-0.27777 0.396875,-0.44979"
|
||||
id="path4851"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49354839"
|
||||
d="m 7.5406249,289.06248 v 1.32292"
|
||||
id="path4853"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.50645161"
|
||||
d="m 9.3927082,289.06248 v 1.32292"
|
||||
id="path4855"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffef;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.47903227"
|
||||
d="m 1.3229166,286.01977 h 3.96875 c 0.3141845,-0.0698 0.3341114,-0.24069 0.396875,-0.39687"
|
||||
id="path4857"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49677423"
|
||||
d="m 6.2177083,285.6229 c 0.072285,0.16809 0.1030371,0.34858 0.396875,0.39687 H 10.31875 c 0.179896,-0.0515 0.345856,-0.12665 0.396875,-0.39687"
|
||||
id="path4859"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5"
|
||||
d="m 11.244792,285.6229 c 0.04778,0.19396 0.146343,0.35086 0.396875,0.39687 h 3.968749"
|
||||
id="path4861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.75"
|
||||
d="m 6.2177083,284.56457 c 0.078702,-0.13995 0.033329,-0.29762 0.3968749,-0.39688 H 10.31875 c 0.244504,0.045 0.35004,0.19812 0.396875,0.39688"
|
||||
id="path4863"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="m 5.6885416,284.0354 v 1.5875"
|
||||
id="path4865"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="m 6.2177083,284.56457 v 1.05833"
|
||||
id="path4867"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="m 10.715625,284.56457 v 1.05833"
|
||||
id="path4869"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.48387095"
|
||||
d="m 11.244792,284.0354 v 1.5875"
|
||||
id="path4871"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64"
|
||||
height="64"
|
||||
viewBox="0 0 16.933333 16.933334"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:export-filename="C:\Users\valen\source.coffebreak\VAR.Toolbox\VAR.Toolbox\Images\Toolbox.png"
|
||||
inkscape:export-xdpi="96.000008"
|
||||
inkscape:export-ydpi="96.000008"
|
||||
inkscape:version="0.92.1 r15371"
|
||||
sodipodi:docname="toolbox.svg">
|
||||
<defs
|
||||
id="defs2">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4845">
|
||||
<stop
|
||||
style="stop-color:#8d0000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop4841"/>
|
||||
<stop
|
||||
style="stop-color:#ff0400;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop4843"/>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient4839">
|
||||
<stop
|
||||
style="stop-color:#8f0000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop4835"/>
|
||||
<stop
|
||||
style="stop-color:#fc0000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop4837"/>
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4839"
|
||||
id="linearGradient4833"
|
||||
x1="10.583333"
|
||||
y1="293.95728"
|
||||
x2="10.583333"
|
||||
y2="282.84479"
|
||||
gradientUnits="userSpaceOnUse"/>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient4845"
|
||||
id="linearGradient4847"
|
||||
x1="9.921875"
|
||||
y1="294.03665"
|
||||
x2="9.7895832"
|
||||
y2="282.92416"
|
||||
gradientUnits="userSpaceOnUse"/>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="8"
|
||||
inkscape:cx="22.659532"
|
||||
inkscape:cy="29.638443"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
units="px"
|
||||
inkscape:window-width="1821"
|
||||
inkscape:window-height="1246"
|
||||
inkscape:window-x="-11"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-maximized="1">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4485"
|
||||
originy="0"/>
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4487"
|
||||
originx="0.13229167"
|
||||
originy="0.13229167"
|
||||
units="in"/>
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Capa 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-280.06665)">
|
||||
<path
|
||||
style="fill:url(#linearGradient4833);fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4665-6"
|
||||
d="m 11.641667,285.75519 c -0.07519,0 -0.132327,-0.055 -0.131923,-0.12982 l 0.01,-1.84881 c 4.07e-4,-0.0754 -0.06708,-0.13652 -0.142114,-0.13656 l -5.8221957,-0.003 c -0.075331,-4e-5 -0.127582,0.0629 -0.1276415,0.13802 l -0.00146,1.84724 c -5.91e-5,0.0747 -0.056695,0.13196 -0.1320265,0.13202 l -3.9709303,0.003 c -0.075186,6e-5 -0.1312438,0.0554 -0.1312438,0.13006 v 2.11525 c 0,0.0745 0.061225,0.13617 0.1364114,0.13612 l 6.3458527,-0.004 c 0.075331,-5e-5 0.1374335,-0.0575 0.1368477,-0.13199 l -0.00413,-0.52582 c -5.88e-4,-0.0748 0.05546,-0.13627 0.1306467,-0.13612 l 1.0559706,0.002 c 0.075331,1.5e-4 0.1346351,0.0531 0.1346351,0.12785 v 0.5279 c 0,0.0745 0.055461,0.13821 0.1305009,0.13818 l 6.3561867,-0.002 c 0.07533,-3e-5 0.127184,-0.0554 0.127111,-0.12992 l -0.0021,-2.11732 c -7.3e-5,-0.0747 -0.05488,-0.13114 -0.130211,-0.13124 l -3.835927,-0.001 z m -5.0288563,0.006 c -0.075331,1.6e-4 -0.1282891,-0.0616 -0.1281431,-0.13641 l 0.00207,-1.05897 c 1.472e-4,-0.0754 0.050745,-0.12793 0.126076,-0.12814 l 3.7139823,-0.0103 c 0.07519,-2.1e-4 0.130354,0.0549 0.130209,0.1302 l -0.0021,1.07344 c -1.43e-4,0.0747 -0.05296,0.12177 -0.128142,0.12194 z"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csssssssssssssssssssssssccsssssssss"/>
|
||||
<path
|
||||
style="fill:url(#linearGradient4847);stroke:#000006;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1"
|
||||
id="path4669-8"
|
||||
d="m 9.128125,290.3854 c 0,0.0747 -0.088061,0.13409 -0.1632469,0.13394 l -1.0270319,-0.002 c -0.075309,-1.6e-4 -0.1284816,-0.0596 -0.1285795,-0.13434 l -0.00207,-1.57833 c -9.78e-5,-0.0747 -0.059594,-0.13424 -0.1347806,-0.13434 l -6.3458527,-0.008 c -0.075186,-10e-5 -0.1364114,0.0616 -0.1364114,0.13641 v 4.50463 c 0,0.0747 0.061225,0.13641 0.1364114,0.13641 H 15.596683 c 0.07533,0 0.136309,-0.0616 0.136412,-0.13641 l 0.0062,-4.50463 c 1.03e-4,-0.0747 -0.05178,-0.13015 -0.12711,-0.13021 l -6.3489103,-0.005 c -0.075186,-5e-5 -0.1352525,0.0558 -0.135241,0.13057 l 2.355e-4,1.5273 z"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssssssssssssssscc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49032259"
|
||||
d="m 1.4552083,286.15207 v 1.5875"
|
||||
id="path4799"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="M 5.5562499,283.90311 H 11.377083"
|
||||
id="path4809"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.4983871"
|
||||
d="M 9.2604166,288.93019 H 15.610416"
|
||||
id="path4815"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5032258"
|
||||
d="m 15.478125,289.06248 v 3.96875"
|
||||
id="path4817"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.74354839"
|
||||
d="M 15.610416,293.16352 H 1.3229166"
|
||||
id="path4819"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5016129"
|
||||
d="m 1.4552083,293.03123 v -3.96875"
|
||||
id="path4821"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.76129031"
|
||||
d="m 1.3229166,287.87186 h 6.2177083 v -0.39688 c 0.046835,-0.19876 0.1523728,-0.35185 0.396875,-0.39687 h 1.0583333 c 0.203798,0.046 0.3525696,0.15839 0.396875,0.39687 v 0.39688 h 6.2177078"
|
||||
id="path4823"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.47903225"
|
||||
d="m 15.478125,286.15207 v 1.5875"
|
||||
id="path4825"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.52741933"
|
||||
d="m 1.3229166,288.93019 h 6.35"
|
||||
id="path4849"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5016129"
|
||||
d="m 7.5406249,290.33248 c 0.053822,0.16463 0.1162818,0.32765 0.396875,0.44979 h 1.0583333 c 0.2656949,-0.11387 0.3463096,-0.27777 0.396875,-0.44979"
|
||||
id="path4851"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49354839"
|
||||
d="m 7.5406249,289.06248 v 1.32292"
|
||||
id="path4853"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.50645161"
|
||||
d="m 9.3927082,289.06248 v 1.32292"
|
||||
id="path4855"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffef;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.47903227"
|
||||
d="m 1.3229166,286.01977 h 3.96875 c 0.3141845,-0.0698 0.3341114,-0.24069 0.396875,-0.39687"
|
||||
id="path4857"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49677423"
|
||||
d="m 6.2177083,285.6229 c 0.072285,0.16809 0.1030371,0.34858 0.396875,0.39687 H 10.31875 c 0.179896,-0.0515 0.345856,-0.12665 0.396875,-0.39687"
|
||||
id="path4859"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.5"
|
||||
d="m 11.244792,285.6229 c 0.04778,0.19396 0.146343,0.35086 0.396875,0.39687 h 3.968749"
|
||||
id="path4861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.75"
|
||||
d="m 6.2177083,284.56457 c 0.078702,-0.13995 0.033329,-0.29762 0.3968749,-0.39688 H 10.31875 c 0.244504,0.045 0.35004,0.19812 0.396875,0.39688"
|
||||
id="path4863"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccc"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="m 5.6885416,284.0354 v 1.5875"
|
||||
id="path4865"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="m 6.2177083,284.56457 v 1.05833"
|
||||
id="path4867"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.49516129"
|
||||
d="m 10.715625,284.56457 v 1.05833"
|
||||
id="path4869"
|
||||
inkscape:connector-curvature="0"/>
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.48387095"
|
||||
d="m 11.244792,284.0354 v 1.5875"
|
||||
id="path4871"
|
||||
inkscape:connector-curvature="0"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
@@ -23,8 +23,11 @@ namespace VAR.Toolbox
|
||||
string executingAssemblyPath = Assembly.GetExecutingAssembly().Location;
|
||||
string dirName = Path.GetDirectoryName(executingAssemblyPath);
|
||||
string execName = Path.GetFileNameWithoutExtension(executingAssemblyPath);
|
||||
string[] assemblyPaths = Directory.GetFiles(dirName, string.Format("{0}*.dll", execName));
|
||||
foreach (string assemblyPath in assemblyPaths) { AssemblyLoadFull(assemblyPath); }
|
||||
if (dirName != null)
|
||||
{
|
||||
string[] assemblyPaths = Directory.GetFiles(dirName, $"{execName}*.dll");
|
||||
foreach (string assemblyPath in assemblyPaths) { AssemblyLoadFull(assemblyPath); }
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
@@ -45,19 +48,25 @@ namespace VAR.Toolbox
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private static Assembly AssemblyLoadFull(string fullPath, List<string> allAssemblyNames = null)
|
||||
private static void AssemblyLoadFull(string fullPath, List<string> allAssemblyNames = null)
|
||||
{
|
||||
if (allAssemblyNames == null)
|
||||
{
|
||||
allAssemblyNames = AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetName().Name).ToList();
|
||||
}
|
||||
|
||||
Assembly asm = null;
|
||||
try
|
||||
{
|
||||
asm = Assembly.LoadFrom(fullPath);
|
||||
}
|
||||
catch (Exception) { }
|
||||
if (asm == null) { return null; }
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
if (asm == null) { return; }
|
||||
|
||||
allAssemblyNames.Add(asm.GetName().Name);
|
||||
|
||||
// Load dependencies
|
||||
@@ -67,13 +76,10 @@ namespace VAR.Toolbox
|
||||
{
|
||||
if (allAssemblyNames.Contains(asmName.Name) == false)
|
||||
{
|
||||
string fullPathAux = string.Format("{0}/{1}.dll", dirPath, asmName.Name);
|
||||
Assembly asmAux = AssemblyLoadFull(fullPathAux, allAssemblyNames);
|
||||
string fullPathAux = $"{dirPath}/{asmName.Name}.dll";
|
||||
AssemblyLoadFull(fullPathAux, allAssemblyNames);
|
||||
}
|
||||
}
|
||||
|
||||
return asm;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,4 +12,4 @@ using System.Runtime.InteropServices;
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("e8dab98d-4fd0-4d40-b29a-62b4c2fca4d7")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.*")]
|
||||
@@ -11,20 +11,20 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
public string Title
|
||||
{
|
||||
get { return base.Text; }
|
||||
set { Text = value; }
|
||||
get => base.Text;
|
||||
set => Text = value;
|
||||
}
|
||||
|
||||
public string Description
|
||||
{
|
||||
get { return lblDescription.Text; }
|
||||
set { lblDescription.Text = value; }
|
||||
get => lblDescription.Text;
|
||||
set => lblDescription.Text = value;
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return txtValue.Text; }
|
||||
set { txtValue.Text = value; }
|
||||
get => txtValue.Text;
|
||||
set => txtValue.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using VAR.Toolbox.Controls;
|
||||
|
||||
@@ -13,20 +14,17 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
public string Title
|
||||
{
|
||||
get { return base.Text; }
|
||||
set { Text = value; }
|
||||
get => base.Text;
|
||||
set => Text = value;
|
||||
}
|
||||
|
||||
public void LoadItems(List<string> items)
|
||||
{
|
||||
lsbItems.Items.Clear();
|
||||
lsbItems.Items.AddRange(items.ToArray());
|
||||
lsbItems.Items.AddRange(items.ToArray<object>());
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return (lsbItems.SelectedItem as string) ?? string.Empty; }
|
||||
}
|
||||
public string Value => (lsbItems.SelectedItem as string) ?? string.Empty;
|
||||
|
||||
private void lsbItems_SelectedIndexChanged(object sender, System.EventArgs e)
|
||||
{
|
||||
@@ -34,4 +32,4 @@ namespace VAR.Toolbox.UI
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using VAR.Toolbox.Code;
|
||||
using VAR.Toolbox.Code.Windows;
|
||||
using VAR.Toolbox.Controls;
|
||||
@@ -16,14 +15,14 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
#region Declarations
|
||||
|
||||
private bool _closing = false;
|
||||
private bool _closing;
|
||||
|
||||
private Label lblToolbox;
|
||||
private CButton btnExit;
|
||||
private Label _lblToolbox;
|
||||
private CButton _btnExit;
|
||||
|
||||
private NotifyIcon niTray = null;
|
||||
private NotifyIcon _niTray;
|
||||
|
||||
private static FrmToolbox _currentInstance = null;
|
||||
private static FrmToolbox _currentInstance;
|
||||
|
||||
#endregion Declarations
|
||||
|
||||
@@ -39,7 +38,7 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
Icon ico = Icon.ExtractAssociatedIcon(Application.ExecutablePath);
|
||||
Icon = ico;
|
||||
niTray.Icon = ico;
|
||||
_niTray.Icon = ico;
|
||||
}
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
@@ -74,7 +73,7 @@ namespace VAR.Toolbox.UI
|
||||
if (dialogResult == DialogResult.Yes)
|
||||
{
|
||||
_closing = true;
|
||||
niTray.Visible = false;
|
||||
_niTray.Visible = false;
|
||||
CloseChildWindows();
|
||||
Close();
|
||||
}
|
||||
@@ -102,18 +101,18 @@ namespace VAR.Toolbox.UI
|
||||
private void InitializeDynamicComponents()
|
||||
{
|
||||
SuspendLayout();
|
||||
const int toolSpacing = 5;
|
||||
const int toolWidth = 200;
|
||||
const int windowSpacing = 10;
|
||||
int nextYLocation = 0;
|
||||
const int ToolSpacing = 5;
|
||||
const int ToolWidth = 200;
|
||||
const int WindowSpacing = 10;
|
||||
|
||||
// Get list of ToolForms
|
||||
Type iToolForm = typeof(IToolForm);
|
||||
IEnumerable<Type> toolFormTypes = ReflectionUtils.GetTypesOfInterface(iToolForm);
|
||||
Dictionary<string, Type> dictToolFormTypes = toolFormTypes.ToDictionary(t =>
|
||||
{
|
||||
IToolForm toolForm = System.Runtime.Serialization.FormatterServices.GetUninitializedObject(t) as IToolForm;
|
||||
return toolForm.ToolName;
|
||||
IToolForm toolForm =
|
||||
System.Runtime.Serialization.FormatterServices.GetUninitializedObject(t) as IToolForm;
|
||||
return toolForm?.ToolName ?? t.Name;
|
||||
});
|
||||
|
||||
// Get list of ToolPanels
|
||||
@@ -121,27 +120,28 @@ namespace VAR.Toolbox.UI
|
||||
IEnumerable<Type> toolPanelTypes = ReflectionUtils.GetTypesOfInterface(iToolPanel).OrderBy(t => t.Name);
|
||||
|
||||
// lblToolbox
|
||||
lblToolbox = new Label
|
||||
_lblToolbox = new Label
|
||||
{
|
||||
Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right),
|
||||
Font = new Font(Font.FontFamily, ControlsUtils.GetFontSize(this, 27.75F), FontStyle.Bold, GraphicsUnit.Point, 0),
|
||||
Location = new Point(windowSpacing, windowSpacing),
|
||||
Font = new Font(Font.FontFamily, ControlsUtils.GetFontSize(this, 27.75F), FontStyle.Bold,
|
||||
GraphicsUnit.Point, 0),
|
||||
Location = new Point(WindowSpacing, WindowSpacing),
|
||||
Margin = new Padding(0, 0, 0, 0),
|
||||
Name = "lblToolbox",
|
||||
Size = new Size(toolWidth * 2 + toolSpacing, 50),
|
||||
Size = new Size(ToolWidth * 2 + ToolSpacing, 50),
|
||||
TabIndex = 6,
|
||||
Text = "Toolbox",
|
||||
TextAlign = ContentAlignment.MiddleCenter
|
||||
};
|
||||
lblToolbox.MouseDown += DragWindow_MouseDown;
|
||||
nextYLocation = lblToolbox.Location.Y + lblToolbox.Size.Height + windowSpacing;
|
||||
_lblToolbox.MouseDown += DragWindow_MouseDown;
|
||||
int nextYLocation = _lblToolbox.Location.Y + _lblToolbox.Size.Height + WindowSpacing;
|
||||
|
||||
// Tool buttons
|
||||
int idxButton = 0;
|
||||
int xStartButtons = windowSpacing;
|
||||
int xStepButtons = toolWidth + toolSpacing;
|
||||
int xStartButtons = WindowSpacing;
|
||||
int xStepButtons = ToolWidth + ToolSpacing;
|
||||
int yStartButtons = nextYLocation;
|
||||
int yStepButtons = 40 + toolSpacing;
|
||||
int yStepButtons = 40 + ToolSpacing;
|
||||
IEnumerable<KeyValuePair<string, Type>> sortedToolForms = dictToolFormTypes.OrderBy(p => p.Key);
|
||||
foreach (KeyValuePair<string, Type> p in sortedToolForms)
|
||||
{
|
||||
@@ -150,15 +150,15 @@ namespace VAR.Toolbox.UI
|
||||
CButton btn = new CButton
|
||||
{
|
||||
Location = new Point(x, y),
|
||||
Name = string.Format("btn{0}", p.Key),
|
||||
Size = new Size(toolWidth, 40),
|
||||
Name = $"btn{p.Key}",
|
||||
Size = new Size(ToolWidth, 40),
|
||||
TabIndex = idxButton,
|
||||
Text = p.Key,
|
||||
};
|
||||
btn.Click += (s, e) => { CreateWindow(p.Value); };
|
||||
Controls.Add(btn);
|
||||
|
||||
nextYLocation = btn.Location.Y + btn.Size.Height + windowSpacing;
|
||||
nextYLocation = btn.Location.Y + btn.Size.Height + WindowSpacing;
|
||||
|
||||
idxButton++;
|
||||
}
|
||||
@@ -166,48 +166,51 @@ namespace VAR.Toolbox.UI
|
||||
// Tool panels
|
||||
int idxPanel = 0;
|
||||
int yStartPanels = nextYLocation;
|
||||
int xStartPanels = windowSpacing;
|
||||
int xStartPanels = WindowSpacing;
|
||||
int xNextPanels = xStartPanels;
|
||||
foreach (Type t in toolPanelTypes)
|
||||
{
|
||||
ContainerControl pnl = Activator.CreateInstance(t) as ContainerControl;
|
||||
if (pnl == null) { continue; }
|
||||
|
||||
pnl.Location = new Point(xNextPanels, yStartPanels);
|
||||
Controls.Add(pnl);
|
||||
|
||||
int tempNextYLocation = pnl.Location.Y + pnl.Size.Height + windowSpacing;
|
||||
int tempNextYLocation = pnl.Location.Y + pnl.Size.Height + WindowSpacing;
|
||||
if (nextYLocation < tempNextYLocation)
|
||||
{
|
||||
nextYLocation = tempNextYLocation;
|
||||
}
|
||||
xNextPanels = pnl.Location.X + pnl.Size.Width + toolSpacing;
|
||||
|
||||
xNextPanels = pnl.Location.X + pnl.Size.Width + ToolSpacing;
|
||||
|
||||
if ((idxPanel % 2) == 1)
|
||||
{
|
||||
yStartPanels = nextYLocation;
|
||||
xNextPanels = xStartPanels;
|
||||
}
|
||||
|
||||
idxPanel++;
|
||||
}
|
||||
|
||||
// btnExit
|
||||
btnExit = new CButton
|
||||
_btnExit = new CButton
|
||||
{
|
||||
Anchor = ((AnchorStyles.Bottom | AnchorStyles.Left)
|
||||
| AnchorStyles.Right),
|
||||
Location = new Point(windowSpacing, nextYLocation),
|
||||
| AnchorStyles.Right),
|
||||
Location = new Point(WindowSpacing, nextYLocation),
|
||||
Name = "btnExit",
|
||||
Size = new Size(toolWidth * 2 + toolSpacing, 40),
|
||||
Size = new Size(ToolWidth * 2 + ToolSpacing, 40),
|
||||
TabIndex = 7,
|
||||
Text = "Exit",
|
||||
};
|
||||
btnExit.Click += BtnExit_Click;
|
||||
nextYLocation = btnExit.Location.Y + btnExit.Size.Height + windowSpacing;
|
||||
_btnExit.Click += BtnExit_Click;
|
||||
nextYLocation = _btnExit.Location.Y + _btnExit.Size.Height + WindowSpacing;
|
||||
|
||||
// FrmToolbox
|
||||
ClientSize = new Size(425, nextYLocation);
|
||||
Controls.Add(btnExit);
|
||||
Controls.Add(lblToolbox);
|
||||
Controls.Add(_btnExit);
|
||||
Controls.Add(_lblToolbox);
|
||||
FormBorderStyle = FormBorderStyle.Fixed3D;
|
||||
MaximizeBox = false;
|
||||
Name = "FrmToolbox";
|
||||
@@ -219,12 +222,12 @@ namespace VAR.Toolbox.UI
|
||||
ResumeLayout(false);
|
||||
|
||||
// niTray
|
||||
niTray = new NotifyIcon
|
||||
_niTray = new NotifyIcon
|
||||
{
|
||||
Text = "VAR.Toolbox",
|
||||
Visible = true
|
||||
};
|
||||
niTray.MouseClick += NiTray_MouseClick;
|
||||
_niTray.MouseClick += NiTray_MouseClick;
|
||||
|
||||
|
||||
ResumeLayout();
|
||||
@@ -234,21 +237,22 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
#region Window handling
|
||||
|
||||
private Form CreateWindow(Type type)
|
||||
private void CreateWindow(Type type)
|
||||
{
|
||||
var frm = Activator.CreateInstance(type) as Form;
|
||||
if (frm == null)
|
||||
{
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
|
||||
_forms.Add(frm);
|
||||
frm.FormClosing += FrmChild_FormClosing;
|
||||
if ((frm as IToolForm)?.HasIcon == false)
|
||||
{
|
||||
frm.Icon = Icon;
|
||||
}
|
||||
|
||||
frm.Show();
|
||||
return frm;
|
||||
}
|
||||
|
||||
private readonly List<Form> _forms = new List<Form>();
|
||||
@@ -263,7 +267,7 @@ namespace VAR.Toolbox.UI
|
||||
CloseChildWindows();
|
||||
}
|
||||
|
||||
private bool _wasMinimized = false;
|
||||
private bool _wasMinimized;
|
||||
|
||||
private void FrmToolbox_Resize(object sender, EventArgs e)
|
||||
{
|
||||
@@ -272,6 +276,7 @@ namespace VAR.Toolbox.UI
|
||||
_wasMinimized = true;
|
||||
HideChildWindows();
|
||||
}
|
||||
|
||||
if (FormWindowState.Normal == WindowState && _wasMinimized)
|
||||
{
|
||||
_wasMinimized = false;
|
||||
@@ -312,6 +317,7 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
List<T> list = new List<T>();
|
||||
if (_currentInstance == null) { return list; }
|
||||
|
||||
foreach (Form frm in _currentInstance._forms)
|
||||
{
|
||||
if (frm is T)
|
||||
@@ -319,10 +325,10 @@ namespace VAR.Toolbox.UI
|
||||
list.Add((T)(object)frm);
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion Window handling
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,4 +5,4 @@
|
||||
string ToolName { get; }
|
||||
bool HasIcon { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
namespace VAR.Toolbox.UI
|
||||
{
|
||||
public interface IToolPanel
|
||||
{
|
||||
}
|
||||
}
|
||||
public interface IToolPanel { }
|
||||
}
|
||||
2
VAR.Toolbox/UI/Tools/FrmCoder.Designer.cs
generated
2
VAR.Toolbox/UI/Tools/FrmCoder.Designer.cs
generated
@@ -1,4 +1,4 @@
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
partial class FrmCoder
|
||||
{
|
||||
|
||||
@@ -1,25 +1,26 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using VAR.Toolbox.Code.TextCoders;
|
||||
using VAR.Toolbox.Controls;
|
||||
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
public partial class FrmCoder : Frame, IToolForm
|
||||
{
|
||||
public string ToolName { get { return "Coder"; } }
|
||||
public string ToolName => "Coder";
|
||||
|
||||
public bool HasIcon { get { return false; } }
|
||||
public bool HasIcon => false;
|
||||
|
||||
public FrmCoder()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
cboCode.Items.AddRange(TextCoderFactory.GetNames());
|
||||
cboCode.Items.AddRange(TextCoderFactory.GetNames().ToArray<object>());
|
||||
cboCode.SelectedIndex = 1;
|
||||
}
|
||||
|
||||
private ITextCoder _coder = null;
|
||||
private ITextCoder _coder;
|
||||
|
||||
private void BtnDecode_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -32,6 +33,7 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
|
||||
txtOutput.Text = output;
|
||||
}
|
||||
|
||||
@@ -46,14 +48,13 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
}
|
||||
|
||||
txtOutput.Text = output;
|
||||
}
|
||||
|
||||
private void BtnSwap_Click(object sender, EventArgs e)
|
||||
{
|
||||
string temp = txtOutput.Text;
|
||||
txtOutput.Text = txtInput.Text;
|
||||
txtInput.Text = temp;
|
||||
(txtOutput.Text, txtInput.Text) = (txtInput.Text, txtOutput.Text);
|
||||
}
|
||||
|
||||
private void CboCode_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@@ -63,4 +64,4 @@ namespace VAR.Toolbox.UI
|
||||
txtKey.Enabled = _coder.NeedsKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using VAR.Toolbox.Code;
|
||||
using VAR.Toolbox.Code.Windows;
|
||||
using VAR.Toolbox.Controls;
|
||||
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
public class FrmCover : Frame
|
||||
{
|
||||
@@ -14,14 +14,19 @@ namespace VAR.Toolbox.UI
|
||||
private readonly Random _rnd = new Random();
|
||||
private readonly Timer _timer = new Timer();
|
||||
|
||||
private readonly uint _mouseX = 0;
|
||||
private readonly uint _mouseY = 0;
|
||||
private uint _mouseX;
|
||||
private uint _mouseY;
|
||||
|
||||
#endregion Declarations
|
||||
|
||||
#region Form life cycle
|
||||
|
||||
public FrmCover()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
Mouse.GetPosition(out _mouseX, out _mouseY);
|
||||
|
||||
@@ -47,6 +52,7 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
r = Rectangle.Union(r, s.Bounds);
|
||||
}
|
||||
|
||||
Top = r.Top;
|
||||
Left = r.Left;
|
||||
Width = r.Width;
|
||||
@@ -91,7 +97,11 @@ namespace VAR.Toolbox.UI
|
||||
(_rnd.Next() % 11) - 5,
|
||||
(_rnd.Next() % 11) - 5);
|
||||
}
|
||||
catch (Exception) { } // ignore exceptions moving mouse
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored exceptions moving mouse
|
||||
}
|
||||
|
||||
_timer.Stop();
|
||||
_timer.Start();
|
||||
}
|
||||
|
||||
2
VAR.Toolbox/UI/Tools/FrmIPScan.Designer.cs
generated
2
VAR.Toolbox/UI/Tools/FrmIPScan.Designer.cs
generated
@@ -1,4 +1,4 @@
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
partial class FrmIPScan
|
||||
{
|
||||
|
||||
@@ -6,13 +6,13 @@ using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using VAR.Toolbox.Controls;
|
||||
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
public partial class FrmIPScan : Frame, IToolForm
|
||||
{
|
||||
public string ToolName { get { return "IPScan"; } }
|
||||
public string ToolName => "IPScan";
|
||||
|
||||
public bool HasIcon { get { return false; } }
|
||||
public bool HasIcon => false;
|
||||
|
||||
public FrmIPScan()
|
||||
{
|
||||
@@ -24,19 +24,20 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
private void FrmIPScan_Disposed(object sender, EventArgs e)
|
||||
{
|
||||
running = false;
|
||||
_running = false;
|
||||
}
|
||||
|
||||
private void PrintStatus(string status)
|
||||
{
|
||||
if (lblStatus.IsDisposed) { return; }
|
||||
|
||||
if (lblStatus.InvokeRequired)
|
||||
{
|
||||
lblStatus.Invoke((MethodInvoker)(() => { lblStatus.Text = string.Format("Status: {0}", status); }));
|
||||
lblStatus.Invoke((MethodInvoker)(() => { lblStatus.Text = $"Status: {status}"; }));
|
||||
}
|
||||
else
|
||||
{
|
||||
lblStatus.Text = string.Format("Status: {0}", status);
|
||||
lblStatus.Text = $"Status: {status}";
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
@@ -44,6 +45,7 @@ namespace VAR.Toolbox.UI
|
||||
private void Control_SetEnabled(Control ctrl, bool enabled)
|
||||
{
|
||||
if (ctrl.IsDisposed) { return; }
|
||||
|
||||
if (ctrl.InvokeRequired)
|
||||
{
|
||||
ctrl.Invoke((MethodInvoker)(() => { ctrl.Enabled = enabled; }));
|
||||
@@ -63,23 +65,23 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
private void BtnStop_Click(object sender, EventArgs e)
|
||||
{
|
||||
running = false;
|
||||
_running = false;
|
||||
}
|
||||
|
||||
private bool running = false;
|
||||
private bool _running;
|
||||
|
||||
private void IPScan(string ipBase)
|
||||
{
|
||||
Control_SetEnabled(btnScan, false);
|
||||
running = true;
|
||||
ctrOutput.AddLine(string.Format("IPScan started at {0}", DateTime.UtcNow.ToString("s")));
|
||||
for (int i = 1; i < 255 && running; i++)
|
||||
_running = true;
|
||||
ctrOutput.AddLine($"IPScan started at {DateTime.UtcNow:s}");
|
||||
for (int i = 1; i < 255 && _running; i++)
|
||||
{
|
||||
string ip = ipBase + i.ToString();
|
||||
PrintStatus(string.Format("Scanning {0}", ip));
|
||||
PrintStatus($"Scanning {ip}");
|
||||
Ping p = new Ping();
|
||||
PingReply pingReply = p.Send(ip, 100);
|
||||
if (pingReply.Status == IPStatus.Success)
|
||||
if (pingReply != null && pingReply.Status == IPStatus.Success)
|
||||
{
|
||||
string name = "?";
|
||||
try
|
||||
@@ -88,14 +90,16 @@ namespace VAR.Toolbox.UI
|
||||
name = hostEntry.HostName;
|
||||
}
|
||||
catch (SocketException) { }
|
||||
ctrOutput.AddLine(string.Format("{0} ({1}) is up: ({2} ms)", ip, name, pingReply.RoundtripTime));
|
||||
|
||||
ctrOutput.AddLine($"{ip} ({name}) is up: ({pingReply.RoundtripTime} ms)");
|
||||
}
|
||||
|
||||
Application.DoEvents();
|
||||
}
|
||||
|
||||
PrintStatus("Idle");
|
||||
ctrOutput.AddLine(string.Format("IPScan ended at {0}", DateTime.UtcNow.ToString("s")));
|
||||
ctrOutput.AddLine($"IPScan ended at {DateTime.UtcNow:s}");
|
||||
Control_SetEnabled(btnScan, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
2
VAR.Toolbox/UI/Tools/FrmNetworkInfo.Designer.cs
generated
2
VAR.Toolbox/UI/Tools/FrmNetworkInfo.Designer.cs
generated
@@ -1,4 +1,4 @@
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
partial class FrmNetworkInfo
|
||||
{
|
||||
|
||||
@@ -7,13 +7,13 @@ using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VAR.Toolbox.Controls;
|
||||
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
public partial class FrmNetworkInfo : Frame, IToolForm
|
||||
{
|
||||
public string ToolName { get { return "NetworkInfo"; } }
|
||||
public string ToolName => "NetworkInfo";
|
||||
|
||||
public bool HasIcon { get { return false; } }
|
||||
public bool HasIcon => false;
|
||||
|
||||
public FrmNetworkInfo()
|
||||
{
|
||||
@@ -39,6 +39,7 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
var listItem = ddlNetworkInterfaces.SelectedItem as ListItem;
|
||||
if (listItem == null) { return; }
|
||||
|
||||
RefreshInterface(listItem.ID);
|
||||
}
|
||||
|
||||
@@ -59,9 +60,11 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
found = true;
|
||||
if (it.Text != nic.Description) { it.Text = nic.Description; }
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == false)
|
||||
{
|
||||
ddlNetworkInterfaces.Items.Add(new ListItem { ID = nic.Id, Text = nic.Description });
|
||||
@@ -69,7 +72,7 @@ namespace VAR.Toolbox.UI
|
||||
}
|
||||
}
|
||||
|
||||
private string _networkInterfaceId = null;
|
||||
private string _networkInterfaceId;
|
||||
|
||||
private void RefreshInterface()
|
||||
{
|
||||
@@ -92,16 +95,23 @@ namespace VAR.Toolbox.UI
|
||||
private void RefreshInterface(NetworkInterface nic)
|
||||
{
|
||||
if (txtID.Text != nic.Id) { txtID.Text = nic.Id; }
|
||||
|
||||
if (txtName.Text != nic.Name) { txtName.Text = nic.Name; }
|
||||
|
||||
string status = nic.OperationalStatus.ToString();
|
||||
if (txtStatus.Text != status) { txtStatus.Text = status; }
|
||||
|
||||
string speed = FormatNetworkSpeedUnits(nic.Speed);
|
||||
if (txtSpeed.Text != speed) { txtSpeed.Text = speed; }
|
||||
|
||||
if (txtDescription.Text != nic.Description) { txtDescription.Text = nic.Description; }
|
||||
|
||||
string strInterface = nic.NetworkInterfaceType.ToString();
|
||||
if (txtInterface.Text != strInterface) { txtInterface.Text = strInterface; }
|
||||
|
||||
string strMac = FormatPhysicalAddress(nic.GetPhysicalAddress().GetAddressBytes());
|
||||
if (txtMAC.Text != strMac) { txtMAC.Text = strMac; }
|
||||
|
||||
StringBuilder sbIPs = new StringBuilder();
|
||||
IPInterfaceProperties ipInterfaceProperties = nic.GetIPProperties();
|
||||
sbIPs.AppendLine("****** IPs *****");
|
||||
@@ -109,18 +119,21 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
sbIPs.AppendLine(uniAddress.Address.ToString());
|
||||
}
|
||||
|
||||
sbIPs.AppendLine();
|
||||
sbIPs.AppendLine("****** Gateways *****");
|
||||
foreach (GatewayIPAddressInformation gwAddress in ipInterfaceProperties.GatewayAddresses)
|
||||
{
|
||||
sbIPs.AppendLine(gwAddress.Address.ToString());
|
||||
}
|
||||
|
||||
sbIPs.AppendLine();
|
||||
sbIPs.AppendLine("****** DNSs *****");
|
||||
foreach (IPAddress dnsAddress in ipInterfaceProperties.DnsAddresses)
|
||||
{
|
||||
sbIPs.AppendLine(dnsAddress.ToString());
|
||||
}
|
||||
|
||||
string strIPs = sbIPs.ToString();
|
||||
if (txtIPs.Text != strIPs) { txtIPs.Text = strIPs; }
|
||||
}
|
||||
@@ -128,39 +141,44 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
private static string FormatNetworkSpeedUnits(long speed)
|
||||
{
|
||||
decimal dSpeed;
|
||||
if (speed < 1000)
|
||||
{
|
||||
return string.Format("{0}bps", speed);
|
||||
return $"{speed}bps";
|
||||
}
|
||||
dSpeed = speed / (decimal)1000;
|
||||
|
||||
decimal dSpeed = speed / (decimal)1000;
|
||||
if (dSpeed < 1000)
|
||||
{
|
||||
return string.Format("{0}kbps", Math.Round(dSpeed, 2));
|
||||
return $"{Math.Round(dSpeed, 2)}kbps";
|
||||
}
|
||||
|
||||
dSpeed /= 1000;
|
||||
if (dSpeed < 1000)
|
||||
{
|
||||
return string.Format("{0}mbps", Math.Round(dSpeed, 2));
|
||||
return $"{Math.Round(dSpeed, 2)}mbps";
|
||||
}
|
||||
|
||||
dSpeed /= 1000;
|
||||
if (dSpeed < 1000)
|
||||
{
|
||||
return string.Format("{0}gbps", Math.Round(dSpeed, 2));
|
||||
return $"{Math.Round(dSpeed, 2)}gbps";
|
||||
}
|
||||
|
||||
dSpeed /= 1000;
|
||||
return string.Format("{0}tbps", Math.Round(dSpeed, 2));
|
||||
return $"{Math.Round(dSpeed, 2)}tbps";
|
||||
}
|
||||
|
||||
private static string FormatPhysicalAddress(byte[] address)
|
||||
{
|
||||
StringBuilder sbAddres = new StringBuilder();
|
||||
StringBuilder sbAddress = new StringBuilder();
|
||||
foreach (byte b in address)
|
||||
{
|
||||
if (sbAddres.Length > 0) { sbAddres.Append(":"); }
|
||||
sbAddres.AppendFormat("{0:X2}", b);
|
||||
if (sbAddress.Length > 0) { sbAddress.Append(":"); }
|
||||
|
||||
sbAddress.AppendFormat("{0:X2}", b);
|
||||
}
|
||||
return sbAddres.ToString();
|
||||
|
||||
return sbAddress.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,8 +187,9 @@ namespace VAR.Toolbox.UI
|
||||
public string Text { get; set; }
|
||||
public string ID { get; set; }
|
||||
|
||||
public override string ToString() { return Text; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
2
VAR.Toolbox/UI/Tools/FrmProxyCmd.Designer.cs
generated
2
VAR.Toolbox/UI/Tools/FrmProxyCmd.Designer.cs
generated
@@ -1,4 +1,4 @@
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
partial class FrmProxyCmd
|
||||
{
|
||||
|
||||
@@ -2,19 +2,20 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using VAR.Toolbox.Code;
|
||||
using VAR.Toolbox.Code.ProxyCmdExecutors;
|
||||
using VAR.Toolbox.Controls;
|
||||
|
||||
namespace VAR.Toolbox.UI
|
||||
namespace VAR.Toolbox.UI.Tools
|
||||
{
|
||||
public partial class FrmProxyCmd : Frame, IOutputHandler, IToolForm
|
||||
{
|
||||
public string ToolName { get { return "ProxyCmd"; } }
|
||||
public string ToolName => "ProxyCmd";
|
||||
|
||||
public bool HasIcon { get { return false; } }
|
||||
public bool HasIcon => false;
|
||||
|
||||
#region Declarations
|
||||
|
||||
@@ -45,6 +46,7 @@ namespace VAR.Toolbox.UI
|
||||
Application.DoEvents();
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.KeyCode == Keys.Return)
|
||||
{
|
||||
e.Handled = true;
|
||||
@@ -58,35 +60,43 @@ namespace VAR.Toolbox.UI
|
||||
PrepareProxyCmdExecutor();
|
||||
new Thread(() => ExecuteCmd(cmd)).Start();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.KeyCode == Keys.LineFeed)
|
||||
{
|
||||
e.Handled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.KeyCode == Keys.Up)
|
||||
{
|
||||
e.Handled = true;
|
||||
if (_currentHistoryIndex == -1) { _currentHistoryIndex = _cmdHistory.Count; }
|
||||
|
||||
_currentHistoryIndex--;
|
||||
if (_currentHistoryIndex < 0)
|
||||
{
|
||||
_currentHistoryIndex = 0;
|
||||
}
|
||||
|
||||
if (_currentHistoryIndex >= 0 && _currentHistoryIndex < _cmdHistory.Count)
|
||||
{
|
||||
txtInput.Text = _cmdHistory[_currentHistoryIndex];
|
||||
txtInput.SelectionStart = txtInput.Text.Length;
|
||||
txtInput.SelectionLength = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.KeyCode == Keys.Down)
|
||||
{
|
||||
e.Handled = true;
|
||||
@@ -105,7 +115,6 @@ namespace VAR.Toolbox.UI
|
||||
txtInput.SelectionLength = 0;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,25 +132,25 @@ namespace VAR.Toolbox.UI
|
||||
|
||||
#region ProxyCmdExecutor
|
||||
|
||||
private IProxyCmdExecutor _proxyCmdExecutor = null;
|
||||
private IProxyCmdExecutor _proxyCmdExecutor;
|
||||
|
||||
private void PrepareProxyCmdExecutor()
|
||||
{
|
||||
if (_proxyCmdExecutor == null)
|
||||
{
|
||||
_proxyCmdExecutor = ProxyCmdExecutorFactory.CreateFromConfig(GetCurrentConfig());
|
||||
if (_proxyCmdExecutor == null)
|
||||
{
|
||||
_proxyCmdExecutor = new ProxyCmdExecutorDummy(string.Empty);
|
||||
}
|
||||
_proxyCmdExecutor = ProxyCmdExecutorFactory.CreateFromConfig(GetCurrentConfig()) ??
|
||||
new ProxyCmdExecutorDummy(string.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void CleanProxyCmdExecutor()
|
||||
{
|
||||
// ReSharper disable once SuspiciousTypeConversion.Global
|
||||
if (_proxyCmdExecutor is IDisposable disposableProxyCmdExecutor)
|
||||
{
|
||||
disposableProxyCmdExecutor.Dispose();
|
||||
}
|
||||
|
||||
_proxyCmdExecutor = null;
|
||||
}
|
||||
|
||||
@@ -163,6 +172,7 @@ namespace VAR.Toolbox.UI
|
||||
Logger.Log(ex);
|
||||
OutputLine(ex.Message);
|
||||
}
|
||||
|
||||
Monitor.Exit(_executionLock);
|
||||
}
|
||||
|
||||
@@ -190,8 +200,9 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
previousSelectedName = selectedConfig.Name;
|
||||
}
|
||||
|
||||
ddlCurrentConfig.Items.Clear();
|
||||
ddlCurrentConfig.Items.AddRange(configItems.ToArray());
|
||||
ddlCurrentConfig.Items.AddRange(configItems.ToArray<object>());
|
||||
ddlCurrentConfig.SelectedIndex = 0;
|
||||
if (string.IsNullOrEmpty(previousSelectedName) == false)
|
||||
{
|
||||
@@ -210,9 +221,10 @@ namespace VAR.Toolbox.UI
|
||||
{
|
||||
var selectedConfig = ddlCurrentConfig.SelectedItem as ProxyCmdConfigItem;
|
||||
if (selectedConfig == null) { return null; }
|
||||
|
||||
return selectedConfig.Config;
|
||||
}
|
||||
|
||||
#endregion Config
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user