当前位置: 首页>>代码示例>>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;未经允许,请勿转载。