@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | - * * Создание экземпляра типа объекта |
|
| 106 | - * |
|
| 107 | - * @param mixed $objectName - полное название объекта |
|
| 108 | - * [@param mixed $objectGroup = null] - полное пространство имён объекта |
|
| 109 | - * |
|
| 110 | - * @return mixed - возвращает указатель на объект типа объекта или false в случае ошибки |
|
| 111 | - * |
|
| 112 | - */ |
|
| 105 | + * * Создание экземпляра типа объекта |
|
| 106 | + * |
|
| 107 | + * @param mixed $objectName - полное название объекта |
|
| 108 | + * [@param mixed $objectGroup = null] - полное пространство имён объекта |
|
| 109 | + * |
|
| 110 | + * @return mixed - возвращает указатель на объект типа объекта или false в случае ошибки |
|
| 111 | + * |
|
| 112 | + */ |
|
| 113 | 113 | public static function objectType ($objectName, $objectGroup = false) |
| 114 | 114 | { |
| 115 | 115 | return \VoidCore::typeof ($objectName, $objectGroup); |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | public function __get ($name) |
| 537 | - { |
|
| 537 | + { |
|
| 538 | 538 | if (method_exists ($this, $method = "get_$name")) |
| 539 | 539 | $value = $this->$method (); |
| 540 | 540 | |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | $size = $this->count; |
| 564 | 564 | $list = []; |
| 565 | 565 | |
| 566 | - for ($i = 0; $i < $size; ++$i) |
|
| 566 | + for ($i = 0; $i < $size; ++$i) |
|
| 567 | 567 | $list[] = EngineAdditions::coupleSelector (VoidEngine::getArrayValue ($this->selector, $i)); |
| 568 | 568 | |
| 569 | 569 | return $list; |
@@ -593,10 +593,10 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | return EngineAdditions::coupleSelector ($value, $this->selector); |
| 596 | - } |
|
| 596 | + } |
|
| 597 | 597 | |
| 598 | - public function __set ($name, $value) |
|
| 599 | - { |
|
| 598 | + public function __set ($name, $value) |
|
| 599 | + { |
|
| 600 | 600 | if (method_exists ($this, $method = "set_$name")) |
| 601 | 601 | try |
| 602 | 602 | { |
@@ -624,8 +624,8 @@ discard block |
||
| 624 | 624 | } |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | - public function __call ($method, $args) |
|
| 628 | - { |
|
| 627 | + public function __call ($method, $args) |
|
| 628 | + { |
|
| 629 | 629 | $args = array_map (function ($arg) |
| 630 | 630 | { |
| 631 | 631 | return EngineAdditions::uncoupleSelector ($arg); |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | } |
| 645 | 645 | |
| 646 | 646 | public function offsetSet ($index, $value) |
| 647 | - { |
|
| 647 | + { |
|
| 648 | 648 | try |
| 649 | 649 | { |
| 650 | 650 | return $index === null ? |
@@ -660,14 +660,14 @@ discard block |
||
| 660 | 660 | } |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | - public function offsetGet ($index) |
|
| 664 | - { |
|
| 665 | - return EngineAdditions::coupleSelector (VoidEngine::getArrayValue ($this->selector, $index), $this->selector); |
|
| 663 | + public function offsetGet ($index) |
|
| 664 | + { |
|
| 665 | + return EngineAdditions::coupleSelector (VoidEngine::getArrayValue ($this->selector, $index), $this->selector); |
|
| 666 | 666 | } |
| 667 | 667 | |
| 668 | - public function offsetUnset ($index): void |
|
| 669 | - { |
|
| 670 | - $this->callMethod ('RemoveAt', $index); |
|
| 668 | + public function offsetUnset ($index): void |
|
| 669 | + { |
|
| 670 | + $this->callMethod ('RemoveAt', $index); |
|
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | public function offsetExists ($index): bool |
@@ -685,19 +685,19 @@ discard block |
||
| 685 | 685 | return true; |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | - public function indexOf ($value): int |
|
| 689 | - { |
|
| 690 | - return $this->callMethod ('IndexOf', EngineAdditions::uncoupleSelector ($value)); |
|
| 688 | + public function indexOf ($value): int |
|
| 689 | + { |
|
| 690 | + return $this->callMethod ('IndexOf', EngineAdditions::uncoupleSelector ($value)); |
|
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | public function lastIndexOf ($value): int |
| 694 | - { |
|
| 695 | - return $this->callMethod ('LastIndexOf', EngineAdditions::uncoupleSelector ($value)); |
|
| 696 | - } |
|
| 694 | + { |
|
| 695 | + return $this->callMethod ('LastIndexOf', EngineAdditions::uncoupleSelector ($value)); |
|
| 696 | + } |
|
| 697 | 697 | |
| 698 | - public function contains ($value): bool |
|
| 699 | - { |
|
| 700 | - return $this->callMethod ('Contains', EngineAdditions::uncoupleSelector ($value)); |
|
| 698 | + public function contains ($value): bool |
|
| 699 | + { |
|
| 700 | + return $this->callMethod ('Contains', EngineAdditions::uncoupleSelector ($value)); |
|
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | public function foreach (callable $callback, string $type = null): void |
@@ -751,45 +751,45 @@ discard block |
||
| 751 | 751 | return VoidEngine::callMethod ($this->selector, $method, ...$args); |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | - protected function getArrayProperty ($name, string $type = null) |
|
| 755 | - { |
|
| 754 | + protected function getArrayProperty ($name, string $type = null) |
|
| 755 | + { |
|
| 756 | 756 | $array = $this->getProperty ($name); |
| 757 | 757 | $size = VoidEngine::getProperty ($array, 'Length'); |
| 758 | 758 | $return = []; |
| 759 | 759 | |
| 760 | - for ($i = 0; $i < $size; ++$i) |
|
| 760 | + for ($i = 0; $i < $size; ++$i) |
|
| 761 | 761 | $return[] = VoidEngine::getArrayValue ($array, $type === null ? $i : [$i, $type]); |
| 762 | 762 | |
| 763 | 763 | VoidEngine::removeObjects ($array); |
| 764 | 764 | |
| 765 | - return $return; |
|
| 765 | + return $return; |
|
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | public function get_name () |
| 769 | - { |
|
| 770 | - try |
|
| 771 | - { |
|
| 772 | - return $this->getProperty ('Name'); |
|
| 769 | + { |
|
| 770 | + try |
|
| 771 | + { |
|
| 772 | + return $this->getProperty ('Name'); |
|
| 773 | 773 | } |
| 774 | 774 | |
| 775 | - catch (\Throwable $e) |
|
| 776 | - { |
|
| 777 | - return $this->name; |
|
| 778 | - } |
|
| 779 | - } |
|
| 775 | + catch (\Throwable $e) |
|
| 776 | + { |
|
| 777 | + return $this->name; |
|
| 778 | + } |
|
| 779 | + } |
|
| 780 | 780 | |
| 781 | - public function set_name (string $name) |
|
| 782 | - { |
|
| 783 | - try |
|
| 784 | - { |
|
| 785 | - $this->setProperty ('Name', $name); |
|
| 781 | + public function set_name (string $name) |
|
| 782 | + { |
|
| 783 | + try |
|
| 784 | + { |
|
| 785 | + $this->setProperty ('Name', $name); |
|
| 786 | 786 | } |
| 787 | 787 | |
| 788 | - catch (\Throwable $e) |
|
| 789 | - { |
|
| 790 | - $this->name = $name; |
|
| 791 | - } |
|
| 792 | - } |
|
| 788 | + catch (\Throwable $e) |
|
| 789 | + { |
|
| 790 | + $this->name = $name; |
|
| 791 | + } |
|
| 792 | + } |
|
| 793 | 793 | |
| 794 | 794 | public function __toString (): string |
| 795 | 795 | { |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | $this->text = $caption; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function set_font ($font): void |
|
| 28 | - { |
|
| 27 | + public function set_font ($font): void |
|
| 28 | + { |
|
| 29 | 29 | if (is_array ($font)) |
| 30 | 30 | { |
| 31 | 31 | $font = array_values ($font); |
@@ -4,37 +4,37 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | class Form extends Control |
| 6 | 6 | { |
| 7 | - public $class = 'System.Windows.Forms.Form'; |
|
| 7 | + public $class = 'System.Windows.Forms.Form'; |
|
| 8 | 8 | |
| 9 | - public function get_icon () |
|
| 10 | - { |
|
| 11 | - return new FormIcon ($this->selector); |
|
| 12 | - } |
|
| 9 | + public function get_icon () |
|
| 10 | + { |
|
| 11 | + return new FormIcon ($this->selector); |
|
| 12 | + } |
|
| 13 | 13 | |
| 14 | - public function get_clientSize () |
|
| 15 | - { |
|
| 16 | - $size = $this->getProperty ('ClientSize'); |
|
| 14 | + public function get_clientSize () |
|
| 15 | + { |
|
| 16 | + $size = $this->getProperty ('ClientSize'); |
|
| 17 | 17 | |
| 18 | - return [ |
|
| 19 | - VoidEngine::getProperty ($size, 'Width'), |
|
| 20 | - VoidEngine::getProperty ($size, 'Height') |
|
| 21 | - ]; |
|
| 22 | - } |
|
| 18 | + return [ |
|
| 19 | + VoidEngine::getProperty ($size, 'Width'), |
|
| 20 | + VoidEngine::getProperty ($size, 'Height') |
|
| 21 | + ]; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - public function set_clientSize ($size) |
|
| 25 | - { |
|
| 26 | - if (is_array ($size)) |
|
| 27 | - { |
|
| 28 | - $clientSize = $this->getProperty ('ClientSize'); |
|
| 24 | + public function set_clientSize ($size) |
|
| 25 | + { |
|
| 26 | + if (is_array ($size)) |
|
| 27 | + { |
|
| 28 | + $clientSize = $this->getProperty ('ClientSize'); |
|
| 29 | 29 | |
| 30 | - VoidEngine::setProperty ($clientSize, 'Width', array_shift ($size)); |
|
| 31 | - VoidEngine::setProperty ($clientSize, 'Height', array_shift ($size)); |
|
| 30 | + VoidEngine::setProperty ($clientSize, 'Width', array_shift ($size)); |
|
| 31 | + VoidEngine::setProperty ($clientSize, 'Height', array_shift ($size)); |
|
| 32 | 32 | |
| 33 | - $this->setProperty ('ClientSize', $clientSize); |
|
| 34 | - } |
|
| 33 | + $this->setProperty ('ClientSize', $clientSize); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - else $this->setProperty ('ClientSize', EngineAdditions::uncoupleSelector ($size)); |
|
| 37 | - } |
|
| 36 | + else $this->setProperty ('ClientSize', EngineAdditions::uncoupleSelector ($size)); |
|
| 37 | + } |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | class FormIcon extends Icon |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function loadFromFile (string $file) |
| 50 | - { |
|
| 50 | + { |
|
| 51 | 51 | $icon = VoidEngine::createObject ('System.Drawing.Icon', 'System.Drawing', $file); |
| 52 | 52 | |
| 53 | 53 | VoidEngine::setProperty ($this->formSelector, 'Icon', $icon); |
| 54 | 54 | |
| 55 | - if (!isset ($this->selector)) |
|
| 56 | - $this->selector = $icon; |
|
| 57 | - } |
|
| 55 | + if (!isset ($this->selector)) |
|
| 56 | + $this->selector = $icon; |
|
| 57 | + } |
|
| 58 | 58 | } |