當前位置: 首頁>>代碼示例>>C#>>正文


C# ActivatedEventArgs類代碼示例

本文整理匯總了C#中ActivatedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# ActivatedEventArgs類的具體用法?C# ActivatedEventArgs怎麽用?C# ActivatedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ActivatedEventArgs類屬於命名空間,在下文中一共展示了ActivatedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnComponentActivated

        static void OnComponentActivated(object sender, ActivatedEventArgs<object> args)
        {
            //  nothing we can do if a null event argument is passed (should never happen)
            if (args == null)
            {
                return;
            }

            //  nothing we can do if instance is not a handler
            var handler = args.Instance as IHandle;
            if (handler == null)
            {
                return;
            }

            //  subscribe to handler, and prepare unsubscription when it's time for disposal

            var context = args.Context;
            var lifetimeScope = context.Resolve<ILifetimeScope>();
            var eventAggregator = lifetimeScope.Resolve<IEventAggregator>();

            eventAggregator.Subscribe(handler);

            var disposableAction = new DisposableAction(() =>
            {
                eventAggregator.Unsubscribe(handler);
            });

            lifetimeScope.Disposer.AddInstanceForDisposal(disposableAction);
        }
開發者ID:brendankowitz,項目名稱:Caliburn.Micro.Autofac,代碼行數:30,代碼來源:EventAggregationAutoSubscriptionModule.cs

示例2: Application_Activated

 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (!App.ViewModel.IsDataLoaded)
     {
         App.ViewModel.LoadData();
     }
 }
開發者ID:jojozhuang,項目名稱:Projects,代碼行數:9,代碼來源:App.xaml.cs

示例3: Application_Activated

 // アプリケーションがアクティブになった (前麵に表示された) ときに実行されるコード
 // このコードは、アプリケーションの初回起動時には実行されません
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (!e.IsApplicationInstancePreserved)
     {
         SearchHubApplication.Current.Load();
     }
 }
開發者ID:runceel,項目名稱:WP7Apps,代碼行數:9,代碼來源:App.xaml.cs

示例4: Application_Activated

        // Code to execute when the application is activated (brought to foreground)
        // This code will not execute when the application is first launched
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            if (!e.IsApplicationInstancePreserved)
            {
                //Trace the event for debug purposes
                Utils.Trace("Application Activated");

                //Create new data object variable
                TravelReportInfo travelReportInfo = null;

                //Try to locate previous data in transient state of the application
                if (PhoneApplicationService.Current.State.ContainsKey("UnsavedTravelReportInfo"))
                {
                    //If found, initialize the data variable and remove in from application's state
                    travelReportInfo = PhoneApplicationService.Current.State["UnsavedTravelReportInfo"] as TravelReportInfo;

                    PhoneApplicationService.Current.State.Remove("UnsavedTravelReportInfo");
                }

                //If found set it as a DataContext for all the pages of the application
                //An application is not guaranteed to be activated after it has been tombstoned,
                //thus if not found create new data object
                if (null != travelReportInfo)
                    RootFrame.DataContext = travelReportInfo;
                else
                    RootFrame.DataContext = new TravelReportInfo();
            }
        }
開發者ID:WindowsPhone-8-TrainingKit,項目名稱:HOL-WPApplicationLifecycle,代碼行數:30,代碼來源:App.xaml.cs

示例5: Application_Activated

 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
    
     if (!e.IsApplicationInstancePreserved)
     {
         PhoneApplicationService.Current.State["newpage"] = "true";              // adding newpage value for checking it later
         if (PhoneApplicationService.Current.State.ContainsKey("hasspass"))      // Checking if Isolated storage has key notelistiso
         {
             Settings.HashedPassword = (PhoneApplicationService.Current.State["hasspass"] as string); // Retriving Notes from Isolated storage
         }
         if (PhoneApplicationService.Current.State.ContainsKey("passhint"))      // Checking if Isolated storage has key notelistiso
         {
             Settings.PasswordHint = (PhoneApplicationService.Current.State["passhint"] as string); // Retriving Notes from Isolated storage
         }
         if (PhoneApplicationService.Current.State.ContainsKey("pass"))      // Checking if Isolated storage has key notelistiso
         {
             Settings.Password = (PhoneApplicationService.Current.State["pass"] as string); // Retriving Notes from Isolated storage
         }
         if (PhoneApplicationService.Current.State.ContainsKey("saltval"))      // Checking if Isolated storage has key notelistiso
         {
             Settings.Salt = (PhoneApplicationService.Current.State["saltval"] as byte[]); // Retriving Notes from Isolated storage
         }
         if (PhoneApplicationService.Current.State.ContainsKey("notestate")) // Checking if State contains key notestate
         {
             Settings.NotesList = (PhoneApplicationService.Current.State["notestate"] as ObservableCollection<Note>); // Retriving Notes from State
         }
     }
 }
