private void Application_Startup(object sender, StartupEventArgs e) { try { //**************** // // Authentication: // Use of Esri location services, including basemaps and geocoding, requires either an ArcGIS identity or an API key. // For more information see https://links.esri.com/arcgis-runtime-security-auth. // // Licensing: // Production deployment of applications built with ArcGIS Runtime requires you to license ArcGIS Runtime functionality. // For more information see https://links.esri.com/arcgis-runtime-license-and-deploy. // //**************** // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); // Exit application this.Shutdown(); } }
public App() { // Initialize runtime. This is place where to set ClientId and/or licenses. ArcGISRuntimeEnvironment.Initialize(); DispatcherUnhandledException += App_DispatcherUnhandledException; }
private void Application_Startup(object sender, StartupEventArgs e) { try { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. for (int i = 0; i != e.Args.Length; ++i) { if (e.Args[i] == "/UpdateSplashScreen") { MainViewModel.UpdateSplashScreen = true; } } // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); Cache.License(); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; // Add the event handler for handling UI thread exceptions to the event. Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); // Exit application this.Shutdown(); } }
private void Application_Startup(object sender, StartupEventArgs e) { try { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Pull license key listed in App.xaml var licenseKey = Application.Current.Resources["ArcGISRuntimeLicenseKey"] as string; if (!string.IsNullOrEmpty(licenseKey) && licenseKey != "INSERT_KEY_HERE") { ArcGISRuntimeEnvironment.SetLicense(licenseKey); } // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); // Exit application this.Shutdown(); } }
public OrderOfBattleViewModel() { Mediator.Register(Constants.ACTION_CANCEL, DoActionCancel); Mediator.Register(Constants.ACTION_ITEM_WITH_GUID_REMOVED, DoActionItemWithGuidRemoved); Mediator.Register(Constants.ACTION_ITEM_WITH_GUID_ADDED, DoActionItemWithGuidAdded); // Check the ArcGIS Runtime is initialized if (!ArcGISRuntimeEnvironment.IsInitialized) { ArcGISRuntimeEnvironment.Initialize(); } // hook the commands SearchCommand = new RelayCommand(OnSearch); SymbolChangedCommand = new RelayCommand(OnSymbolChanged); // Create a new MilitarySymbolDictionary instance MilitarySymbolDictionary = new SymbolDictionary(SymbolDictionaryType.Mil2525c); // Collection of view models for the displayed list of symbols Symbols = new ObservableCollection <SymbolViewModel>(); // Set the image size _imageSize = 96; // org tree view _groupSymbol = new SymbolGroupViewModel(SymbolLoader.LoadSymbolWrapper()); ExpandGroupSymbol(_groupSymbol); }
public MainWindowViewModel() { try { ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { Console.WriteLine(@"Unable to initialize the ArcGIS Runtime with the client id provided: " + ex.Message); } Mediator.Register(Constants.ACTION_PHASE_ADDED, DoPhaseAdded); Mediator.Register(Constants.ACTION_PHASE_INDEX_CHANGED, DoPhaseIndexChanged); Mediator.Register(Constants.ACTION_MISSION_LOADED, DoMissionLoaded); CancelCommand = new RelayCommand(OnCancelCommand); DeleteCommand = new RelayCommand(OnDeleteCommand); SaveCommand = new RelayCommand(OnSaveCommand); OpenCommand = new RelayCommand(OnOpenCommand); EditMissionPhasesCommand = new RelayCommand(OnEditMissionPhases); EditGeometryCommand = new RelayCommand(OnEditGeometryCommand); EditGeometryRedoCommand = new RelayCommand(OnEditGeometryRedoCommand); EditGeometryUndoCommand = new RelayCommand(OnEditGeometryUndoCommand); SwitchViewCommand = new RelayCommand(OnSwitchViewCommand); MapView = new MapView(); OOBView = new OrderOfBattleView(); MTLView = new MissionTimeLineView(); }
public async void Initialize() { // ライセンスキーを登録して Lite ライセンスの認証を行う string licenseKey = "xxxx"; ArcGISRuntimeEnvironment.SetLicense(licenseKey); MobileMapPackage myMapPackage = await MobileMapPackage.OpenAsync(@"..\..\..\..\SampleData\sample_maps.mmpk"); // マップ ビューの持つ Map プロパティにモバイル マップ パッケージが持つマップを割り当てる MyMapView.Map = myMapPackage.Maps.First(); // 背景に ArcGIS Online の衛星画像サービスを表示する MyMapView.Map.Basemap = Basemap.CreateImagery(); // マップのレイヤーを取得してレイヤーの透過率を設定 MyMapView.Map.OperationalLayers[0].Opacity = 0.5; // マップのスケール範囲を設定 MyMapView.Map.MinScale = 5000000; MyMapView.Map.MaxScale = 5000; // マップに追加されているレイヤーの一覧取得 TreeViewMultipleTemplatesSample(); // マップ ビューのタップイベント MyMapView.GeoViewTapped += MyMapView_GeoViewTapped; }
private void Application_Startup(object sender, StartupEventArgs e) { try { // Deployed applications must be licensed at the Basic level or greater (https://developers.arcgis.com/licensing). // To enable Basic level functionality set the Client ID property before initializing the ArcGIS Runtime. // ArcGISRuntimeEnvironment.ClientId = "<Your Client ID>"; // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // Standard level functionality can be enabled once the ArcGIS Runtime is initialized. // To enable Standard level functionality you must either: // 1. Allow the app user to authenticate with ArcGIS Online or Portal for ArcGIS then call the set license method with their license info. // ArcGISRuntimeEnvironment.License.SetLicense(LicenseInfo object returned from an ArcGIS Portal instance) // 2. Call the set license method with a license string obtained from Esri Customer Service or your local Esri distributor. // ArcGISRuntimeEnvironment.License.SetLicense("<Your License String or Strings (extensions) Here>"); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); // Exit application this.Shutdown(); } }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. if (LicenseKey == "ADD_LICENSE_KEY") { Debug.WriteLine(""); Debug.WriteLine("Please add the license on App.cs file"); Debug.WriteLine(""); } else #pragma warning disable 162 { // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.SetLicense(LicenseKey, ExtensionLicenseKeys); } #pragma warning restore 162 ArcGISRuntimeEnvironment.Initialize(); UnhandledException += App_UnhandledException; InitializeComponent(); Suspending += OnSuspending; }
public void Init(HMCon con, TUC_HMDevXManager.TUC_HMDevXManager hmDevMgr, GridView gv, List <IMapLayer> layers, List <PosGenerator> posGens) { _hmCon = con; _hmDevMgr = hmDevMgr; _gv = gv; _layers = layers; _posGens = posGens; linkGen.Enabled = _posGens != null; _pop = new frmPopup(_hmDevMgr); if (!ArcGISRuntimeEnvironment.IsInitialized) { try { //ArcGISRuntimeEnvironment.InstallPath = Application.StartupPath; ArcGISRuntimeEnvironment.ClientId = "EdzP18VEt80l7prT"; ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { _pop.ShowPopup($"Unable to initialize the ArcGIS Runtime with the client ID provided: {ex.Message}"); } } _hmDevMgr.FormInit(this); }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { ArcGISRuntimeEnvironment.Initialize(); this.InitializeComponent(); this.Suspending += OnSuspending; }
private void Application_Startup(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += (s, ex) => LogUnhandledException((Exception)ex.ExceptionObject, "AppDomain.CurrentDomain.UnhandledException"); DispatcherUnhandledException += (s, ex) => LogUnhandledException(ex.Exception, "Application.Current.DispatcherUnhandledException"); try { var x = Application.Current.Resources["RibbonThemeColorBrush"] = new SolidColorBrush(Colors.DarkGreen); // Deployed applications must be licensed at the Basic level or greater (https://developers.arcgis.com/licensing). // To enable Basic level functionality set the Client ID property before initializing the ArcGIS Runtime. // ArcGISRuntimeEnvironment.ClientId = "<Your Client ID>"; ArcGISRuntimeEnvironment.ClientId = "1KVc5mmIMY7okeFJ"; // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // Standard level functionality can be enabled once the ArcGIS Runtime is initialized. // To enable Standard level functionality you must either: // 1. Allow the app user to authenticate with ArcGIS Online or Portal for ArcGIS then call the set license method with their license info. // ArcGISRuntimeEnvironment.License.SetLicense(LicenseInfo object returned from an ArcGIS Portal instance) // 2. Call the set license method with a license string obtained from Esri Customer Service or your local Esri distributor. // ArcGISRuntimeEnvironment.License.SetLicense("<Your License String or Strings (extensions) Here>"); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); _log.Error(ex); Shutdown(); } }
private void Application_Startup(object sender, StartupEventArgs e) { if (Settings.Default.User == Guid.Empty) { Settings.Default.User = Guid.NewGuid(); Settings.Default.Save(); } var tc = Globals.Telemetry = new TelemetryClient(); tc.InstrumentationKey = "774f34ad-5ce9-4cf5-baad-58641336820d"; tc.Context.User.Id = Settings.Default.User.ToString(); tc.Context.User.AccountId = Environment.UserName; tc.Context.Session.Id = Guid.NewGuid().ToString(); tc.Context.Device.OperatingSystem = Environment.OSVersion.ToString(); tc.TrackEvent("Start"); tc.TrackPageView("MainWindow"); #if DEBUG TelemetryConfiguration.Active.TelemetryChannel.DeveloperMode = true; #endif try { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); //ArcGISRuntimeEnvironment.SetLicense(_licenseKey); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); // Exit application Shutdown(); } // this allows the font to be overridden FrameworkElement.StyleProperty.OverrideMetadata(typeof(Window), new FrameworkPropertyMetadata { DefaultValue = FindResource(typeof(Window)) }); if (DateTime.Now > _expiredDate) { var dialog = new ExpiredWindow(); dialog.ShowDialog(); Environment.Exit(0); } _mainWindow = new MainWindow(); Current.MainWindow = _mainWindow; _mainWindow.Closing += OnClosing; _mainWindow.Show(); }
public App() { InitializeComponent(); ArcGISRuntimeEnvironment.Initialize(); //GetConnect(); MainPage = new NavigationPage(new MainPage()); //new MainMenuPage(); // }
// This is the main entry point of the application. static void Main(string[] args) { // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main(args, null, "AppDelegate"); }
public override void OnCreate() { base.OnCreate(); // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); }
public App() { ArcGISRuntimeEnvironment.SetLicense("runtimelite,1000,rud1037892786,none,A3E60RFLTJKS6XCFK015"); InitializeComponent(); Initialize(); SetMainPage(); }
public App() { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // The root page of your application MainPage = new MapPage(); }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); this.InitializeComponent(); this.Suspending += OnSuspending; }
// This is the main entry point of the application. static void Main(string[] args) { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main(args, null, "AppDelegate"); }
public App() { Device.SetFlags(new string[] { "Markup_Experimental" }); // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. //ArcGISRuntimeEnvironment.SetLicense(licenseKey:licencekey); // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // The root page of your application MainPage = new NavigationPage(new StartPage()); }
public App() { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.SetLicense("runtimebasic,1000,rud000252796,none,MJJ47AZ7G349NERL1216"); ArcGISRuntimeEnvironment.Initialize(); Resources.Add("RouteServiceProxy", "https://utility.arcgis.com/usrsvcs/appservices/uoBbS3YqJ0gRi2Ab/rest/services/World/Route/NAServer/Route_World/solve"); // The root page of your application MainPage = new NavigationPage(new MapPage()); // (new OAuthPage()); }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; ArcGISRuntimeEnvironment.Initialize(); // Work around of .NET native compilation issue where ArcGIS Runtime assemblies // gets optimized away by explicitly defining the assemblies that are used. List <Assembly> assembliesToInclude = new List <Assembly>(); assembliesToInclude.Add(typeof(Map).GetTypeInfo().Assembly); assembliesToInclude.Add(typeof(MapView).GetTypeInfo().Assembly); Xamarin.Forms.Forms.Init(e, assembliesToInclude); if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); }
protected override async void OnInitialized() { try { InitializeComponent(); ArcGISRuntimeEnvironment.SetLicense("runtimelite,1000,rud2450418794,none,2K0RJAY3FLBBP2ELJ051"); AppCenter.Start("android=9efaf29a-ff01-412f-abc1-0cdd26cdc592;ios=82ebcc8d-f204-4c29-87c1-8a106912da18", typeof(Crashes), typeof(Analytics)); base.Container.Resolve <ErrorManager>().IsEnabled = true; base.Container.Resolve <AnalyticsManager>().IsEnabled = true; await base.NavigationService.NavigateAsync("MainPage"); } catch (Exception) { } }
public MapViewModel() { ArcGISRuntimeEnvironment.Initialize(); var uri = new Uri("http://petr-divis.maps.arcgis.com/sharing/rest"); var portal = ArcGISPortal.CreateAsync(uri).Result; // once connected, get the license info from the portal for the current user var licenseInfo = portal.PortalInfo.LicenseInfo; // set the license using the static ArcGISRuntimeEnvironment class ArcGISRuntimeEnvironment.SetLicense(licenseInfo); var portalItem = PortalItem.CreateAsync(portal, "69fdcd8e40734712aaec34194d4b988c").Result; Map = new Map(portalItem); }
private void Application_Startup(object sender, StartupEventArgs e) { try { // Deployed applications must be licensed at the Lite level or greater. // See https://developers.arcgis.com/licensing for further details. // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed."); // Exit application this.Shutdown(); } }
//Timer timerMap; public Map() { //第一次加载时进行授权 if (_needInit) { try { ArcGISRuntimeEnvironment.ClientId = "uK0DxqYT0om1UXa9"; ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { Console.WriteLine("Unable to initialize the ArcGIS Runtime with the client ID provided: " + ex.Message); } } // ArcGISRuntimeEnvironment.ClientId = "uK0DxqYT0om1UXa9"; InitializeComponent(); }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { // Deployed applications must be licensed at the Basic level or greater (https://developers.arcgis.com/licensing). // To enable Basic level functionality set the Client ID property before initializing the ArcGIS Runtime. // ArcGISRuntimeEnvironment.ClientId = "<Your Client ID>"; // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // Standard level functionality can be enabled once the ArcGIS Runtime is initialized. // To enable Standard level functionality you must either: // 1. Allow the app user to authenticate with ArcGIS Online or Portal for ArcGIS then call the set license method with their license info. // ArcGISRuntimeEnvironment.License.SetLicense(LicenseInfo object returned from an ArcGIS Portal instance) // 2. Call the set license method with a license string obtained from Esri Customer Service or your local Esri distributor. // ArcGISRuntimeEnvironment.License.SetLicense("<Your License String or Strings (extensions) Here>"); this.InitializeComponent(); this.Suspending += OnSuspending; }
private async void Application_Startup(object sender, StartupEventArgs e) { log4net.Config.XmlConfigurator.Configure(); MaximoServiceLibrary.AppContext.maximoService.BASE_HOST = System.Configuration.ConfigurationManager.AppSettings["MaximoBaseUrl"]; MaximoServiceLibrary.AppContext.Log.Info($"BASE_HOST : { MaximoServiceLibrary.AppContext.maximoService.BASE_HOST}"); try { // Challenge the user for portal credentials (OAuth credential request for arcgis.com) try { //LicenseInfo.FromJson("{\"licenseString\":\"plv1qGVKC+Nq1nPxZhTCMc+I/bhdFqNX7Wkfszv6sjTcoiftoW0c8p0q/6JZ\"}"); var licenseKey = System.Configuration.ConfigurationManager.AppSettings["runtimeLicenseKey"]; ArcGISRuntimeEnvironment.SetLicense(licenseKey); } catch (Exception e2) { MaximoServiceLibrary.AppContext.Log.Error(e2.ToString()); } ArcGISRuntimeEnvironment.Initialize(); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "ArcGIS Runtime initialization failed.", MessageBoxButton.OK); MaximoServiceLibrary.AppContext.Log.Error(ex.ToString()); // Exit application this.Shutdown(); } AppDomain currentDomain = default(AppDomain); currentDomain = AppDomain.CurrentDomain; // Handler for unhandled exceptions. currentDomain.UnhandledException += GlobalUnhandledExceptionHandler; // Handler for exceptions in threads behind forms. System.Windows.Forms.Application.ThreadException += GlobalThreadExceptionHandler; }
public App() { //**************** // // Authentication: // Use of Esri location services, including basemaps and geocoding, requires either an ArcGIS identity or an API key. // For more information see https://links.esri.com/arcgis-runtime-security-auth. // // Licensing: // Production deployment of applications built with ArcGIS Runtime requires you to license ArcGIS Runtime functionality. // For more information see https://links.esri.com/arcgis-runtime-license-and-deploy. // //**************** // Initialize the ArcGIS Runtime before any components are created. ArcGISRuntimeEnvironment.Initialize(); // The root page of your application MainPage = new MapPage(); }