Analysis of the interaction process between ArcGis Server ADF Toolbar and Map client and Server 1

Source: Internet
Author: User

1. Toolbar initialization steps

[1], Toolbar. FrameworkInitialize ()

All Tool instances are created here (but all their attributes are not initialized ).

[2], Toolbar. OnLoad ()

The AddToolItems () method is called to create a tool instance in Map. Tool bar
The tool class name is ToolbarItem, while the tool class name in Map is MapToolItem. The two are not the same.

AddToolItems:

(1) retrieve all toolbaritems (s) of the Toolbar)
(2) foreach (loop)
{
1. Call callToolbarItemInitialize () to further initialize ToolbarItem,
While callToolbarItemInitialize () calls LoadClassFromAssembly () internally
Create a ServerActionClass instance of ToolBarItem.
Hashtable files are saved to pair the ToolbarItem name with the Object name.

2. Create a MapToolItem instance based on ToolbarItem and add it to the internal worker of Map.
Centralized.

MapToolItem has a ServerToolAction attribute to save the corresponding
ServerActionClass instance.
}

[3], ToolbarBase. RenderContents ()-> RenderRuntime ()

This step is mainly used to generate the Client HTML code of tool bars and tool buttons

RenderRuntime ()
{
......

//
// Call the Render () method of ToolbarItem so that each ToolBarItem generates its own
// Corresponding method
//
Foreach (ToolbarItem item in this. ToolbarItems)
{
Item. Render (this, num2, num3, false, builder );
}
...
}

Tool. Redner () has a lot of work, but the most important thing is the following code:

Render ()
{
...
If (! InDesignMode &&! Base. Disabled)
{
Builder. append (string. format ("onMouseDown = \" ToolbarMouseDown ('{0}', '{1}', 'tool', event); \ "\ n", toolbar. clientID, this. name ));
Builder. append (string. format ("onMouseOver = \" ToolbarMouseOver ('{0}', '{1}'); \ "\ n", toolbar. clientID, this. name ));
Builder. append (string. format ("onMouseOut = \" ToolbarMouseOut ('{0}', '{1}'); \ "\ n", toolbar. clientID, this. name ));
}
...
}

This code means that if you click the button on the toolbar
Function ToolbarMouseDown.

This ToolbarMouseDown () appears in ESRI. ADF. UI. Toolbar. js.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.