From 1254f5619359be4546d4ed24bb70acffa1f4fdda Mon Sep 17 00:00:00 2001 From: Mahmoud Gomaa Date: Mon, 6 Dec 2021 18:55:28 +0200 Subject: [PATCH] Add files via upload --- docs/Examples/CopyPath.cshtml | 53 +++ docs/Examples/Favorites.cshtml | 43 +++ docs/Examples/Goto.cshtml | 64 ++++ docs/Examples/Index.cshtml | 8 + docs/Examples/Taskbar.cshtml | 28 ++ docs/Expressions/Color.cshtml | 9 + docs/Expressions/Comments.cshtml | 58 ++++ docs/Expressions/Identfier.cshtml | 9 + docs/Expressions/Index.cshtml | 18 ++ docs/Expressions/Numeric.cshtml | 55 ++++ docs/Expressions/Operators - Copy.cshtml | 193 +++++++++++ docs/Expressions/Operators.cshtml | 191 +++++++++++ docs/Expressions/String.cshtml | 51 +++ docs/Functions/App.cshtml | 20 ++ docs/Functions/Color.cshtml | 153 +++++++++ docs/Functions/IO.cshtml | 40 +++ docs/Functions/Image.cshtml | 20 ++ docs/Functions/Index.cshtml | 111 +++++++ docs/Functions/Key.cshtml | 66 ++++ docs/Functions/Msg.cshtml | 119 +++++++ docs/Functions/Path.cshtml | 50 +++ docs/Functions/Reg.cshtml | 23 ++ docs/Functions/Sel.cshtml | 288 +++++++++++++++++ docs/Functions/Str.cshtml | 35 ++ docs/Functions/Sys.cshtml | 60 ++++ docs/Functions/User.cshtml | 32 ++ docs/GetStarted.cshtml | 34 ++ docs/Index.cshtml | 46 +++ docs/Installation.cshtml | 56 ++++ docs/Syntax/Dynamic.cshtml | 393 +++++++++++++++++++++++ docs/Syntax/Index.cshtml | 127 ++++++++ docs/Syntax/Static.cshtml | 198 ++++++++++++ docs/Syntax/Variables.cshtml | 51 +++ docs/_DocsLayout.cshtml | 165 ++++++++++ docs/_ViewStart.cshtml | 3 + 35 files changed, 2870 insertions(+) create mode 100644 docs/Examples/CopyPath.cshtml create mode 100644 docs/Examples/Favorites.cshtml create mode 100644 docs/Examples/Goto.cshtml create mode 100644 docs/Examples/Index.cshtml create mode 100644 docs/Examples/Taskbar.cshtml create mode 100644 docs/Expressions/Color.cshtml create mode 100644 docs/Expressions/Comments.cshtml create mode 100644 docs/Expressions/Identfier.cshtml create mode 100644 docs/Expressions/Index.cshtml create mode 100644 docs/Expressions/Numeric.cshtml create mode 100644 docs/Expressions/Operators - Copy.cshtml create mode 100644 docs/Expressions/Operators.cshtml create mode 100644 docs/Expressions/String.cshtml create mode 100644 docs/Functions/App.cshtml create mode 100644 docs/Functions/Color.cshtml create mode 100644 docs/Functions/IO.cshtml create mode 100644 docs/Functions/Image.cshtml create mode 100644 docs/Functions/Index.cshtml create mode 100644 docs/Functions/Key.cshtml create mode 100644 docs/Functions/Msg.cshtml create mode 100644 docs/Functions/Path.cshtml create mode 100644 docs/Functions/Reg.cshtml create mode 100644 docs/Functions/Sel.cshtml create mode 100644 docs/Functions/Str.cshtml create mode 100644 docs/Functions/Sys.cshtml create mode 100644 docs/Functions/User.cshtml create mode 100644 docs/GetStarted.cshtml create mode 100644 docs/Index.cshtml create mode 100644 docs/Installation.cshtml create mode 100644 docs/Syntax/Dynamic.cshtml create mode 100644 docs/Syntax/Index.cshtml create mode 100644 docs/Syntax/Static.cshtml create mode 100644 docs/Syntax/Variables.cshtml create mode 100644 docs/_DocsLayout.cshtml create mode 100644 docs/_ViewStart.cshtml diff --git a/docs/Examples/CopyPath.cshtml b/docs/Examples/CopyPath.cshtml new file mode 100644 index 0000000..3bc9491 --- /dev/null +++ b/docs/Examples/CopyPath.cshtml @@ -0,0 +1,53 @@ +@page +@{ + ViewData["title"] = "Copy Path - Examples"; + ViewData["page-support"] = "Examples \\ Copy Path"; + ViewData["meta-og:image"] = "/images/support/examples/copypath1.png"; +} +
Copy Path example
+
shell 
+{
+    dynamic
+    {
+        // type can set with '~taskbar' equals all file types except taskbar.
+        menu(type='file|dir|back|root|namespace' title='copy to clipboard' image=#ff00ff)
+        {
+            // Appears only when multiple selections.
+            item(vis=@@(sel.count > 1) title='Copy path (@@sel.count) items selected'
+                    cmd=@@sys.copy(sel(false, "\n")))
+
+            item(mode=single title=@@sel.path 
+                    cmd=@@sys.copy(sel.path))
+
+            item(mode=single type='file|dir|back.dir'
+                    vis=@@sel.short.len!=sel.path.len title=@@sel.short
+                    cmd=@@sys.copy(sel.short))
+            separator
+            item(mode=single vis=@@(sel.parent.len>3) title=@@sel.parent 
+                    cmd=@@sys.copy(sel.parent))
+            separator
+            item(mode=single type='file|dir|back.dir' title=@@sel.file.name
+                    cmd=@@sys.copy(sel.file.name))
+                   
+            item(mode=single type='file' title=@@sel.file.title
+                    cmd=@@sys.copy(sel.file.title))
+
+            item(mode=single type='file' title=@@sel.file.ext
+                   cmd=@@sys.copy(sel.file.ext))
+        }
+    }
+}
+ +
+ + + + + + + + + + + +
\ No newline at end of file diff --git a/docs/Examples/Favorites.cshtml b/docs/Examples/Favorites.cshtml new file mode 100644 index 0000000..af3708d --- /dev/null +++ b/docs/Examples/Favorites.cshtml @@ -0,0 +1,43 @@ +@page +@{ + ViewData["title"] = "Favorites - Examples"; + ViewData["page-support"] = "Examples \\ Favorites"; + ViewData["meta-og:image"] = "/images/support/examples/fav1.png"; +} +
Favorite applications and directories example
+
shell 
+{
+    dynamic
+    {
+        menu(type='desktop|taskbar' title='Favorites' image=#00ff00)
+        {
+            menu(title='Applications' image=#ff0000)
+            {
+                item(title='Command propt' image cmd='cmd.exe')
+                item(title='PowerShell' image cmd='powershell.exe')
+                item(title='Registry editor' image cmd='regedit.exe')
+                separator
+                item(title='Paint' image cmd='mspaint.exe')
+                item(title='Notepad' image cmd='notepad.exe')
+            }
+            separator
+            menu(title='Directories' image=#0000ff)
+            {
+                item(title='Downloads' cmd=@@user.downloads)
+                item(title='Pictures' cmd=@@user.pictures)
+                item(title='Home' cmd=@@user.directory)
+                separator
+                item(title='Windows' cmd=@@sys.directory)
+                item(title='Program files' cmd=@@sys.prog)
+            }
+        }
+    }
+}
+
+ + + + + + +
diff --git a/docs/Examples/Goto.cshtml b/docs/Examples/Goto.cshtml new file mode 100644 index 0000000..0f0eaab --- /dev/null +++ b/docs/Examples/Goto.cshtml @@ -0,0 +1,64 @@ +@page +@{ + ViewData["title"] = "Goto - Examples"; + ViewData["page-support"] = "Examples \\ Goto"; + ViewData["meta-og:image"] = "/images/support/examples/goto.png"; +} +
Goto example
+
shell
+{
+    dynamic
+    {
+        menu(mode=multiple title='goto' separator=bottom image=0xed25)
+        {
+            item(title='Windows' image-inherit cmd=@@sys.dir)
+            item(title='System' image-inherit cmd=@@sys.bin)
+            item(title='Program Files' image-inherit cmd=@@sys.prog)
+            item(title='Program Files x86' image-inherit cmd=@@sys.prog32)
+            item(title='ProgramData' image-inherit cmd=@@sys.programdata)
+            item(title='Applications' image-inherit cmd='shell:appsfolder')
+            item(title='Users' image-inherit cmd=@@sys.users)
+            item(title='Control Panel' image=0xe115 cmd='shell:::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}')
+            item(title='Control Panel (All Tasks)' image=0xe115 cmd='shell:::{ED7BA470-8E54-465E-825C-99712043E01C}')
+            item(title='run' cmd='shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}')
+            separator
+            item(title=@@user.name@@@@@@sys.name vis=disable)
+            item(title='Desktop' image-inherit cmd=@@user.desktop)
+            item(title='Downloads' image-inherit cmd=@@user.downloads)
+            item(title='Pictures' image-inherit cmd=@@user.pictures)
+            item(title='Documents' image-inherit cmd=@@user.documents)
+            item(title='Startmenu' image-inherit cmd=@@user.startmenu)
+            item(title='Profile' image-inherit cmd=@@user.dir)
+            item(title='AppData' image-inherit cmd=@@user.appdata)
+            item(title='Temp' image-inherit cmd=@@user.temp)
+            menu(title='settings' separator=top image=0xe115)
+            {
+                // https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-settings-app
+                item(title='systeminfo' image=0xe946 cmd-line='/K systeminfo')
+                item(title='search' cmd='search-ms:' image=0xe721)
+                item(title='settings' image-inherit cmd='ms-settings:')
+                item(title='about' image=0xe946 cmd='ms-settings:about')
+                item(title='usb' image=0xe88e cmd='ms-settings:usb')
+                item(title='network-status' image=0xec27 cmd='ms-settings:network-status')
+                item(title='network-ethernet' image=0xe839 cmd='ms-settings:network-ethernet')
+                item(title='personalization-background' image=0xeb9f cmd='ms-settings:personalization-background')
+                item(title='personalization-colors' image=0xe790 cmd='ms-settings:colors')
+                item(title='lockscreen' image=0xee3f cmd='ms-settings:lockscreen')
+                item(title='personalization-start' image=0xeca5 cmd='ms-settings:personalization-start')
+                item(title='appsfeatures' image=0xe179 cmd='ms-settings:appsfeatures')
+                item(title='optionalfeatures' image=0xe179 cmd='ms-settings:optionalfeatures')
+                item(title='defaultapps' image=0xe17d cmd='ms-settings:defaultapps')
+                item(title='yourinfo' image=0xe136 cmd='ms-settings:yourinfo')
+                item(title='windowsupdate' image=0xe895 cmd='ms-settings:windowsupdate')
+                item(title='windowsdefender' image=0xe83d cmd='ms-settings:windowsdefender')
+                item(title='network connections' image-inherit cmd='shell:::{7007ACC7-3202-11D1-AAD2-00805FC1270E}')
+            }
+        }
+    }
+}
+ +
+ + + +
\ No newline at end of file diff --git a/docs/Examples/Index.cshtml b/docs/Examples/Index.cshtml new file mode 100644 index 0000000..5d1256b --- /dev/null +++ b/docs/Examples/Index.cshtml @@ -0,0 +1,8 @@ +@page +@{ + ViewData["page-support"] = "Examples"; +} +

Examples


+

This page contains some examples of what Shell can do.

+ + diff --git a/docs/Examples/Taskbar.cshtml b/docs/Examples/Taskbar.cshtml new file mode 100644 index 0000000..8cce95c --- /dev/null +++ b/docs/Examples/Taskbar.cshtml @@ -0,0 +1,28 @@ +@page +@{ + ViewData["page-support"] = "Examples \\ Taskbar"; + //ViewData["meta-og:image"] = "/images/support/config.png"; +} + +
Taskbar example
+
shell 
+{
+     var
+    {
+        hello_world = 'Hello World!'
+    }
+
+    dynamic
+    {
+	  item(title=@@hello_world cmd=@@msgbox(@@hello_world))
+	  separator
+	  item(title='Command prompt' cmd='cmd.exe' args='/k echo @@hello_world')
+	  separator
+	  menu(title='Sub menu')
+	  {
+	      item(title='Open Paint' cmd='paint.exe' arg=@@sel.path)
+	      separator
+	      item(title='Open Notepad' cmd='notepad.exe' arg='"@@sel.path"')
+	  }
+    }
+}
\ No newline at end of file diff --git a/docs/Expressions/Color.cshtml b/docs/Expressions/Color.cshtml new file mode 100644 index 0000000..9ca27f3 --- /dev/null +++ b/docs/Expressions/Color.cshtml @@ -0,0 +1,9 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ Color"; +} + +

Color literal

+
+
Hexadecimal Colors
+

interprets color constants as hexadecimal if they are preceded by # and hexadecimal color is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color. All values must be between 00 and FF.
For example, the #0000FF value is rendered as blue, because the blue component is set to its highest value (FF) and the others are set to 00.
There are 140 color names are predefined under the color scope.

\ No newline at end of file diff --git a/docs/Expressions/Comments.cshtml b/docs/Expressions/Comments.cshtml new file mode 100644 index 0000000..4e7aa44 --- /dev/null +++ b/docs/Expressions/Comments.cshtml @@ -0,0 +1,58 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ Comments"; +} +

Comments

+

Comments can be used to explain Shell code, and to make it more readable. It can also be used to prevent execution Shell code. Comments can be singled-lined or multi-lined.

+
+
Single-line Comments
+

+ Single-line comments start with two forward slashes (//).
+ Any text between // and the end of the line is ignored by the compiler (will not be executed). +

+

This example uses a single-line comment before a line of code:

+
shell
+{
+    dynamic 
+    {
+        // This is a comment
+        item(title='Hello World!')
+        
+        //item(title='Hello World!')
+    }
+}
+ +

This example uses a single-line comment at the end of a line of code:

+
shell
+{
+    dynamic 
+    {
+        item(title='Hello World!') // This is a comment
+    }
+}
+
+
+
+
Multi-line Comments
+

+ Multi-line comments start with /* and ends with */.
+ Any text between /* and */ will be ignored by the compiler: +

+
shell
+{
+    dynamic
+    {
+        item(title='Hello,/* multiple-lines comment inside */ world')
+        
+        /*
+        item(title='test item 1')
+        item(title='test item 2')
+        */
+    }
+
+}
+

+ Single or multi-line comments?
+ It is up to you which you want to use. Normally, we use // for short comments, and /* */ for longer. +

+
\ No newline at end of file diff --git a/docs/Expressions/Identfier.cshtml b/docs/Expressions/Identfier.cshtml new file mode 100644 index 0000000..cf69038 --- /dev/null +++ b/docs/Expressions/Identfier.cshtml @@ -0,0 +1,9 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ Identifier"; +} +

Identifier

+
+

The Identifier have unique titles described by fully qualified names that indicate a logical hierarchy.
The Identifier that has no parameters. Parentheses are added when necessary to separate:

+

There is a hierarchy of keywords in that some keywords are always followed by others.

+
sel.path
sel.path().ext
diff --git a/docs/Expressions/Index.cshtml b/docs/Expressions/Index.cshtml new file mode 100644 index 0000000..1d9e459 --- /dev/null +++ b/docs/Expressions/Index.cshtml @@ -0,0 +1,18 @@ +@page +@{ + ViewData["page-support"] = "Expressions"; +} +

Expressions

+
+

Shell provides a variety of statements and expressions. Most of these will be familiar to developers who have programmed in C, C++, C#.

+

Expressions gives you all the power of Shell, but is using a simplified syntax that's easier to learn if you're a beginner, and makes you more productive if you're an expert.

+

To use expressions, you write them by using proper syntax. Syntax is the set of rules by which the words and symbols in an expression are correctly combined. Initially, expressions in Shell are a little bit hard to read. But with a good understanding of expression syntax and a little practice, it becomes much easier.

+ + +@*interprets string as expressions if they are preceded by @@*@ + diff --git a/docs/Expressions/Numeric.cshtml b/docs/Expressions/Numeric.cshtml new file mode 100644 index 0000000..fe23283 --- /dev/null +++ b/docs/Expressions/Numeric.cshtml @@ -0,0 +1,55 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ Numeric literal"; +} +

Numeric literals

+
+

There are two types of numbers. Integer and floating point.

+
Integer literals
+

An integer is a numeric literal(associated with numbers) without any fractional or exponential part. There are two types of integer literals:

+
    +
  1. Decimal literal (base 10)
  2. +
  3. Hexadecimal literal (base 16)
  4. +
+

1. Decimal-literal(base 10):
A non-zero decimal digit followed by zero or more decimal digits(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).

+For example:
Decimal: 0, -9, 22 etc
+

2. Hexadecimal-literal(base 16):
0x followed by one or more hexadecimal digits(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f).

+For example: +
Hexadecimal: 0x7f, 0x2a, 0x521 etc
+
Floating-point iterals
+@*

A floating-point literal is a numeric literal that has either a fractional form or an exponent form. For example:

*@ +

Floating-point literals specify values that must have a fractional part. These values contain decimal points (.)

+For example: +
-2.0
0.0000234
+@* +integer_literal + : decimal_integer_literal + | hexadecimal_integer_literal + + +decimal_integer_literal + : decimal_digit+ integer_type_suffix? + + +decimal_digit + : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' + + +integer_type_suffix + : 'U' | 'u' | 'L' | 'l' | 'UL' | 'Ul' | 'uL' | 'ul' | 'LU' | 'Lu' | 'lU' | 'lu' + + +hexadecimal_integer_literal + : '0x' hex_digit+ integer_type_suffix? + | '0X' hex_digit+ integer_type_suffix? + + +hex_digit + : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' + | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' + *@ + +@*JavaScript Numbers are Always 64-bit Floating Point +Unlike many other programming languages, JavaScript does not define different types of numbers, like integers, short, long, floating-point etc. +JavaScript numbers are always stored as double precision floating point numbers, following the international IEEE 754 standard. +This format stores numbers in 64 bits, where the number (the fraction) is stored in bits 0 to 51, the exponent in bits 52 to 62, and the sign in bit 63:*@ diff --git a/docs/Expressions/Operators - Copy.cshtml b/docs/Expressions/Operators - Copy.cshtml new file mode 100644 index 0000000..92446df --- /dev/null +++ b/docs/Expressions/Operators - Copy.cshtml @@ -0,0 +1,193 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ Operators"; +} +
+

Documentation under construction.

+
+
+

Operators

+

An operator is a symbol that tells to perform specific mathematical or logical manipulations. Shell is rich in built-in operators and provide the following types of operators

+

This chapter will examine the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

+
Arithmetic Operators
+

The five arithmetical operations supported

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulo
+
+
Relational and comparison operators
+

Two expressions can be compared using relational and equality operators. For example, to know if two values are equal or if one is greater than the other.

+

The result of such an operation is either true or false (i.e., a Boolean value).

+

The relational operators are:

+ + + + + + + + + + + + + + + + + + + + + + + + +
operatordescription
==Equal to
!=Not equal to
<Less than
>Greater than
<=Less than or equal to
>=Greater than or equal to
+
+
Logical Operators (!, ||, &&)
+

The operator ! is operator for the Boolean operation NOT. It has only one operand, to its right, and inverts it, producing false if its operand is true, and true if its operand is false. Basically, it returns the opposite Boolean value of evaluating its operand. For example:

+

The logical operators && and || are used when evaluating two expressions to obtain a single relational result. The operator && corresponds to the Boolean logical operation AND, which yields true if both its operands are true, and false otherwise. The following panel shows the result of operator && evaluating the expression a && b:

+ + + + + + + + + + + + + + + + + + + +
operatordescription
&&Called Logical AND operator. If both the operands are non-zero, then condition becomes true.
||Called Logical OR Operator. If any of the two operands is non-zero, then condition becomes true.
! + Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true, then Logical NOT operator will make false. +
!(5 == 5)   // evaluates to false because the expression at its right (5 == 5) is true
+!(6 <= 4)   // evaluates to true because (6 <= 4) would be false
+!true       // evaluates to false
+!false      // evaluates to true
+
+
+
Conditional ternary operator
+

The conditional operator evaluates an expression, returning one value if that expression evaluates to true, and a different one if the expression evaluates as false. Its syntax is:

+
condition ? result1 : result2
+

If condition is true, the entire expression evaluates to result1, and otherwise to result2.

+
7==5 ? 4 : 3     // evaluates to 3, since 7 is not equal to 5.
+7==5+2 ? 4 : 3   // evaluates to 4, since 7 is equal to 5+2.
+5>3 ? a : b      // evaluates to the value of a, since 5 is greater than 3.
+a>b ? a : b      // evaluates to whichever is greater, a or b.
+ +
Bitwise Operators
+

Bitwise operators modify variables considering the bit patterns that represent the values they store.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperatorDescription
&Bitwise AND
|Bitwise inclusive OR
^Bitwise exclusive OR
~Unary complement (bit inversion)
<<Shift bits left
>>Shift bits right
+
Precedence of operators
+

A single expression may have multiple operators. For example:

+
x = 5 + 7 % 2
+

the above expression always assigns 6 to variable x, because the % operator has a higher precedence than the + operator, and is always evaluated before. Parts of the expressions can be enclosed in parenthesis to override this precedence order, or to make explicitly clear the intended effect. Notice the difference:

+
x = 5 + (7 % 2)    // x = 6 (same as without parenthesis)
+x = (5 + 7) % 2    // x = 0
+

From greatest to smallest priority, Operators are evaluated in the following order:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LevelPrecedence groupOperatorDescriptionGrouping
1Postfix (unary)++ --postfix increment / decrementLeft-to-right
()functional forms
[]subscript
.member access
2Prefix (unary)++ --prefix increment / decrementRight-to-left
~ !bitwise NOT / logical NOT
+ -unary prefix
4Arithmetic: scaling* / %multiply, divide, moduloLeft-to-right
5Arithmetic: addition+ -addition, subtractionLeft-to-right
6Bitwise shift<< >>shift left, shift rightLeft-to-right
7Relational< > <= >=comparison operatorsLeft-to-right
8Equality== !=equality / inequalityLeft-to-right
9And&bitwise ANDLeft-to-right
10Exclusive or^bitwise XORLeft-to-right
11Inclusive or|bitwise ORLeft-to-right
12Conjunction&&logical ANDLeft-to-right
13Disjunction||logical ORLeft-to-right
15Assignment-level expressions=assignmentRight-to-left
?:conditional operator
16Sequencing,comma separatorLeft-to-right
+

When an expression has two operators with the same precedence level, grouping determines which one is evaluated first: either left-to-right or right-to-left.
+ Enclosing all sub-statements in parentheses (even those unnecessary because of their precedence) improves code readability.

+
diff --git a/docs/Expressions/Operators.cshtml b/docs/Expressions/Operators.cshtml new file mode 100644 index 0000000..eae6533 --- /dev/null +++ b/docs/Expressions/Operators.cshtml @@ -0,0 +1,191 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ Operators"; +} +

Operators

+
+

An operator is a symbol that tells to perform specific mathematical or logical manipulations. Shell is rich in built-in operators and provide the following types of operators

+

This chapter will examine the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

+
Arithmetic Operators
+

The five arithmetical operations supported

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulo
+
+
Relational and comparison operators
+

Two expressions can be compared using relational and equality operators. For example, to know if two values are equal or if one is greater than the other.

+

The result of such an operation is either true or false (i.e., a Boolean value).

+

The relational operators are:

+ + + + + + + + + + + + + + + + + + + + + + + + +
operatordescription
==Equal to
!=Not equal to
<Less than
>Greater than
<=Less than or equal to
>=Greater than or equal to
+
+
Logical Operators (!, ||, &&)
+

The operator ! is operator for the Boolean operation NOT. It has only one operand, to its right, and inverts it, producing false if its operand is true, and true if its operand is false. Basically, it returns the opposite Boolean value of evaluating its operand. For example:

+

The logical operators && and || are used when evaluating two expressions to obtain a single relational result. The operator && corresponds to the Boolean logical operation AND, which yields true if both its operands are true, and false otherwise. The following panel shows the result of operator && evaluating the expression a && b:

+ + + + + + + + + + + + + + + + + + + +
operatordescription
&&Called Logical AND operator. If both the operands are non-zero, then condition becomes true.
||Called Logical OR Operator. If any of the two operands is non-zero, then condition becomes true.
! + Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true, then Logical NOT operator will make false. +
!(5 == 5)   // evaluates to false because the expression at its right (5 == 5) is true
+!(6 <= 4)   // evaluates to true because (6 <= 4) would be false
+!true       // evaluates to false
+!false      // evaluates to true
+
+
+
Conditional ternary operator
+

The conditional operator evaluates an expression, returning one value if that expression evaluates to true, and a different one if the expression evaluates as false. Its syntax is:

+
condition ? result1 : result2
+

If condition is true, the entire expression evaluates to result1, and otherwise to result2.

+
7==5 ? 4 : 3     // evaluates to 3, since 7 is not equal to 5.
+7==5+2 ? 4 : 3   // evaluates to 4, since 7 is equal to 5+2.
+5>3 ? a : b      // evaluates to the value of a, since 5 is greater than 3.
+a>b ? a : b      // evaluates to whichever is greater, a or b.
+ +
Bitwise Operators
+

Bitwise operators modify variables considering the bit patterns that represent the values they store.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperatorDescription
&Bitwise AND
|Bitwise inclusive OR
^Bitwise exclusive OR
~Unary complement (bit inversion)
<<Shift bits left
>>Shift bits right
+
Precedence of operators
+

A single expression may have multiple operators. For example:

+
x = 5 + 7 % 2
+

the above expression always assigns 6 to variable x, because the % operator has a higher precedence than the + operator, and is always evaluated before. Parts of the expressions can be enclosed in parenthesis to override this precedence order, or to make explicitly clear the intended effect. Notice the difference:

+
x = 5 + (7 % 2)    // x = 6 (same as without parenthesis)
+x = (5 + 7) % 2    // x = 0
+

From greatest to smallest priority, Operators are evaluated in the following order:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LevelPrecedence groupOperatorDescriptionGrouping
1Postfix (unary)++ --postfix increment / decrementLeft-to-right
()functional forms
[]subscript
.member access
2Prefix (unary)++ --prefix increment / decrementRight-to-left
~ !bitwise NOT / logical NOT
+ -unary prefix
4Arithmetic: scaling* / %multiply, divide, moduloLeft-to-right
5Arithmetic: addition+ -addition, subtractionLeft-to-right
6Bitwise shift<< >>shift left, shift rightLeft-to-right
7Relational< > <= >=comparison operatorsLeft-to-right
8Equality== !=equality / inequalityLeft-to-right
9And&bitwise ANDLeft-to-right
10Exclusive or^bitwise XORLeft-to-right
11Inclusive or|bitwise ORLeft-to-right
12Conjunction&&logical ANDLeft-to-right
13Disjunction||logical ORLeft-to-right
15Assignment-level expressions=assignmentRight-to-left
?:conditional operator
16Sequencing,comma separatorLeft-to-right
+

+ When an expression has two operators with the same precedence level, grouping determines which one is evaluated first: either left-to-right or right-to-left.
+ Enclosing all sub-statements in parentheses (even those unnecessary because of their precedence) improves code readability. +

\ No newline at end of file diff --git a/docs/Expressions/String.cshtml b/docs/Expressions/String.cshtml new file mode 100644 index 0000000..7ed6670 --- /dev/null +++ b/docs/Expressions/String.cshtml @@ -0,0 +1,51 @@ +@page +@{ + ViewData["page-support"] = "Expressions \\ String literal"; +} +

String literal

+
+

string is zero or more characters written inside single or double quotes.

+

You can use quotes inside a string, as long as they don't match the quotes surrounding the string:

+
var
+{
+    var1 = "It's alright"
+    var2 = "He is called 'Johnny'"
+    var3 = 'He is called "Johnny"'
+}
+
+
Single quotes
+
+

single quotes allow you to use the syntax of expressions within them.
The @@ sign must be placed before the expressions.

+
dynamic
+{
+    item(title = 'windows dir path: @@sys.dir')
+}
+
+
Double quotes
+
+

double quotes allow you to use the Escape Character inside them only.
The backslash (\) escape character turns special characters into characters.
The sequence \" inserts a double quote in a string:

+
var
+{
+    var1 = "hello\"world"
+    // result: hello"world
+}
+

The complete set of escape sequences is as follows:

+ + + + + + + + + + + + + + + + + +
\'Single quote
\"Double quote
\\Backslash
\0Null
\aAlert
\bBackspace
\fForm Feed
\nNew Line
\rCarriage Return
\tHorizontal Tab
\vVertical Tab
\uxxxxUnicode escape sequence (UTF-16) \uHHHH (range: 0000 - FFFF)
\xnnnnUnicode escape sequence for character with hex value nnnn (variable length version of \uxxxx)
\UxxxxxxxxUnicode escape sequence (UTF-32) \U00HHHHHH (range: 000000 - 10FFFF)
+ diff --git a/docs/Functions/App.cshtml b/docs/Functions/App.cshtml new file mode 100644 index 0000000..fa61fd9 --- /dev/null +++ b/docs/Functions/App.cshtml @@ -0,0 +1,20 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ APP"; +} +
APP
+
+ Documentation under construction. +
+
+app.about
+app.cfg
+app.directory(dir)
+app.dll
+app.exe
+app.is64
+app.name
+app.reload
+app.unload
+app.version(var)
+
\ No newline at end of file diff --git a/docs/Functions/Color.cshtml b/docs/Functions/Color.cshtml new file mode 100644 index 0000000..39ea86a --- /dev/null +++ b/docs/Functions/Color.cshtml @@ -0,0 +1,153 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ COLOR"; +} +
COLOR
+
+ Documentation under construction. +
+
+color.default
+color.accent
+color.aliceblue
+color.antiquewhite
+color.aqua
+color.aquamarine
+color.azure
+color.beige
+color.bisque
+color.black
+color.blanchedalmond
+color.blue
+color.blueviolet
+color.brown
+color.burlywood
+color.cadetblue
+color.chartreuse
+color.chocolate
+color.coral
+color.cornflowerblue
+color.cornsilk
+color.crimson
+color.cyan
+color.darkblue
+color.darkcyan
+color.darkgoldenrod
+color.darkgray
+color.darkgreen
+color.darkkhaki
+color.darkmagenta
+color.darkolivegreen
+color.darkorange
+color.darkorchid
+color.darkred
+color.darksalmon
+color.darkseagreen
+color.darkslateblue
+color.darkslategray
+color.darkturquoise
+color.darkviolet
+color.deeppink
+color.deepskyblue
+color.dimgray
+color.dodgerblue
+color.firebrick
+color.floralwhite
+color.forestgreen
+color.fuchsia
+color.gainsboro
+color.ghostwhite
+color.gold
+color.goldenrod
+color.gray
+color.green
+color.greenyellow
+color.honeydew
+color.hotpink
+color.indianred
+color.indigo
+color.ivory
+color.khaki
+color.lavender
+color.lavenderblush
+color.lawngreen
+color.lemonchiffon
+color.lightblue
+color.lightcoral
+color.lightcyan
+color.lightgoldenrodyellow
+color.lightgray
+color.lightgreen
+color.lightpink
+color.lightsalmon
+color.lightseagreen
+color.lightskyblue
+color.lightslategray
+color.lightsteelblue
+color.lightyellow
+color.lime
+color.limegreen
+color.linen
+color.magenta
+color.maroon
+color.mediumaquamarine
+color.mediumblue
+color.mediumorchid
+color.mediumpurple
+color.mediumseagreen
+color.mediumslateblue
+color.mediumspringgreen
+color.mediumturquoise
+color.mediumvioletred
+color.midnightblue
+color.mintcream
+color.mistyrose
+color.moccasin
+color.navajowhite
+color.navy
+color.oldlace
+color.olive
+color.olivedrab
+color.orange
+color.orangered
+color.orchid
+color.palegoldenrod
+color.palegreen
+color.paleturquoise
+color.palevioletred
+color.papayawhip
+color.peachpuff
+color.peru
+color.pink
+color.plum
+color.powderblue
+color.purple
+color.red
+color.rosybrown
+color.royalblue
+color.saddlebrown
+color.salmon
+color.sandybrown
+color.seagreen
+color.seashell
+color.sienna
+color.silver
+color.skyblue
+color.slateblue
+color.slategray
+color.snow
+color.springgreen
+color.steelblue
+color.tan
+color.teal
+color.thistle
+color.tomato
+color.transparent
+color.turquoise
+color.violet
+color.wheat
+color.white
+color.whitesmoke
+color.yellow
+color.yellowgreen
+
\ No newline at end of file diff --git a/docs/Functions/IO.cshtml b/docs/Functions/IO.cshtml new file mode 100644 index 0000000..ba8d620 --- /dev/null +++ b/docs/Functions/IO.cshtml @@ -0,0 +1,40 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ IO"; +} +
IO
+
+ Documentation under construction. +
+
+io.attribute.archive
+io.attribute.compressed
+io.attribute.device
+io.attribute.directory
+io.attribute.encrypted
+io.attribute.hidden
+io.attribute.invalid
+io.attribute.normal
+io.attribute.offline
+io.attribute.readonly
+io.attribute.sparsefile
+io.attribute.system
+io.attribute.temporary
+io.attribute.virtual
+io.attributes
+io.copy
+io.delete
+io.directory
+io.dir.make
+io.file.append
+io.file.create
+io.file.make
+io.file.read
+io.file.size
+io.file.write
+io.move
+io.rename
+
+ +@*If the help function is passed without an argument, then the interactive help utility starts up on the console. +The help function has the following syntax:*@ \ No newline at end of file diff --git a/docs/Functions/Image.cshtml b/docs/Functions/Image.cshtml new file mode 100644 index 0000000..fa61fd9 --- /dev/null +++ b/docs/Functions/Image.cshtml @@ -0,0 +1,20 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ APP"; +} +
APP
+
+ Documentation under construction. +
+
+app.about
+app.cfg
+app.directory(dir)
+app.dll
+app.exe
+app.is64
+app.name
+app.reload
+app.unload
+app.version(var)
+
\ No newline at end of file diff --git a/docs/Functions/Index.cshtml b/docs/Functions/Index.cshtml new file mode 100644 index 0000000..71ece41 --- /dev/null +++ b/docs/Functions/Index.cshtml @@ -0,0 +1,111 @@ +@page +@{ + ViewData["page-support"] = "Functions"; +} +

Functions

+
+ Documentation under construction. +
+

The functions and variables have unique titles described by fully qualified names that indicate a logical hierarchy.

+

Shell has a number of functions and variables built into it that are always available. They are listed here in alphabetical order.

+ +
+if
+for
+foreach
+equal
+greater
+less
+shl
+shr
+char
+not
+print
+quote
+tohex
+null
+var
+
+ +
Keyword
+
+break
+continue	
+null
+bool
+true
+false
+auto
+none
+inherit
+parent
+both
+top
+bottom
+hidden
+normal
+show
+visible
+minimized
+maximized
+vis.disable
+vis.hidden
+
+mode.none
+mode.single
+mode.multiple
+mode.multiunique
+mode.multisingle
+mode.multi
+
+type.desktop
+type.directory(dir)
+type.drive
+type.dvd
+type.file
+type.fixed
+type.namespace
+type.remote
+type.unknown
+type.usb
+type.vhd
+
+cmd
+cmd.hidden
+cmd.show
+cmd.visible
+cmd.normal
+cmd.maximized
+cmd.minimized
+
+draw
+draw.rect
+draw.str
+draw.glyph
+draw.symbol
+draw.circle
+
+icon
+glyph
+image
+image.icon
+image.res
+image.str
+image.glyph
+image.symbol
+image.rect
+
+
+ diff --git a/docs/Functions/Key.cshtml b/docs/Functions/Key.cshtml new file mode 100644 index 0000000..5edc73e --- /dev/null +++ b/docs/Functions/Key.cshtml @@ -0,0 +1,66 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ KEY"; +} +
KEY
+
+ Documentation under construction. +
+
+key
+key.alt
+key.apps
+key.back
+key.cancel
+key.capital
+key.capslock
+key.control
+key.delete
+key.down
+key.end
+key.enter
+key.escape
+key.execute
+key.f1
+key.f10
+key.f11
+key.f12
+key.f2
+key.f3
+key.f4
+key.f5
+key.f6
+key.f7
+key.f8
+key.f9
+key.help
+key.home
+key.insert
+key.lalt
+key.lcontrol
+key.left
+key.lshift
+key.lwin
+key.next
+key.none
+key.pagedown
+key.pageup
+key.pause
+key.play
+key.print
+key.printscreen
+key.prior
+key.ralt
+key.rcontrol
+key.return
+key.right
+key.rshift
+key.rwin
+key.shift
+key.snapshot
+key.space
+key.tab
+key.up
+key.win
+
+ diff --git a/docs/Functions/Msg.cshtml b/docs/Functions/Msg.cshtml new file mode 100644 index 0000000..3956d2c --- /dev/null +++ b/docs/Functions/Msg.cshtml @@ -0,0 +1,119 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ MSG"; +} +

MSG

+
+ Documentation under construction. +
+

Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.

+ +
Syntax
+
+msg(text)
+msg(text, title)
+msg(text, title, flags)
+
+
+
Parameters
+ + + + + + + + + + + + + +
textThe message to be displayed.
titleThe dialog box title. If this parameter is NULL, the default title is Nilesoft Shell.
flagsThe contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.
+ +
Flags
+
+
To display an icon in the message box, specify one of the following values.
+
+
msg.error
+
A stop-sign icon appears in the message box.
+ +
msg.question
+
A question-mark icon appears in the message box.
+ +
msg.warning
+
An exclamation-point icon appears in the message box.
+ +
msg.info
+
An icon consisting of a lowercase letter i in a circle appears in the message box.
+
+
To indicate the buttons displayed in the message box, specify one of the following values.
+
+
msg.ok
+
The message box contains one push button: OK. This is the default.
+ +
msg.okcancel
+
The message box contains two push buttons: OK and Cancel.
+ +
msg.yesnocancel
+
The message box contains three push buttons: Yes, No, and Cancel.
+ +
msg.yesno
+
The message box contains two push buttons: Yes and No.
+
+
+
To indicate the default button, specify one of the following values.
+
+
msg.defbutton1
+
The first button is the default button.
+ +
msg.defbutton2
+
The second button is the default button.
+ +
msg.defbutton3
+
The third button is the default button.
+
+
+
To indicate the modality of the dialog box, specify one of the following values.
+
+
msg.applmodal
+
The user must respond to the message box before continuing work in the current window. However, the user can move to the windows of other threads and work in those windows.
+
msg.taskmodal
+
Same as msg.applmodal except that all the top-level windows belonging to the current thread are disabled. +
+
+
To specify other options, use one or more of the following values.
+
+
msg.right
+
The text is right-justified.
+
msg.rtlreading
+
Displays message and caption text using right-to-left reading order on Hebrew and Arabic systems.
+
msg.setforeground
+
The message box becomes the foreground window.
+
msg.topmost
+
+
+
+
Return value
+

If a message box has a Cancel button, the function returns the msg.idcancel value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC will no effect - unless an msg.ok button is present. If an msg.ok button is displayed and the user presses ESC, the return value will be msg.idok.

+

If the function fails, the return value is zero.
+If the function succeeds, the return value is one of the following values: +

+
msg.idok or 1
+
The OK button was selected.
+ +
msg.idcancel or 2
+
The Cancel button was selected.
+ +
msg.idyes or 6
+
The Yes button was selected.
+ +
msg.idno or 7
+
The No button was selected.
+
+

+
Examples
+
msg("Hello, Warld!","NileSoft Shell", msg.info | msg.ok)
+msg("Hello, Warld!","NileSoft Shell")
+msg("Hello, Warld!")
\ No newline at end of file diff --git a/docs/Functions/Path.cshtml b/docs/Functions/Path.cshtml new file mode 100644 index 0000000..b959461 --- /dev/null +++ b/docs/Functions/Path.cshtml @@ -0,0 +1,50 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ PATH"; +} +
PATH
+
+ Documentation under construction. +
+
+path.absolute
+path.combine
+path.currentdirectory(curdir)
+path.directory(dir)
+path.directory.box
+path.directory.make
+path.directory.name
+path.directory.title
+path.empty
+path.exists
+path.file
+path.file.box
+path.file.ext
+path.file.name
+path.file.title
+path.full
+path.getknownfolder
+path.isabsolute
+path.isclsid
+path.isdirectory
+path.isdrive
+path.isexe
+path.isfile
+path.isnamespace
+path.isrelative
+path.isroot
+path.join
+path.lnk
+path.lnktarget
+path.name
+path.parent
+path.parent.name
+path.relative
+path.removeextension
+path.root
+path.short
+path.title
+path.type
+
+ + diff --git a/docs/Functions/Reg.cshtml b/docs/Functions/Reg.cshtml new file mode 100644 index 0000000..d8c21e3 --- /dev/null +++ b/docs/Functions/Reg.cshtml @@ -0,0 +1,23 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ REG"; +} +
REG
+
+ Documentation under construction. +
+
+reg(...)
+reg.cr
+reg.cu
+reg.lm
+reg.u
+reg.cc
+reg.none
+reg.sz
+reg.expand
+reg.binary
+reg.multi
+reg.dword
+reg.qword
+
\ No newline at end of file diff --git a/docs/Functions/Sel.cshtml b/docs/Functions/Sel.cshtml new file mode 100644 index 0000000..f5ecb8f --- /dev/null +++ b/docs/Functions/Sel.cshtml @@ -0,0 +1,288 @@ +@page +@{ + ViewData["title"] = "SEL - Functions"; + ViewData["page-support"] = "Functions \\ SEL"; +} +
SEL
+

Has many functions to handle selected file system objects.

+@* has the following syntax:*@ +
+ Documentation under construction. +
+
+

+

sel(quote=false, separator=' ')
+

Returns all selected items with double quotation mark and custom separator.

+
sel
sel(true)
sel(true, "\n")
+

+
+

+

sel.path
+ Returns the path of the selected item.. +

+
+

+

sel.path.title
+ Returns the name without the extension of the selected item. +

+
+

+

sel.path.length
+ Returns the number of characters in the path of the selected item. +

+
+

+

sel.path.title
+ Returns the path title of the selected item.. +

+
+

+

sel.path.quote
+ Returns the path of the selected item. with double quotation mark. +

+
+

+

sel.short
+ Returns the short path of the selected item. +

+
+

+

sel.short.length
+ Returns the number of characters in the short path of the selected item. +

+
+

+

sel.raw
+ Returns the path of the selected item in raw format. +

+
+

+

sel.raw.length
+ Returns the number of characters in the raw path of the selected item. +

+
+

+

sel.root
+ Returns the root directory from the path of the selected items. +

+
+

+

sel.name
+ Returns the name and extension of the selected item. +

+
+

+

sel.name.length
+ Returns the number of characters in the name of the selected item. +

+
+

+

sel.title
+ Returns the name without extension of the selected item. +

+
+

+

sel.title.length
+ Returns the number of characters in the name without extension of the selected item. +

+
+

+

sel.parent
+ Returns the directory path for the selected item. +

+
+

+

sel.parent.quote
+ Returns the directory path for the selected item with quotation mark. +

+
+

+

sel.parent.raw
+ Returns the directory path for the selected item in raw format. +

+
+

+

sel.parent.name
+ Returns the name of the parent of the selected item. +

+
+

+

sel.parent.length
+ Returns the number of characters in the parent path of the selected item. +

+
+

+

sel.count
+ Returns count selected items. +

+
+

+

sel.back
+ Returns whether the selection is in the background. +

+
+

+

sel.curdir or sel.workdir
+ Returns the path of current working directory. +

+
+

+

sel.file
+ Returns the path for the selected item. If it is a file +

+
+

+

sel.file.name
+ Returns the number of characters in the name of the selected item. If it is a file. +

+
+

+

sel.file.name.length
+ Returns the name for the selected item. If it is a file. +

+
+

+

sel.file.ext
+ Returns the extension for the selected item. If it is a file. +

+
+

+

sel.file.title
+ Returns the name without an extension for the selected item. If it is a file. +

+
+

+

sel.file.quote
+ Returns the path for the selected item with quotation mark. If it is a file. +

+
+

+

sel.directory
+ Returns the path for the selected item. If it is a directory. +

+
+

+

sel.directory.name
+ Returns the name for the selected item. If it is a directory. +

+
+

+

sel.directory.length
+ Returns the number of characters in the path of the selected item. If it is a directory. +

+
+

+

sel.directory.quote
+ Returns the path for the selected item with quotation mark. If it is a directory. +

+
+

+

sel.get(index=0)
+ Returns the path of the selected item by referring to the index number. +

+
+

+

sel.raw(index=0)
+ Returns the raw path of the selected item by referring to the index number. +

+
+

+

sel.length(index=0)
+ Returns the number of characters in the path of the selected item by referring to the index number. +

+
+

+

sel.readonly(index=0)
+ Returns whether the selected item by referring to the index number is read-only. +

+
+

+

sel.hidden(index=0)
+ Returns whether the selected item by referring to the index number is hidden. +

+
+

+

sel.type
+ Returns the type for the selected item with the following values:

+
type.directory
+type.file
+type.namespace
+type.drive
+type.fixed
+type.usb
+type.dvd
+type.vhd
+type.removable
+type.taskbar
+type.desktop
+type.computer
+type.recyclebin
+type.remote
+type.back
+type.back.namespace
+type.back.directory
+type.back.drive
+

+
+

+

sel.mode
+ Returns the selection mode with the following values:

+
mode.none
+mode.single
+mode.multiple
+mode.multisingle
+mode.multiunique
+

+@* +
+

+

sel.tofile(quote=true, sep="\n", path='@@sys.temp\shell.txt')
+ Returns the path of the file containing the selections with optional parameters quotation mark, separator, and file path..
default path value %temp%\shell-selections.txt

+
sel.tofile(true)
+sel.tofile(true, "\r\n")
+sel.tofile(false, "\n", 'C:\sell\selections.txt')
+

+

+
+ +
+sel.paths
+sel.paths.count
+sel.paths.title
+sel.paths.quote
+
+sel.directories(dirs)
+sel.directories.count
+sel.directories.title
+sel.directories.quote
+
+sel.files
+sel.files.count
+sel.files.ext
+sel.files.title
+sel.files.name
+sel.files.quote
+
+sel.types
+sel.types.count
+
+sel.shorts
+sel.shorts.count
+
+sel.titles
+sel.titles.count
+
+sel.names
+sel.names.count
+
+sel.exts
+sel.exts.count
+
+sel.drivers
+sel.drivers.count
+
+sel.namespaces
+sel.namespaces.count
+
+*@ +@*If the sys function is passed without an argument, then the interactive help utility starts up on the console.*@ diff --git a/docs/Functions/Str.cshtml b/docs/Functions/Str.cshtml new file mode 100644 index 0000000..c9cc1e7 --- /dev/null +++ b/docs/Functions/Str.cshtml @@ -0,0 +1,35 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ STR"; +} +
STR
+
+ Documentation under construction. +
+
+str.at
+str.char
+str.contains
+str.empty
+str.end
+str.equals
+str.find
+str.findlast
+str.format
+str.left
+str.length
+str.lower
+str.not
+str.null
+str.padleft
+str.padright
+str.remove
+str.replace
+str.right
+str.start
+str.sub
+str.trim
+str.trimend
+str.trimstart
+str.upper
+
\ No newline at end of file diff --git a/docs/Functions/Sys.cshtml b/docs/Functions/Sys.cshtml new file mode 100644 index 0000000..80e25e6 --- /dev/null +++ b/docs/Functions/Sys.cshtml @@ -0,0 +1,60 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ SYS"; +} +
SYS (SYSTEM)
+
+ Documentation under construction. +
+
+sys.appdata
+sys.beep
+sys.bin
+sys.bin32
+sys.bin64
+sys.copy
+sys.dark
+sys.datetime
+sys.datetime.date
+sys.datetime.date_day
+sys.datetime.date_dayofweek
+sys.datetime.date_month
+sys.datetime.date_y
+sys.datetime.date_year
+sys.datetime.date_yy
+sys.datetime.short
+sys.datetime.time
+sys.datetime.time_hour
+sys.datetime.time_milliseconds
+sys.datetime.time_min
+sys.datetime.time_minute
+sys.datetime.time_ms
+sys.datetime.time_pm
+sys.datetime.time_second
+sys.directory(dir)
+sys.extended
+sys.is64
+sys.name
+sys.path
+sys.prog
+sys.prog32
+sys.programdata
+sys.random
+sys.refresh
+sys.root
+sys.temp
+sys.templates
+sys.toggleext
+sys.togglehidden
+sys.type
+sys.users
+sys.var
+sys.version(ver)
+sys.version.build
+sys.version.major
+sys.version.minor
+sys.version.name
+sys.version.type
+sys.wow
+
+ diff --git a/docs/Functions/User.cshtml b/docs/Functions/User.cshtml new file mode 100644 index 0000000..4180820 --- /dev/null +++ b/docs/Functions/User.cshtml @@ -0,0 +1,32 @@ +@page +@{ + ViewData["page-support"] = "Functions \\ USER"; +} +
USER
+
+ Documentation under construction. +
+
+user.home
+user.appdata
+user.contacts
+user.desktop
+user.directory(dir)
+user.documents
+user.documentslibrary
+user.downloads
+user.favorites
+user.libraries
+user.localappdata
+user.music
+user.name
+user.personal
+user.pictures
+user.profile
+user.quicklaunch
+user.sendto
+user.startmenu
+user.temp
+user.templates
+user.videos
+
\ No newline at end of file diff --git a/docs/GetStarted.cshtml b/docs/GetStarted.cshtml new file mode 100644 index 0000000..4341673 --- /dev/null +++ b/docs/GetStarted.cshtml @@ -0,0 +1,34 @@ +@page +@{ + ViewData["page-support"] = "Getting started"; + ViewData["meta-og:image"] = "/images/support/helloworld.png"; +} +

Get Started

+
+

+ This tutorial will teach you the basics of Shell.
+ It is not necessary to have any prior experience. +

+

+ To start using Shell, you need:
+ A text editor, like Notepad, to write Shell code. +

+
Quickstart
+

Let's create our first menu item.

+

Open configuration file (shell.shl) and Write the following code and save.

+
shell
+{
+    dynamic
+    {
+        item(title='Hello, World!')
+    }
+}
+

Don't worry if you don't understand the code above - we will discuss it in detail in later chapters.

+

The result will look something for this when you press the right-click in an empty place on the desktop:

+
+ + + +
+ +

Congratulations You have now added the first time a menu item to the context menu

\ No newline at end of file diff --git a/docs/Index.cshtml b/docs/Index.cshtml new file mode 100644 index 0000000..ac24734 --- /dev/null +++ b/docs/Index.cshtml @@ -0,0 +1,46 @@ +@page +@{ + ViewData["page-support"] = "Introduction"; + ViewData["meta-og:image"] = "/images/screenshots/goto.png"; +} +@*The home for Shell documentation and learning for users.*@ +@**@ +

Introduction

+
+
What is Shell?
+

+ Shell is a extensions of Windows File Explorer that can be used to create high-performance context menu items. + and gives user a high level of control over context menu of Windows File Explorer. +

+

The Right Click Menu or the Context Menu is the menu, which appears when you right-click on the desktop, file, folder or taskbar in Windows. This menu gives you added functionality by offering you actions you can take with the item

+

Shell is all you need to customize or add new items with several functions to Windows File Explorer Context menu and Much More.(cascade menus, advanced menus, multi-level menus, command menus, separator).

+ +
+ + + +
+ +
Why Use Shell
+ diff --git a/docs/Installation.cshtml b/docs/Installation.cshtml new file mode 100644 index 0000000..7f54b4e --- /dev/null +++ b/docs/Installation.cshtml @@ -0,0 +1,56 @@ +@page +@{ + ViewData["page-support"] = "Installation"; +} +

Installation

+
+

Download the release package and unzip its content in any location you want.

+@*

Open a command prompt with administrative permissions.

*@ +

Open an elevated command prompt.

+ +
Command-Line Help

+shell -[options] +

+
Options
+ + + + + + + + + + + + + + + + + + + + + + + + + +
-register (-r)Registering.
-unregister (-u)Unregistering.
-init (-i)Initialize images cache.
-restart (-re)Restart Windows Explorer.
-silent (-s)Prevents displaying messages.@*Silent, do not display any dialogue boxes*@
-?Dispay this help message.
+ +
+
Intsall
+ shell -register -init +
+
+
+
Unintsall
+ shell -unregister -restart +
+

Tip: Close all instances of Windows File Explorer before uninstalling to avoid needing a reboot after it has been uninstalled.

+@*

+

How To Uninstall Shell installer

+

Shell installer can be fully removed from your system by using the standard Windows uninstall mechanism.

+

The way this is done depends on your version of Windows.

+*@ diff --git a/docs/Syntax/Dynamic.cshtml b/docs/Syntax/Dynamic.cshtml new file mode 100644 index 0000000..62dd595 --- /dev/null +++ b/docs/Syntax/Dynamic.cshtml @@ -0,0 +1,393 @@ +@page +@{ + ViewData["title"] = "Dynamic Items"; + ViewData["page-support"] = "Dynamic"; +} +

Dynamic Items

+
+

This section adds new menu items to the context menu.

+

Dynamic items have three types (menu, item, and separator). with properties to add new items with customization explained below in more details.
The types (menu and item) must contain the property title at least and their value cannot be null.
A separator-type item can be added without any properties.

+

In the following example, it shows how to write add an items to dynamic:

+
shell 
+{
+    dynamic
+    {
+        item(title = 'Hello, World!')
+        separtor
+        menu(title = 'sub menu' image = #0000ff)
+        {
+            item(title = 'test subitem')
+        }
+    }
+}
+
+
+

Properties

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertySummary
TitleSets a value indicating the caption of the menuitem.
+

This property must be included with menu and item, not Applies to separator.

+ Default = null +

Applies to menu, item.

+
ModeAccept item by selections behavior. Value have one of the following parameters: + + + + + + + + + + + + + + + + + + + + + +
NoneAccept item when there are no selections.
SingleAccept menuitem when there are single selection.
MultiUniqueAccept when multiple selections are single type.
MultiSingleAccept when multiple selections are single file extension.
MultipleAccept all types.
+ Default = Single +

Applies to menu, item, separator.

+
TypeSpecify the types of object files allowed for the menu item to appear. The property is assigned to one or more of these parameters and this character | is used to separate types.
+ Add a character ~ before single type to exclude. +

The property not supported syntax expressions.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileAccept menuitem when file are selected.
Dirctory(Dir)Accept menuitem when Dirctory are selected.
DriveDrive objects
USBAccept menuitem when USB flash drive are selected.
DVDThe drive is a DVD-ROM drive
FixedAccept menuitem when Fixed drive are selected. The drive has fixed media; for example, a hard disk drive or flash drive.
VHDAccept menuitem when Virtual Hard Disk are selected.
RemovableThe drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.
RemoteThe drive is a remote (network) drive.
BackAccept menu item when the background of all types are selected or can specify of this types for the background (back.directory, back.drive[back.fixed, back.usb, back.dvd, back.vhd, back.Removable], back.namespace[back.computer, back.recyclebin]) +
DesktopAccept menuitem when the Desktop are selected.
NamespaceAccept menuitem when Namespace are selected. Can be virtual objects such as the My Network Places and Recycle Bin.
ComputerAccept menuitem when the My Computer are selected.
RecyclebinAccept menuitem when the Recycle bin are selected.
TaskbarAccept menuitem when the Taskbar are selected.
+ Default = All types +

Applies to menu, item, separator.

+
Visibility (vis)Visibility of menuitem and can have one of the following parameters: + + + + + + + + + + + + + + + + + + + + + + + + + +
HiddenThem menuitem will not be displayed.
Enable, NormalEnabled the menuitem.
DisableDisabled the menuitem.
ExtendedThe menuitem appears when the Shift key is pressed.
ExtendedHiddenThe item appears disabled when the Shift key is pressed.
ExtendedDisableHide the menuitem when the Shift key is pressed.
+ Default = Normal +

Applies to menu, item, separator.

+
Find +

Accept menuitem when the specified path name or path extension is contains or equal to the current find property.
Use this delimiter | to separate patterns.

+ Default = null +

Applies to menu, item, separator.

+
Separator (sep)Add separator with menuitem position by parameters: + + + + + + + + + + + + + + + + + +
NoneNot adding a separator with the menuitem.
BeforeAdd a separator before the menuitem.
AfterAdd a separator after the menuitem.
BothAdd a separator before and after the menuitem.
+ Default = none +

Applies to menu, item.

+
Position (pos)The position at which a menuitem should be inserted into the menu.
Position can have one of the following parameters: + + + + + + + + + + + + + + + + + + + + + +
AutoInsert the menuitem to the current position.
MiddleInsert the menuitem to the middle of the menu.
TopInsert the menuitem to the top of the menu.
BottomInsert the menuitem to the bottom of the menu.
Number setsInsert the menuitem to a specified position with integer numbers.
+ Default = auto +

Applies to menu, item, separator.

+
Image, IconThe icon that appears in a menuitem, This property can be assigned as image files, resource icons, glyph or color. With one of the following parameters + + + + + + + + + + + + + + + + + + + + + + + + + +
nullShow menuitem without icon.
Inherit@*Inheriting the image from the parent.*@ + Inherits this property from its parent element.
CmdAssign image from the command property.
GlyphAssign image as Glyph.
ColorAssign image as color.
PathAssign image from location path or resource icon.
+ Default = null +

Applies to menu, item.

+
Command (cmd)

The command associated with the menuitem. Occurs when the menuitem is clicked or selected using a shortcut key or access key defined for the menuitem.

+ Default = null +

Applies to item.

+
Arguments (arg, args)

The parameter to pass to the Command property of a menuitem.

+ Default = null +

Applies to item.

+
WindowControls how the window is to be shown. can be one of the following parameters: +

Hidden, Show, Visible, Minimized, Maximized

+ Default = show +

Applies to item.

+
Directory (dir)

Specify the work directory to execute the command.

+ Default = null +

Applies to item.

admin

Execute the command with administrative permissions.

+ Default = false +

Applies to item.

+
VerbSpecifies that the operation is the default for the selected file. value type string and can have one of the following parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
nullSpecifies that the operation is the default for the selected file type.
OpenOpens a file or a application.
OpenAsOpener dialog when no program is associated to the extension.
RunAsIn Windows 7 and Vista, opens the UAC dialog andin others, open the Run as... Dialog.
EditOpens the default text editor for the file.
ExploreOpens the Windows Explorer in the folder specified in Directory.
PropertiesOpens the properties window of the file.
PrintStart printing the file with the default application.
FindStart a search.
+ Default = open +

Applies to item.

+
Wait +

Waiting Until end of command.

+ Default = false +

Applies to item.

+
Checked +

Value that indicates whether the menuitem is checked.

+ + + + + + + + + + + + + +
0No checked mark.
1Displays menu item using a check mark.
2Displays menu item using a radio-button mark instead of a check mark.
+ Default = 0 +

Applies to item.

+
Default +

Specifies that the menuitem is the default. A menu can contain only one default menuitem, which is displayed in bold.

+ Default = false +

Applies to item.

+
+
+

The title property must include at least the following types of (menu or item).

diff --git a/docs/Syntax/Index.cshtml b/docs/Syntax/Index.cshtml new file mode 100644 index 0000000..7538557 --- /dev/null +++ b/docs/Syntax/Index.cshtml @@ -0,0 +1,127 @@ +@page +@{ + ViewData["title"] = "Syntax"; + ViewData["page-support"] = "Syntax"; + ViewData["meta-og:image"] = "/images/support/config.png"; +} +

Syntax Rules for Configuration Files

+
+

This chapter describes the syntax rules for configuration file.

+ +

Tip: When there is an error, it is recorded in the log file (shell.log).

+ +@*

You can place any number of varabiles in an menu. +varabiles can be placed in the var, or in the dynamic body section of an menu, or in both.

*@ + +

The following rules apply to the syntax of configuration file (shell.shl):

+
shell.shl structure
+
shell 
+{
+    // global variables
+    var
+    {
+        // variables content
+        variable-name = variable-value
+        ...
+    }
+	
+    // static items
+    static
+    {
+        // static items content
+        item ( property-name = property-value   ... )
+        ...
+    }
+
+    // dynamic items
+    dynamic
+    {
+        // dynamic items content
+        item ( property-name = property-value   ... )
+        
+        separator [( property-name = property-value   ... )]
+        
+        menu ( property-name = property-value   ... )
+        {
+           var // local variables
+           {
+                variable-name = variable-value
+                ...
+            }
+            
+            item ( property-name = property-value   ... )
+            ...
+        }
+        ...
+    }
+}
+ +
+

Breaking Long Lines
For best readability, users often like to avoid lines longer than 80 characters. single quotes also allow break up a line.

+
shell 
+{
+    dynamic
+    {
+	  item(title='Command prompt'
+	        cmd='cmd.exe')
+    }
+}
+@*
+
Example
+
shell 
+{
+     var
+    {
+        hello_world = 'Hello World!'
+    }
+	
+    static
+    {
+        // remove items
+        item(find='restore' vis=hidden)
+        item(find='give access to' vis=hidden)
+
+        // show only on extended with shift key
+        item(find='send to' vis=extended)
+        item(find='new' vis=extended)
+
+        // remove or extend multiple items by one line
+        item(find='delete|format|rename|paste' vis=extended)
+        
+        // change title
+        item(find='defender' title='Scan with Defender')
+		
+        // change image
+        item(find='copy' image=#dd0000)
+        
+        // change image, title
+        item(find='open with' image=#dd0000 title='Open...')
+    }
+	
+    dynamic
+    {
+	  item(title=@@hello_world cmd=@@msg(hello_world))
+	  separator
+	  item(title='Command prompt' cmd='cmd.exe' args='/k echo @@hello_world')
+	  separator
+	  menu(title='Sub menu')
+	  {
+	      item(title='Open Paint' cmd='paint.exe' arg=@@sel.path)
+	      separator
+	      item(title='Open Notepad' cmd='notepad.exe' arg='"@@sel.path"')
+	  }
+    }
+}
+*@ diff --git a/docs/Syntax/Static.cshtml b/docs/Syntax/Static.cshtml new file mode 100644 index 0000000..44709fb --- /dev/null +++ b/docs/Syntax/Static.cshtml @@ -0,0 +1,198 @@ +@page +@{ + ViewData["title"] = "Static Items"; + ViewData["page-support"] = "Variables"; +} +

Static Items

+
+

This section modifies context menu items added by the system or by a third party. more than one item can be added with some properties to customize the context menu. explained below in more details.
The items must have the property find. to search in the titles of the menu items to catches them and customize by other properties such as changing the title, icon, visibility, or moving it to another location.

+

In the following example, it shows how to write add an items to static:

+
shell 
+{
+    static
+    {
+        item(find = 'copy' image = #00ff00)
+        item(find = 'paste' image = #0000ff)
+    }
+}
+
+
+

Properties

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertySummary
FindAccept menuitem when the specific menuitem title is contains or equal to the current find property.
Use this delimiter | to separate patterns. +

This property must be included with another property at least.

+ Default = null +
Title +

Change value indicating the caption of the menuitem.

+ Default = null +
ModeAccept item by selections behavior. Value have one of the following parameters: + + + + + + + + + + + + + + + + + + + + + +
NoneAccept item when there are no selections.
SingleAccept menuitem when there are single selection.
MultiUniqueAccept when multiple selections are single type.
MultiSingleAccept when multiple selections are single file extension.
MultipleAccept all types.
+ Default = single +
Visibility (vis)Visibility of menuitem and can have one of the following parameters:. + + + + + + + + + + + + + + + + + + + + + + + + + +
HiddenHide the menuitem.
Enable, NormalEnabled the menuitem.
DisableDisabled the menuitem.
ExtendedThe menuitem appears when the Shift key is pressed.
ExtendedHiddenHide the menuitem when the Shift key is pressed.
ExtendedDisableThe item appears disabled when the Shift key is pressed.
+ Default = normal +
Position (pos)The position at which a menuitem should be inserted into the menu.
Position can have one of the following parameters: + + + + + + + + + + + + + + + + + + + + + +
AutoInsert the menuitem to the current position.
MiddleInsert the menuitem to the middle of the menu.
TopInsert the menuitem to the top of the menu.
BottomInsert the menuitem to the bottom of the menu.
Number setsInsert the menuitem to a specified position with integer numbers.
+ Default = auto +
Separator (sep)Add separator with menuitem position by parameters: + + + + + + + + + + + + + + + + + +
NoneNot adding a separator with the menuitem.
BeforeAdd a separator before the menuitem.
AfterAdd a separator after the menuitem.
BothAdd a separator before and after the menuitem.
+ Default = none +
Image, IconThe icon that appears in a menuitem, This property can be assigned as image files, resource icons, glyph or color. With one of the following parameters + + + + + + + + + + + + + + + + + + + + + +
NullShow menuitem without icon.
InheritInheriting the image from the parent.
GlyphAssign image as Glyph.
ColorAssign image as color.
PathAssign image from location path or resource icon.
+ Default = null +
Parent

Move current menu item(s) to another menu.

+ Default = null
Default +

Specifies that the menuitem is the default. A menu can contain only one default menuitem, which is displayed in bold.

+ Default = false +
+
diff --git a/docs/Syntax/Variables.cshtml b/docs/Syntax/Variables.cshtml new file mode 100644 index 0000000..127cc55 --- /dev/null +++ b/docs/Syntax/Variables.cshtml @@ -0,0 +1,51 @@ +@page +@{ + ViewData["title"] = "Variables"; + ViewData["page-support"] = "Variables"; +} +

Variables

+
+

Variables are containers for storing data values.

+ +

The general rules for constructing names for variables (unique identifiers) are:

+ +

+ All variables must be identified with unique names.
+ These unique names are called identifiers. + Identifiers can be short names (like x and y) or more descriptive names (age, sum, totalVolume). +

+

Note: It is recommended to use descriptive names in order to create understandable and maintainable code

+
Example
+
shell 
+{
+    var
+    {
+        hello_world = 'Hello World!'
+        test_add1 = 5 + 6
+    }
+	
+    dynamic
+    {
+	  item(title = @@hello_world cmd = @@msg(hello_world))
+
+	  menu(title = @@test_add1)
+	  {
+	      var
+	      {
+	          test_sub1 = 11 - 5
+	      }
+	      
+	      item(title = @@test_sub1)
+	  }
+    }
+}
+ diff --git a/docs/_DocsLayout.cshtml b/docs/_DocsLayout.cshtml new file mode 100644 index 0000000..f38cd49 --- /dev/null +++ b/docs/_DocsLayout.cshtml @@ -0,0 +1,165 @@ +@using Nilesoft.Models +@{ + Layout = "_Layout"; + //ViewData["Title"] = "Documentation"; + + var doc_page = ViewData["doc_page"]; + + var path = this.Context.Request.Path.Value; + + string doc_path = "/docs"; + + + TreeListItem[] list = new TreeListItem[] + { + new TreeListItem { Title = "Introduction", Link = "" }, + new TreeListItem { Title = "Installation", Link = "installation" }, + new TreeListItem { Title = "Get Started", Link = "getstarted" }, + new TreeListItem + { + Title = "Syntax", Link = "syntax", + Items = new TreeListItem[] + { + new TreeListItem { Title = "Variables", Link= "variables" }, + new TreeListItem { Title = "Static", Link = "static" }, + new TreeListItem { Title = "Dynamic", Link = "dynamic" } + } + }, + new TreeListItem + { + Title = "Expressions", Link = "expressions", + Items = new TreeListItem[] + { + new TreeListItem { Title = "Comments", Link= "comments" }, + new TreeListItem { Title = "String literal", Link = "string" }, + new TreeListItem { Title = "Numeric literal", Link = "numeric" }, + new TreeListItem { Title = "Color literal", Link = "color" }, + new TreeListItem { Title = "Operators", Link = "operators" }, + new TreeListItem { Title = "Identfier", Link = "identfier" } + } + }, + new TreeListItem + { + Title = "Functions", Link = "functions", + Items = new TreeListItem[] + { + new TreeListItem { Title = "app", Link= "app" }, + new TreeListItem { Title = "color", Link = "color" }, + new TreeListItem { Title = "io", Link = "io" }, + new TreeListItem { Title = "key", Link = "key" }, + new TreeListItem { Title = "msg", Link = "msg" }, + new TreeListItem { Title = "path", Link = "path" }, + new TreeListItem { Title = "reg", Link = "reg" }, + new TreeListItem { Title = "sel", Link = "sel" }, + new TreeListItem { Title = "str", Link = "str" }, + new TreeListItem { Title = "sys", Link = "sys" }, + new TreeListItem { Title = "user", Link = "user" } + } + }, + new TreeListItem + { + Title = "Examples", Link = "examples", + Items = new TreeListItem[] + { + new TreeListItem { Title = "Copy path", Link = "copypath" }, + new TreeListItem { Title = "Favorites", Link = "favorites" }, + new TreeListItem { Title = "Goto", Link = "goto" } + } + } + }; +} +

Documentation

+
+ +
+
+ @**@ + @RenderBody() +
+ + + +
+
+
+
diff --git a/docs/_ViewStart.cshtml b/docs/_ViewStart.cshtml new file mode 100644 index 0000000..cfd440b --- /dev/null +++ b/docs/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_DocsLayout"; +}