�3� .��� ���
C�������
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 1
����� �� �������� •
����� C������� � N� ������� G������ / O����� ������ ���� G������ �����/ ��������� E������� ����� ������� �� �������. – –
•
C�� �� ����� �� ���������. C�� ��� ���� ������ ������ ���� � F��� / ������B��* ������B��* ���������� ���������.
������� C������� � C�� ��� G������ ��� K������� ������. – –
•
��� ���� ����� � � � �� ��� ��� ��� �, �� ��� ��� �� ������. –
– –
•
��������� ��������� ��� ���������, ����������� ����������� ��������. C�� ��� ���� ������ ���� � F��� / ������B��*. ������B��*.
��� ��� � ��� ��� ��
A���� ��������� ��������� ������ (�������, ������) �� ����� ��� �������� �������� ������� �����. ��������� ��������� ��� ���������, ����������� ����������� ��������. C�� ��� ���� ������ ���� � F��� / ������B��*. ������B��*.
������B�� ������������� �� �3� .��� ��� ���� �� ��������� ����� ��. ���� ����, �� ��� ��� F���� ��� ��� ���� �������. ������� . ����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 2
���� ����������� �������� B���� �� ��� ������� ��� ������������� �� ���������, ������ �� ������� ���� ������ ��
•
– – –
B���M����C������ B���G������C������ B�������C������
������� ����
•
�������� ���������� ��� �������. O������� ���� �������� M������ & ����������, ����� ����� ������.
•
I� �� �� ������ �� ���� !!!
•
BaseModalCommand Specify Command Characteristics
Modal True/False Suspendable True/False EnableUIFlags prerequisites to run. Implement OnStart( ) OnSuspend ( ) …
OnStop ( ) OnResume ( ) …
User ModalCommand … …. … … …. …
BaseGraphicCommand Specify AllowEvents True/False to indicate whether you want to receive events or not.
Implement Mouse/Keyboard Event Handlers as required
User GraphicCommand … …. … … …. …
BaseStepCommand Setup Command Steps and Event handlers and implement as required.
User StepCommand … …. … … …. …
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 3
������ & ������ �������� �� ������� ����� –
–
–
–
–
–
–
������ ����� �������( ) ���� �� ������� ������� �� ����� � ������� ���� ������ ������. (���� ����� �� ��� ������ ����� �� ������ ������� �� ��A�� �� NO�) ����� �������� A�� ������������� �� ������ �������( ). ���� �������( ) ������ �������, ������ ����� �� (O����� ���� �������). ��������� �������� K��� ������� ����� ������� (�� ������ �� ������). ����������� �������� ��������� & ������� ����� �� ��� ��������� �
M��� B���� �������� ��������� ���� �� � ���� (����� / ���������) �� ������ ������ ���� ���������� ��� ��� �� ��� ���������� ������ ��� ������ �����. � F��� �� ��� � ��������� : �� D����� C������. ������� C������� ��� ��� ������ (������ ���� G������ ����) �� �������� �� ������ ���� ����� / ������B�� / �I ��������. ���� C������� ��� ��� ������ (������/������� ���� G������ �����, ������� ���� ��������� E�������), �� �������� �� ������ ���� F���� / ������B�� / �I ��������.
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 4
��������������� (����������) �� ������� –
–
–
–
A ��������� ����� �������� ��������� ������� �� ��� ������� ������� ���� �������/������ ������ ����� �������. I� ����, ��� ������� ���������� �� ������ �������( ). A ��������� ����������� �������� ��������� �� ��� ������� ��� �� ��������� ����������� ����� �� �� �������, �� �������� �� � ������ �������� ������� ����� �������. ��� �� ��������� �� ���� �� �������, ���� �� ��� ����� �������� �� F����. A ��������� ������������� �������� ��������� ��� ���������� �� ������� �� ���. C�� ������ ��� �� ���� �� ����� �������� •
N� ���������� ������.
•
N���� A��������� �.�. ����� � G������ ����.
•
N���� A�����C��������� �.�. ������� ���������, ��������� �� � �����.
•
N���� A�����D������� �.�. ������ ������� ����.
•
N���� N��E������������� �.�. ���� ������� ��������.
C������ M������ ������ ���� ������� ���� ��� ������ ����� �� ������ ������� �� ����� ��� ������� �� ���.
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 5
��� ������ ���� � �������. System checks if its current state satisfies the command’s
User Invokes Command
No
EnableUISettings (View, Connection, Document, Selection)
Cannot Run.
Command Logic continues to run, event handlers responding to events (Mouse/KeyBoard/Selection change).
Yes ys em nvo es n ar me o and it runs till its logic completes and returns back to system.
System(Command Manager) Stops the Command. OnStop ( ) method gets invoked.
True
System checks command’s Modal property value
Prerequisites NOT met !!!
OnSuspend( ) gets invoked when System (Command Mgr) suspends the command. OnResume( ) gets invoked when System (Command Mgr) resumes the command.
False
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 6
OnStop( ) gets invoked when System (Command Mgr) stops the command. Command calls StopCommand ( ) to stop itself when appropriate. This results in OnStop( ) getting invoked.
������� �������������� •
���� ���� �������� �� �������� �������������� ��� ����� ����������/������� ����� �� ����� �� �� ���������. D������ ���� �� ��������� ��� �������/����������. –
����� �������� ������ ���� / F���� �� �����������
–
����������� �������� ������ ���� / F���� �� �����������
–
���������������� �������� ������� ������������ ���������� �������� ��� ��� ������� �� ���. ��� E������IF����������� �����. ��� � ��� ��� �� �� � � �� �� � �� ����� �� � �� ������ N��E������������� �����. L������ �� ����� ������� �N� C��������� ���������
•
D������ �������� ������
������� → �������� ↓
�����
�������
����
M����
����
F����
F����
�����������
F����
����
����
E������I��������
N���
N���
N���
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 7
������� �������������� –
������� ( ) I������ �� ������ ���� ���� ������� �� ������� •
•
–
��� G������ / ���� C�������, ���� ��������� ���� ��� ������� ����� ��� ��� ����� �������� ���� ��� �������������.
������ ( ) I������ �� ������ ���� �� ���������� ���� ������� ����� �� �� �������. •
–
��� M���� C�������, ���� ��������� ��� �� ��� ��� ������, �� ���� � ���� ����� ��� ��� �����.
����� ���� ������� ����� �� ��� � ������ ����� / �I ���.
��������� ( ) I������ �� ������ ���� �� ���������� ���� ������� ����� �� �� ��������� � H��� ��������� , ��� ������� ���� ���� ��� �I ����(�) ��� ��� ����������� �� ������.
–
�������� ( ) I������ �� ������ ���� �� ���������� ���� ������� ����� �� �� ������� � H��� ��������� , ��� ������� ���� ������ ��� �I ����(�) ��� ��� ��� ��������� �� ������.
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 8
������� �������������� � ������( ) I������ �� ������ ���� �� ���������� ���� ���� ���� �
–
������ �������� ���� ���� �������������� ����, ��� ��� ��� �� ��������� ���� ����� ���������� ���������� �� ������ ������� ����������� ���� ��� ���� ������� �������������. –
–
F�� ������� C�������, ���� ���������� �������� G������ ���� M������ / K������� ����� �������� � (������� �� � ����� �������) F�� ���� C�������, ���� ���� ���� D��������� ����� ��� ���������� ���� / G������ ���� M������ / K������� ����� �������� � (������� �� � ����� �������)
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 9
������� �������� –
–
–
–
–
C������� ��� ������� ���� � ������ ��������, ���������� ��� ��������� �� ��� ������� (�������� / ������� ���� / C����� �������� ������). C�� �� N������������� �� H�����������. H����������� �������� CANNO� ������/����� ������������. ��������� ��� �� �� ��� �� � ��, �� ��� ���� ������ �� ���� � �� �� � �������. N����� �������� ���� ��� ���� �����. N��� : L���������� ��� ���� ���������� ��� ��� �� �� ����. M�� ������ �� ��� ��������� ������� �� ��� �I ��� ��� A�I �����, ��� ����� ������ ��� �� ����.
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 10
������� ���������� (��������) – –
–
–
O��� ��� ������� �� ������ �� � ����. O��� ��� ������� ����� �� ������� (�.�. ��� �� ��������� �����) �� ������ For this reason, A ������� ������ ������� ������ � ☺ making a High Priority command ���� � ��� ������� �� ������� suspendable doesn’t I� make any sense. •
C������C��.����������� = ����, ��� N��C��.�������� > C������C��.�������� •
���� – –
–
C������ C������ �� ��������� (���������( ) �� �������), ��� ����� ������� (��������( ) �� �������) ���� N�� C������ �����.
A�� ����� �����, C������ C������ �� ������� (������( ) �� �������) ���� � ��� C������ �� �������.
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 11
������� ���������� (��������) � A running non-suspendable command gets stopped by system when any another command is invoked.
Cmd-1, non-suspendable Running
Cmd-1 gets stopped by system
A running suspendable command gets suspended by system when any High priority command is invoked. System resumes the suspended command when the high priority command stops. Cmd-1, Non-Modal, Suspendable Running
Cmd-2, High Priority Started
Cmd-2 Ends
Cmd-1 Resumed
Cmd-1 gets resumed by system
Cmd-1 gets suspended by system. Its internal data still maintained ����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 12
Cmd-2 started
������� ���������� (��������) � A suspended command gets stopped by system when any Normal priority command is invoked.
Cmd-1, Non-Modal, Suspendable Running
Cmd-2, High Priority Started
Cmd-1 gets suspended by system. Its internal data still maintained
Cmd-3, Normal Priority Started
Cmd-2 stopped by System
Cmd-1 gets stopped by system
����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 13
�������������� ������������ •
•
•
•
•
C������� ������ ��� ��������� ����� ����� ������������� �� ��� �����, �.�. ���� ������ ������ ��� ����� ���� ����� ��� ���� ������� �� ������ �� ��� ��������. �.�. ������ ����� �� ������ ��� ����������� (���� �� ������������ �����) ������ ���� ��� ���������� �����. C������ ������ ��� ��������� ������� ����������� ������� ���� �� ����� ��������. M��� �����, ���� ��� �� ������ ������� �� ���������� � �����������M�� A���� �� ��� �������������� �� ��� �������. I � �� �� � H����� ������� �� � ��������������� ����� �������, �� ���� ������������ ���, ���� �� ������ ��� �� �� �����. ����� ��� ��� ���������� �� �����. I� ���� �� �������� ����� �� ��� ������� ��� ������� �� �������� �������, �� �������� ����� �� ��� ������� ��� ������������� �������� ��� ������ / ����� �������������� �� ����� �������� (����� ���� ��� �����) C������� ���� �������� ����� �I ���� ���� ��� ��������� / �������. ����� ��� �� ���� ���� ���������� �� ����. F�� �������, ��� ���� ���� ���� ������� ����� ��� ���� ��� ��� F��� ��� �� ������ ����� ��� ���� ���� ������� ��� ������. O�� ��� ��� ����� �������� ����� ��� �ODO ���� ���� �� ��. �������� ��������, ��� ������ ��������� ������ ��� ������� ����� ���� �� ������� ���������� �� ��� ������� ����� ������ ��� ��� �� ���������� �������. ����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 14
���� �� ������� �� ��� ���� �� ��� ������ ��� •
•
•
•
A� ��� ����, �� C������� �� ������ ������� �� ��� ������. ����� �� ����� � ����� ���� ����� �� �� �������� �������� �� ��� ������. ���, �� �� ���� !!! ���� ������� �� ������ ��� D������ �������, ������� �� ��� ������ ���� (��� E����������). I� ������ ���� ���� �� ������� �� �������. O� ������, �� ������ �� � M���� �������. M��� �� ��� ����� �� �� ��� � ������ ��������. ���� ������ C������ ������ ��������� �� ��������, �� ������ ��� � �M����� C������� ����� ���� �� �������� ���� �� � .
–
•
–
A� ������������� ����� �� ������� ����� ��� ������ ���� �� ��� M����� C������ ��� ��� ��������� �����.
–
���� ������� ����� � ������� ������ ��� ����� ������ �� ������ ��������� �������� ������(�)
���� � ������� ���� ������ ��� ����� �� �� ������� �� ��������� �����, ��� ������ ������ ��� D������ C������. –
–
•
����� ������ �� �������� ��������� � ������ C������ C����������� � ����� � ���� ��� ��� �� ������ ���� ������� �� ������ �� �� �� ������� ��� ���������� ������� ������� � ���� ��������� �� ��� ��� ��������� ��� E�� ������ A��������� �� �� �� ����� ������� �� ��� �� ��� �����. E� : ����� ���� I����� C�������� & F����� ������ ��� ����� ���� ������� ��������
I� �� ��������� �� ���� ���� ������� ������� ���� ��������� ����� �� ���� ��� �������� �������� ��� ����� ������ ����������. ����� 3D .��� A�I �������� � � 2008. I��������� C����������. A�� ������ ��������. C������� � 15