@@ -6,28 +6,28 @@ |
||
| 6 | 6 | |
| 7 | 7 | class Process extends Component |
| 8 | 8 | { |
| 9 | - protected ?string $classname = 'System.Diagnostics.Process'; |
|
| 10 | - protected ?string $assembly = 'System'; |
|
| 9 | + protected ?string $classname = 'System.Diagnostics.Process'; |
|
| 10 | + protected ?string $assembly = 'System'; |
|
| 11 | 11 | |
| 12 | - public function __construct (int $pid = null) |
|
| 13 | - { |
|
| 12 | + public function __construct (int $pid = null) |
|
| 13 | + { |
|
| 14 | 14 | $this->selector = VoidCore::getClass ($this->classname, $this->assembly); |
| 15 | 15 | |
| 16 | - if ($pid !== null) |
|
| 16 | + if ($pid !== null) |
|
| 17 | 17 | $this->selector = $pid == getmypid () ? |
| 18 | 18 | VoidCore::callMethod ($this->selector, 'GetCurrentProcess') : |
| 19 | 19 | VoidCore::callMethod ($this->selector, 'GetProcessById', $pid); |
| 20 | 20 | |
| 21 | - Components::add ($this); |
|
| 22 | - } |
|
| 21 | + Components::add ($this); |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public static function getProcessById (int $pid) |
|
| 25 | - { |
|
| 26 | - return new self ($pid); |
|
| 27 | - } |
|
| 24 | + public static function getProcessById (int $pid) |
|
| 25 | + { |
|
| 26 | + return new self ($pid); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - public static function getCurrentProcess () |
|
| 30 | - { |
|
| 31 | - return new self (getmypid ()); |
|
| 32 | - } |
|
| 29 | + public static function getCurrentProcess () |
|
| 30 | + { |
|
| 31 | + return new self (getmypid ()); |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | |
| 98 | 98 | try |
| 99 | 99 | { |
| 100 | - if (strpos ($propertyName, '->') !== false && self::$allow_multimethods_calls) |
|
| 100 | + if (strpos ($propertyName, '->') !== false && self::$allow_multimethods_calls) |
|
| 101 | 101 | eval ('namespace VoidEngine; '. $preset .' _c('. self::$objects[$name]->selector .')->'. $propertyName .' = '. $propertyValue .';'); |
| 102 | 102 | |
| 103 | 103 | else self::$objects[$name]->$propertyName = eval ("namespace VoidEngine; $preset return $propertyValue;"); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $size = $this->count; |
| 56 | 56 | $list = []; |
| 57 | 57 | |
| 58 | - for ($i = 0; $i < $size; ++$i) |
|
| 58 | + for ($i = 0; $i < $size; ++$i) |
|
| 59 | 59 | $list[] = EngineAdditions::coupleSelector (VoidCore::getArrayValue ($this->selector, $i)); |
| 60 | 60 | |
| 61 | 61 | return $list; |
@@ -79,17 +79,17 @@ discard block |
||
| 79 | 79 | return $names; |
| 80 | 80 | break; |
| 81 | 81 | |
| 82 | - case 'name': |
|
| 83 | - try |
|
| 84 | - { |
|
| 85 | - return $this->getProperty ('Name'); |
|
| 86 | - } |
|
| 82 | + case 'name': |
|
| 83 | + try |
|
| 84 | + { |
|
| 85 | + return $this->getProperty ('Name'); |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - catch (\WinformsException $e) |
|
| 89 | - { |
|
| 90 | - return $this->name; |
|
| 91 | - } |
|
| 92 | - break; |
|
| 88 | + catch (\WinformsException $e) |
|
| 89 | + { |
|
| 90 | + return $this->name; |
|
| 91 | + } |
|
| 92 | + break; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | if (method_exists ($this, $method = 'get_'. $name)) |
@@ -107,18 +107,18 @@ discard block |
||
| 107 | 107 | elseif (method_exists ($this, $method = 'set_'. $name)) |
| 108 | 108 | $this->$method ($value); |
| 109 | 109 | |
| 110 | - elseif (strtolower ($name) == 'name') |
|
| 111 | - { |
|
| 112 | - try |
|
| 113 | - { |
|
| 114 | - $this->setProperty ($name, $value); |
|
| 115 | - } |
|
| 110 | + elseif (strtolower ($name) == 'name') |
|
| 111 | + { |
|
| 112 | + try |
|
| 113 | + { |
|
| 114 | + $this->setProperty ($name, $value); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - catch (\WinformsException $e) |
|
| 118 | - { |
|
| 119 | - $this->name = $value; |
|
| 120 | - } |
|
| 121 | - } |
|
| 117 | + catch (\WinformsException $e) |
|
| 118 | + { |
|
| 119 | + $this->name = $value; |
|
| 120 | + } |
|
| 121 | + } |
|
| 122 | 122 | |
| 123 | 123 | else $this->setProperty ($name, EngineAdditions::uncoupleSelector ($value)); |
| 124 | 124 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | # ArrayAccess |
| 150 | 150 | |
| 151 | 151 | public function offsetSet ($index, $value) |
| 152 | - { |
|
| 152 | + { |
|
| 153 | 153 | try |
| 154 | 154 | { |
| 155 | 155 | $index === null ? |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - public function offsetGet ($index) |
|
| 169 | - { |
|
| 170 | - return EngineAdditions::coupleSelector (VoidCore::getArrayValue ($this->selector, $index), $this->selector); |
|
| 168 | + public function offsetGet ($index) |
|
| 169 | + { |
|
| 170 | + return EngineAdditions::coupleSelector (VoidCore::getArrayValue ($this->selector, $index), $this->selector); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - public function offsetUnset ($index): void |
|
| 174 | - { |
|
| 175 | - $this->callMethod ('RemoveAt', $index); |
|
| 173 | + public function offsetUnset ($index): void |
|
| 174 | + { |
|
| 175 | + $this->callMethod ('RemoveAt', $index); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | public function offsetExists ($index): bool |