Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed common compile warnings.

  • Loading branch information...
commit 7f44067e2be912507c10cb541afc9525764d75d0 1 parent 35aeb7a
@polyethene authored
View
1  Deploy/Deploy.csproj
@@ -59,7 +59,6 @@
<AssemblyOriginatorKeyFile>Deploy.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
View
1  IronAHK/IronAHK.csproj
@@ -63,7 +63,6 @@
<AssemblyOriginatorKeyFile>IronAHK.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
View
2  Rusty/Common/ImageSearcher/ImageFinder.cs
@@ -7,7 +7,7 @@ namespace IronAHK.Rusty.Common
/// <summary>
/// Class which provides common search Methods to find a Color or a subimage in given Image.
/// </summary>
- public class ImageFinder
+ class ImageFinder
{
#region Fields
View
5 Rusty/Common/Keyboard/KeyParser.cs
@@ -10,11 +10,6 @@ partial class Keyboard
{
internal class KeyParser
{
- /// <summary>
- /// Parses a stream of keys to a Keys-enumeration
- /// </summary>
- /// <param name="stream"></param>
- /// <returns></returns>
internal static IEnumerable<Keys> ParseKeyStream(string sequence)
{
var keys = new List<Keys>();
View
6 Rusty/Common/Window/WindowItemBase.cs
@@ -121,6 +121,7 @@ public int Delay
/// Sends MouseEvent to the current Window/Child/Control
/// </summary>
/// <param name="mouseevent">MouseEvent to send (for now we take also on abstract layer the windows enum, this might be mapped for other OS.)</param>
+ /// <param name="location"></param>
public abstract void SendMouseEvent(WindowsAPI.MOUSEEVENTF mouseevent, Point? location = null);
/// <summary>
@@ -280,6 +281,11 @@ public override bool Equals(object obj)
return base.Equals(obj);
}
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
public override string ToString()
{
return (this.IsSpecified) ? this.Title : "not specified window";
View
3  Rusty/Core/Helpers/Properties.cs
@@ -20,6 +20,9 @@ partial class Core
delegate void SimpleDelegate();
+ /// <summary>
+ ///
+ /// </summary>
public static event EventHandler ApplicationExit;
#endregion
View
18 Rusty/Core/Keyboard.cs
@@ -281,13 +281,13 @@ public static void KeyWait(string KeyName, string Options)
/// <summary>
/// Waits for the user to type a string (not supported on Windows 9x: it does nothing).
/// </summary>
- /// <param name="OutputVar">
+ /// <param name="result">
/// <para>The name of the variable in which to store the text entered by the user (by default, artificial input is also captured).</para>
/// <para>If this and the other parameters are omitted, any Input in progress in another thread is terminated and its ErrorLevel is set to the word NewInput. By contrast, the ErrorLevel of the current command will be set to 0 if it terminated a prior Input, or 1 if there was no prior Input to terminate.</para>
/// <para>OutputVar does not store keystrokes per se. Instead, it stores characters produced by keystrokes according to the active window's keyboard layout/language. Consequently, keystrokes that do not produce characters (such as PageUp and Escape) are not stored (though they can be recognized via the EndKeys parameter below).</para>
/// <para>Whitespace characters such as TAB (`t) are stored literally. ENTER is stored as linefeed (`n).</para>
/// </param>
- /// <param name="Options">
+ /// <param name="options">
/// <para>A string of zero or more of the following letters (in any order, with optional spaces in between):</para>
/// <para>B: Backspace is ignored. Normally, pressing backspace during an Input will remove the most recently pressed character from the end of the string. Note: If the input text is visible (such as in an editor) and the arrow keys or other means are used to navigate within it, backspace will still remove the last character rather than the one behind the caret (insertion point).</para>
/// <para>C: Case sensitive. Normally, MatchList is not case sensitive (in versions prior to 1.0.43.03, only the letters A-Z are recognized as having varying case, not letters like ü/Ü).</para>
@@ -303,7 +303,7 @@ public static void KeyWait(string KeyName, string Options)
/// <para>V: Visible. Normally, the user's input is blocked (hidden from the system). Use this option to have the user's keystrokes sent to the active window.</para>
/// <para>*: Wildcard (find anywhere). Normally, what the user types must exactly match one of the MatchList phrases for a match to occur. Use this option to find a match more often by searching the entire length of the input text.</para>
/// </param>
- /// <param name="EndKeys">
+ /// <param name="endKeys">
/// <para>A list of zero or more keys, any one of which terminates the Input when pressed (the EndKey itself is not written to OutputVar). When an Input is terminated this way, ErrorLevel is set to the word EndKey followed by a colon and the name of the EndKey. Examples: <code>EndKey:.
/// EndKey:Escape</code></para>
/// <para>The EndKey list uses a format similar to the Send command. For example, specifying {Enter}.{Esc} would cause either ENTER, period (.), or ESCAPE to terminate the Input. To use the braces themselves as end keys, specify {{} and/or {}}.</para>
@@ -311,14 +311,14 @@ public static void KeyWait(string KeyName, string Options)
/// <para>Although modified keys such as Control-C (^c) are not supported, certain keys that require the shift key to be held down -- namely punctuation marks such as ?!:@&amp;{} -- are supported in v1.0.14+.</para>
/// <para>An explicit virtual key code such as {vkFF} may also be specified. This is useful in the rare case where a key has no name and produces no visible character when pressed. Its virtual key code can be determined by following the steps at the bottom fo the key list page.</para>
/// </param>
- /// <param name="MatchList">
+ /// <param name="matchList">
/// <para>A comma-separated list of key phrases, any of which will cause the Input to be terminated (in which case ErrorLevel will be set to the word Match). The entirety of what the user types must exactly match one of the phrases for a match to occur (unless the * option is present). In addition, any spaces or tabs around the delimiting commas are significant, meaning that they are part of the match string. For example, if MatchList is "ABC , XYZ ", the user must type a space after ABC or before XYZ to cause a match.</para>
/// <para>Two consecutive commas results in a single literal comma. For example, the following would produce a single literal comma at the end of string: "string1,,,string2". Similarly, the following list contains only a single item with a literal comma inside it: "single,,item".</para>
/// <para>Because the items in MatchList are not treated as individual parameters, the list can be contained entirely within a variable. In fact, all or part of it must be contained in a variable if its length exceeds 16383 since that is the maximum length of any script line. For example, MatchList might consist of %List1%,%List2%,%List3% -- where each of the variables contains a large sub-list of match phrases.</para>
/// </param>
- public static void Input(out string OutputVar, string Options, string EndKeys, string matchList)
+ public static void Input(out string result, string options, string endKeys, string matchList)
{
- OutputVar = null;
+ result = null;
InitKeyboardHook();
var optsItems = new Dictionary<string, Regex>();
@@ -341,7 +341,7 @@ public static void Input(out string OutputVar, string Options, string EndKeys, s
optsItems.Add(Keyword_FindAnyWhereS, new Regex("(\\" + Keyword_FindAnyWhereS + ")"));
- var dicOptions = ParseOptionsRegex(ref Options, optsItems, true);
+ var dicOptions = ParseOptionsRegex(ref options, optsItems, true);
#endregion
@@ -384,7 +384,7 @@ public static void Input(out string OutputVar, string Options, string EndKeys, s
}
// Parse EndKeys
- var endkeys = Keyboard.KeyParser.ParseKeyStream(EndKeys);
+ var endkeys = Keyboard.KeyParser.ParseKeyStream(endKeys);
foreach(var key in endkeys)
inputHandler.Endkeys.Add(key);
@@ -396,7 +396,7 @@ public static void Input(out string OutputVar, string Options, string EndKeys, s
#endregion
var abortReason = inputHandler.StartCatching();
- OutputVar = abortReason.CatchedText;
+ result = abortReason.CatchedText;
ErrorLevel = (int)abortReason.Reason;
}
View
2  Rusty/Core/Process.cs
@@ -146,7 +146,7 @@ public static void Run(string target, string workingDir, string showMode, out in
pid = prc.Id;
}
- catch (Exception e)
+ catch (Exception)
{
if (error)
ErrorLevel = 2;
View
24 Rusty/Core/Window.cs
@@ -51,21 +51,21 @@ public static void Control(string Cmd, string Value, string ControlID, string Wi
/// <summary>
/// Sends a mouse button or mouse wheel event to a control.
/// </summary>
- /// <param name="controlOrPos">
+ /// <param name="mode">
/// <para>If this parameter is blank, the target window's topmost control will be clicked (or the target window itself if it has no controls). Otherwise, one of the two modes below will be used.</para>
/// <para>Mode 1 (Position): Specify the X and Y coordinates relative to the target window's upper left corner. The X coordinate must precede the Y coordinate and there must be at least one space or tab between them. For example: X55 Y33. If there is a control at the specified coordinates, it will be sent the click-event at those exact coordinates. If there is no control, the target window itself will be sent the event (which might have no effect depending on the nature of the window). Note: In this mode, the X and Y option letters of the Options parameter are ignored.</para>
/// <para>Mode 2 (ClassNN or Text): Specify either ClassNN (the classname and instance number of the control) or the name/text of the control, both of which can be determined via Window Spy. When using name/text, the matching behavior is determined by SetTitleMatchMode.</para>
/// <para>By default, mode 2 takes precedence over mode 1. For example, in the unlikely event that there is a control whose text or ClassNN has the format "Xnnn Ynnn", it would be acted upon by Mode 2. To override this and use mode 1 unconditionally, specify the word Pos in Options as in the following example: ControlClick, x255 y152, WinTitle,,,, Pos</para>
/// <para>To operate upon a control's HWND (window handle), leave this parameter blank and specify ahk_id %ControlHwnd% for the WinTitle parameter (this also works on hidden controls even when DetectHiddenWindows is Off) . The HWND of a control is typically retrieved via ControlGet Hwnd, MouseGetPos, or DllCall.</para></param>
- /// <param name="WinTitle">The title or partial title of the target window (the matching behavior is determined by SetTitleMatchMode). If this and the other 3 window parameters are omitted, the Last Found Window will be used. If this is the letter A and the other 3 window parameters are omitted, the active window will be used. To use a window class, specify ahk_class ExactClassName (shown by Window Spy). To use a process identifier (PID), specify ahk_pid %VarContainingPID%. To use a window group, specify ahk_group GroupName. To use a window's unique ID number, specify ahk_id %VarContainingID%. The search can be narrowed by specifying multiple criteria. For example: My File.txt ahk_class Notepad</param>
- /// <param name="WinText">If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.</param>
- /// <param name="WhichButton">
+ /// <param name="title">The title or partial title of the target window (the matching behavior is determined by SetTitleMatchMode). If this and the other 3 window parameters are omitted, the Last Found Window will be used. If this is the letter A and the other 3 window parameters are omitted, the active window will be used. To use a window class, specify ahk_class ExactClassName (shown by Window Spy). To use a process identifier (PID), specify ahk_pid %VarContainingPID%. To use a window group, specify ahk_group GroupName. To use a window's unique ID number, specify ahk_id %VarContainingID%. The search can be narrowed by specifying multiple criteria. For example: My File.txt ahk_class Notepad</param>
+ /// <param name="text">If present, this parameter must be a substring from a single text element of the target window (as revealed by the included Window Spy utility). Hidden text elements are detected if DetectHiddenText is ON.</param>
+ /// <param name="button">
/// <para>The button to click: LEFT, RIGHT, MIDDLE (or just the first letter of each of these). If omitted or blank, the LEFT button will be used.</para>
/// <para>WheelUp (or WU) and WheelDown (or WD) are also supported on Windows NT/2000/XP or later. In this case, ClickCount is the number of notches to turn the wheel.</para>
/// <para>X1 (XButton1, the 4th mouse button) and X2 (XButton2, the 5th mouse button) are also supported on Windows 2000/XP or later.</para>
/// </param>
- /// <param name="ClickCount">The number of clicks to send. If omitted or blank, 1 click is sent.</param>
- /// <param name="Options">
+ /// <param name="clickCount">The number of clicks to send. If omitted or blank, 1 click is sent.</param>
+ /// <param name="options">
/// <para>A series of zero or more of the following option letters. For example: d x50 y25</para>
/// <para>NA: Avoids activating the window, which might also improve reliability in cases where the user is physically moving the mouse during the ControlClick. However, this mode might not work properly for all types of windows and controls.</para>
/// <para>D: Press the mouse button down but do not release it (i.e. generate a down-event). If both the D and U options are absent, a complete click (down and up) will be sent.</para>
@@ -75,23 +75,21 @@ public static void Control(string Cmd, string Value, string ControlID, string Wi
/// <para>Yn: Specify for n the Y position to click at, relative to the control's upper left corner. If unspecified, the click will occur at the vertical-center of the control.</para>
/// <para>Use decimal (not hexadecimal) numbers for the X and Y options.</para>
/// </param>
- /// <param name="ExcludeTitle">Windows whose titles include this value will not be considered.</param>
- /// <param name="ExcludeText">Windows whose text include this value will not be considered.</param>
- public static void ControlClick(string controlOrPos, string title, string text, string WhichButton, string ClickCount, string Options, string excludeTitle, string excludeText)
+ /// <param name="excludeTitle">Windows whose titles include this value will not be considered.</param>
+ /// <param name="excludeText">Windows whose text include this value will not be considered.</param>
+ public static void ControlClick(string mode, string title, string text, string button, int clickCount, string options, string excludeTitle, string excludeText)
{
Point _click;
Point? click = null;
var criteria = Window.SearchCriteria.FromString(title, text, excludeTitle, excludeText);
var target = windowManager.FindWindow(criteria);
- int clickCount = 1;
-
if(!target.IsSpecified)
return; // window/control not found.
- if(string.IsNullOrEmpty(controlOrPos)) {
+ if(string.IsNullOrEmpty(mode)) {
// click topmost control/window
- } else if(TryParseCoordinate(controlOrPos, out _click)) {
+ } else if(TryParseCoordinate(mode, out _click)) {
click = _click;
} else {
// controlOrPos must be control identifier
View
2  Rusty/Linux/XConnection.cs
@@ -13,7 +13,7 @@ namespace IronAHK.Rusty.Linux
/// Singleton class to keep track of all active windows and their
/// events to help the hotkey and window management code
/// </summary>
- public class XConnectionSingleton : IDisposable
+ class XConnectionSingleton : IDisposable
{
#region Singleton boilerplate
static XConnectionSingleton Instance;
View
2  Scripting/Scripting.csproj
@@ -53,7 +53,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
View
1  Tests/Tests.csproj
@@ -146,7 +146,6 @@
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Please sign in to comment.
Something went wrong with that request. Please try again.