ShutdownApplication() public method

Shuts down AoInitialize object and check back in extensions to ensure any ESRI libraries that have been used are unloaded in the correct order.
Once Shutdown has been called, you cannot re-initialize the product license and should not make any ArcObjects call.
public ShutdownApplication ( ) : void
return void
Example #1
0
        static void Main(string[] args)
        {
            if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine))
            {
                if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop))
                {
                    System.Console.WriteLine("This application could not load the correct version of ArcGIS.");
                    return;
                }
            }

            m_AOLicenseInitializer = new LicenseInitializer();

            //ESRI License Initializer generated code.
            if (!m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeBasic, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced },
                                                              new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork }))
            {
                System.Console.WriteLine(m_AOLicenseInitializer.LicenseMessage());
                System.Console.WriteLine("This application could not initialize with the correct ArcGIS license and will shutdown.");
                m_AOLicenseInitializer.ShutdownApplication();
                return;
            }

            RouteClass routeClass = new RouteClass();

            routeClass.SolveRoute();

            //ESRI License Initializer generated code.
            //Do not make any call to ArcObjects after ShutDownApplication()
            m_AOLicenseInitializer.ShutdownApplication();
        }
		static void Main(string[] args)
		{
			if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine))
			{
				if (!ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop))
				{
					System.Console.WriteLine("This application could not load the correct version of ArcGIS.");
					return;
				}
			}

			m_AOLicenseInitializer = new LicenseInitializer();

			//ESRI License Initializer generated code.
			if (!m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeBasic, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced },
			new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork }))
			{
				System.Console.WriteLine(m_AOLicenseInitializer.LicenseMessage());
				System.Console.WriteLine("This application could not initialize with the correct ArcGIS license and will shutdown.");
				m_AOLicenseInitializer.ShutdownApplication();
				return;
			}

			RouteClass routeClass = new RouteClass();
			routeClass.SolveRoute();

			//ESRI License Initializer generated code.
			//Do not make any call to ArcObjects after ShutDownApplication()
			m_AOLicenseInitializer.ShutdownApplication();
		}