開發者ID:krishnadevalla,項目名稱:EncryptNotes,代碼行數:30,代碼來源:App.xaml.cs

示例6: registration_Activated

 void registration_Activated(object sender, ActivatedEventArgs<object> e)
 {
     if (e.Instance.GetType().GetInterfaces().Any(x=>x.Name.Contains("IHandle")))
     {
         ContainerFactory.Container.Resolve<IEventAggregator>().Subscribe(e.Instance);
     }
 }
開發者ID:nulltoken,項目名稱:PlatformInstaller,代碼行數:7,代碼來源:EventAggregationSubscriptionModule.cs

示例7: Application_Activated

 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (PhoneApplicationService.Current.State.ContainsKey("AccountDB"))
     {
         this.WorkingDB = (AccountDB)PhoneApplicationService.Current.State["AccountDB"];
     }
 }
開發者ID:ReuleDK,項目名稱:g-authenticator-wp7,代碼行數:9,代碼來源:App.xaml.cs

示例8: Application_Activated

 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (Debugger.IsAttached)
     {
         Log.Level = Log.LogLevel.Verbose;
     }
 }
開發者ID:PDF417,項目名稱:pdf417-windows-phone,代碼行數:9,代碼來源:App.xaml.cs

示例9: OnComponentRegistrationOnActivated

 private void OnComponentRegistrationOnActivated(object sender, ActivatedEventArgs<object> activation_event)
 {
     // compose by batch to allow for recomposition
     var batch = new CompositionBatch();
     batch.AddPart(activation_event.Instance);
     _mefContainer.Compose(batch);
 }
開發者ID:brunomlopes,項目名稱:ILoveLucene,代碼行數:7,代碼來源:SatisfyMefImports.cs

示例10: Application_Activated

 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (!e.IsApplicationInstancePreserved)
     {
         ApplicationUsageHelper.OnApplicationActivated();
     }
 }
開發者ID:jel-massih,項目名稱:DevelopFeed,代碼行數:7,代碼來源:App.xaml.cs

示例11: Application_Activated

        private void Application_Activated(
            object sender, ActivatedEventArgs e)
        {
            AnalyticsTracker.Track(
                "start", "activated");

            if (e.IsApplicationInstancePreserved)
            {
                var global = GlobalPassHandler.Instance;
                global.Reset();

                if (global.ShouldPromptGlobalPass)
                {
                    var root = RootFrame;
                    root.Dispatcher.BeginInvoke(() =>
                        root.Navigate(Navigation.GetPathTo
                            <GlobalPassVerify>()));
                }

                return;
            }

            ThemeData.Initialize();
            Cache.RestoreCache(RootFrame.Dispatcher);
        }
開發者ID:rgmills,項目名稱:7Pass,代碼行數:25,代碼來源:App.xaml.cs

示例12: Application_Activated

 // アプリケーションがアクティブになった (前麵に表示された) ときに実行されるコード
 // このコードは、アプリケーションの初回起動時には実行されません
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (!e.IsApplicationInstancePreserved)
     {
         TenSecGameApplication.Context.Load();
     }
 }
開發者ID:runceel,項目名稱:WP7Apps,代碼行數:9,代碼來源:App.xaml.cs

示例13: Application_Activated

 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if(e.IsApplicationInstancePreserved)
         System.Diagnostics.Debug.WriteLine("Activated...");
     else
         System.Diagnostics.Debug.WriteLine("Recovered from tombstoning, Activated...");
 }
開發者ID:whrxiao,項目名稱:Windows-Phone-7-In-Action,代碼行數:9,代碼來源:App.xaml.cs

示例14: Application_Activated

 // Code to execute when the application is activated (brought to foreground)
 // This code will not execute when the application is first launched
 private void Application_Activated(object sender, ActivatedEventArgs e)
 {
     if (e.IsApplicationInstancePreserved == false)
     {
         InitializeSDK();
     }
 }
開發者ID:super-ala,項目名稱:vk-windowsphone-sdk,代碼行數:9,代碼來源:App.xaml.cs

示例15: Current_Activated

 void Current_Activated(object sender, ActivatedEventArgs e)
 {
     if (deactivatedState != null)
     {
         player.RestoreMediaState(deactivatedState);
     }
 }
開發者ID:bondarenkod,項目名稱:pf-arm-deploy-error,代碼行數:7,代碼來源:MainPage.xaml.cs


注:本文中的ActivatedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。