Simply talk about "syc. about Map And PageLayout"

228
4
09-29-2013 08:19 PM
Highlighted
New Contributor
I am confuse about the "syc. about Map And PageLayout".
As I posted a thread before, the same issue about this.But nobody reply.Sad about saying this.
Here is the siple code:
//Swith page between "Map" and "PageLayout".
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) {
            if (tab_control.SelectedIndex == 0) {   //Switch to the Map View page.
                toolbar.SetBuddyControl(map);
                toc.SetBuddyControl(map);
            }
            else if (tab_control.SelectedIndex == 1) {  //Switch to the PageLayout page.
                toolbar.SetBuddyControl(page_layout);
                toc.SetBuddyControl(page_layout);
            }
        }

        private void FormMain_Load(object sender, EventArgs e) {
            //Set the Map as the buddies for the ToolBar and TOCControl.
            toolbar.SetBuddyControl(map);
            toc.SetBuddyControl(map);
        }


If this code run in a App that is not contain a stuff called "LicenseInitializer.cs". The App will auto shut down when I switch the Page
"Map" to "PageLayout".That is to say,I just do not know what the sfuff "LicenseInitializer.cs" do, the APP runs normal when switch the
same way.
Reply
0 Kudos
4 Replies
Highlighted
Regular Contributor II
The license initializer initializes the ArcGIS (engine runtime, advanced etc.) that is necessary to use ArcObjects components.  Without a license attempting to use ArcObjects classes will fail.
Reply
0 Kudos
Highlighted
New Contributor
The license initializer initializes the ArcGIS (engine runtime, advanced etc.) that is necessary to use ArcObjects components.  Without a license attempting to use ArcObjects classes will fail.

Thanks for answering. It seems that the license do something,and that is what I thought about,but can you just launch me sth. such as If the initializer launch the code or not.I mean that the work is done behind or lauch us the code about that.
Reply
0 Kudos
Highlighted
Regular Contributor II
I am not sure I follow.  The license initializer may or may not be used in your code.  Typically that gets added to the project when you use an esri template.  I don't know what type of project, form, console, library you have.  It might be called in the application initialization events, in the main function of a class or in the load of a form.  The best thing is to search for references to it in your code.
Reply
0 Kudos
Highlighted
New Contributor
I am not sure I follow.  The license initializer may or may not be used in your code.  Typically that gets added to the project when you use an esri template.  I don't know what type of project, form, console, library you have.  It might be called in the application initialization events, in the main function of a class or in the load of a form.  The best thing is to search for references to it in your code.


I have overviewed the code in the initializer,but I do't know which is something we talk about,It seems unabvious.you know that,therefore I do not how to search for the reference. Thanks all the same.
Reply
0 Kudos