本文整理汇总了C#中LaunchingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LaunchingEventArgs类的具体用法?C# LaunchingEventArgs怎么用?C# LaunchingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LaunchingEventArgs类属于命名空间,在下文中一共展示了LaunchingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
const string TASK_NAME = "GPS_TesteTask";
var scheduleTask = ScheduledActionService.Find(TASK_NAME);
if (scheduleTask == null)
{
scheduleTask = new PeriodicTask(TASK_NAME)
{
Description = "Teste de GPS em background"
};
ScheduledActionService.Add(scheduleTask);
}
else if (scheduleTask.IsEnabled)
{
ScheduledActionService.Remove(TASK_NAME);
ScheduledActionService.Add(scheduleTask);
}
#if DEBUG
ScheduledActionService.LaunchForTest(TASK_NAME, TimeSpan.FromSeconds(10));
#endif
// inicializar o GPS uma vez na thread principal
new GeoCoordinateWatcher(GeoPositionAccuracy.High).Start();
}
示例2: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
var r = DependencyResolver.Current;
r.RegisterService<IJsonSerializer, JsonSerializer>();
r.RegisterService<IRestClient>(t => new JsonClient(new HttpClient(), t.GetService<IJsonSerializer>()));
r.RegisterService<BingClient>(t => new BingClient(BingKey.AppKey, t.GetService<IRestClient>()));
}
示例3: Application_Launching
// 应用程序启动(例如,从“开始”菜单启动)时执行的代码
// 此代码在重新激活应用程序时不执行
private void Application_Launching(object sender, LaunchingEventArgs e)
{
Debug.WriteLine(String.Format("{0}-appLaunching被执行",DateTime.Now.ToLongTimeString()));
SetMapUri();
appData = "hello~!";
}
示例4: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
LittleWatson.CheckForPreviousException("Todo.txt Windows Phone 7 error report",
"[email protected]");
Messenger.Default.Send(new ApplicationReadyMessage());
Messenger.Default.Send(new ApplicationStartedMessage());
}
示例5: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
if (!App.ViewModel.IsDataLoaded)
{
App.ViewModel.LoadData();
}
}
示例6: Application_Launching
// (たとえば、[スタート] メニューから) アプリケーションが起動するときに実行されるコード
// このコードは、アプリケーションが再アクティブ化済みの場合には実行されません
private void Application_Launching(object sender, LaunchingEventArgs e)
{
// ".txt"ファイルの数を取得する
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
string[] filenames = isf.GetFileNames();
int numText = 0;
foreach (string file in filenames)
{
if (".txt" == System.IO.Path.GetExtension(file).ToLower())
{
numText++;
}
}
isf.Dispose();
// ".txt"ファイルの数が0ならデフォルトファイルを作る
if (numText == 0)
{
// Todo:デフォルトの文字列の内容
//string content = "8:00,東京\n9:00,神奈川\n21:44,大阪\n23:30,New York\n";
string content = "6:15,普通 東京\n6:26,快速 高崎\n7:05,普通 籠原\n8:05,普通 東京\n9:02,普通 東京\n10:08,快速 東京\n11:03,普通 東京\n12:01,普通 東京\n13:04,普通 東京\n14:03,普通 東京\n15:01,普通 東京\n16:05,特急 東京\n17:07,普通 東京\n18:04,快速 東京\n19:06,普通 東京\n20:04,快速 籠原\n21:04,普通 東京\n22:04,普通 東京\n23:00,快速 籠原\n";
SaveFile("example.txt", content);
}
// ListBoxの表示をクリアする
// Todo:各ページのコントロールにはどうやってアクセスする?
// MainPageクラスがpublicだから、どこかに宣言を書けば使えると思うけど。。
// listBoxTimeTable.Items.Clear();
}
示例7: Application_Launching
// 应用程序启动(例如,从“开始”菜单启动)时执行的代码
// 此代码在重新激活应用程序时不执行
private void Application_Launching(object sender, LaunchingEventArgs e)
{
//获取基本信息
//Config. InitializeInfo( );
//检查网络状态
//Config. CheckNetworkState( );
}
示例8: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
//crucial, checks to see if database exists and is proper version (up to date)
//if it isn't copies the database to the local device.
IsolatedStorage.CheckIfDBFileUpdateNeeded();
LicenseService.RefreshLicenseCheckNeeded = true; //clear the license cache so a full check is performed the first time it's needed
}
示例9: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private async void Application_Launching(object sender, LaunchingEventArgs e)
{
ThemeManager.ToDarkTheme();
await ReviewNotification.InitializeAsync();
if (NetworkInterface.GetIsNetworkAvailable() && NetworkInterface.NetworkInterfaceType == NetworkInterfaceType.Wireless80211)
{
try
{
var upd = await CheckIsThereUpdate();
if (upd)
{
var msg = new MessagePrompt { Title = AppResources.UpdateTitle, Message = AppResources.UpdateMessage, IsCancelVisible = true };
msg.Completed += msg_Completed;
msg.Show();
}
}
catch (Exception)
{
}
}
}
示例10: OnLaunch
protected override void OnLaunch(object sender, LaunchingEventArgs e)
{
base.OnLaunch(sender, e);
//Flurry
FlurryWP8SDK.Api.StartSession("G7N9WKXG4MSTTBQRZQMY");
ApplicationUsageHelper.Init("0.5");
ThemeManager.OverrideOptions = ThemeManagerOverrideOptions.None;
ThemeManager.ToLightTheme();
ThemeManager.SetAccentColor((System.Windows.Media.Color)Application.Resources["WW.Color.Accent"]);
notificationPullTimer = new Timer(async (state) =>
{
bool isAuthenticated = IoC.Get<AppSettings>().IsAuthenticated;
if (isAuthenticated)
{
UsersRestService usersRestService = IoC.Get<UsersRestService>();
try
{
NotificationsCountResponse response = await usersRestService.NotificationsCount();
IoC.Get<AppSettings>().NotificationsCount = response.Count;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("Update notification failed. " + ex.Message);
}
}
}, null, 0, 10 * 1000);
}
示例11: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
Utils.Trace("Application Launching");
TravelReportInfo trf = null;
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
Utils.ListStorageFiles();
if (isf.FileExists(_fileName))
{
using (IsolatedStorageFileStream fs = isf.OpenFile(_fileName, System.IO.FileMode.Open))
{
XmlSerializer ser = new XmlSerializer(typeof(TravelReportInfo));
object obj = ser.Deserialize(fs);
if (null != obj && obj is TravelReportInfo)
trf = obj as TravelReportInfo;
else
trf = new TravelReportInfo();
}
}
else
trf = new TravelReportInfo();
}
RootFrame.DataContext = trf;
}
示例12: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
// A unique name for the task.
var taskName = "Contoso Cookbook Community Updates";
// If the task exists
var oldTask = ScheduledActionService.Find(taskName) as PeriodicTask;
if (oldTask != null)
{
ScheduledActionService.Remove(taskName);
}
// Create the Task
PeriodicTask task = new PeriodicTask(taskName);
// Description is required
task.Description = "This looks for data on recipes shared by your community on Contoso Cookbook";
// Add it to the service to execute
ScheduledActionService.Add(task);
// For debugging
ScheduledActionService.LaunchForTest(taskName, TimeSpan.FromMilliseconds(5000));
}
示例13: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
var settings = IsolatedStorageSettings.ApplicationSettings;
var values = settings.Values;
// bool isTask=false;
bool isClass = false;
foreach (var temp in values)
{
// if (temp is ObservableCollection<Task>)
// isTask = true;
if (temp is ObservableCollection<Class>)
isClass = true;
}
// if (!isTask)
//{
// settings.Add("taskCollection", new ObservableCollection<Task>());
//}
if (!isClass)
{
settings.Add("classCollection", new ObservableCollection<Class>());
}
isTrial = licenseInfo.IsTrial();
}
示例14: Application_Launching
// Code to execute when the application is launching (eg, from Start)
// This code will not execute when the application is reactivated
private void Application_Launching(object sender, LaunchingEventArgs e)
{
var ser = new so11::MySerializer();
SO11895998.Foo foo = new SO11895998.Bar {Name = "abc", Value = 4};
var clone = (SO11895998.Bar) ser.DeepClone(foo);
Debug.Assert(clone.Name == "abc");
Debug.Assert(clone.Value == 4);
clone = (SO11895998.Bar)Serializer.DeepClone(foo);
Debug.Assert(clone.Name == "abc");
Debug.Assert(clone.Value == 4);
Execute();
//try
//{
// var blob = Resource1.nwind_proto;
// using (var ms = new MemoryStream(blob))
// {
// var db = (DAL.DatabaseCompat)new MySerializer().Deserialize(ms, null, typeof(DAL.DatabaseCompat));
// int i = db.Orders.Count;
// }
//}
//catch (Exception ex)
//{
// Debug.WriteLine(ex.Message);
//}
}
示例15: Application_Launching
// 应用程序启动(例如,从“开始”菜单启动)时执行的代码
// 此代码在重新激活应用程序时不执行
private void Application_Launching(object sender, LaunchingEventArgs e)
{
// 加载背景图片
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
BitmapImage defaultBackground = new BitmapImage(new Uri("/Assets/Background.jpg", UriKind.Relative));
ImageBrush defaultBrush = new ImageBrush();
defaultBrush.ImageSource = defaultBackground;
defaultBrush.Opacity = 0.7;
App.Current.Resources.Add("DefaultBackgroundBrush", defaultBrush);
BitmapImage background = null;
if (isf.FileExists("Background"))
{
using (IsolatedStorageFileStream file = isf.OpenFile("Background", System.IO.FileMode.Open))
{
background = new BitmapImage();
background.SetSource(file);
}
}
else
{
background = defaultBackground;
}
ImageBrush brush = new ImageBrush();
brush.ImageSource = background;
brush.Opacity = 0.7;
App.Current.Resources.Add("BackgroundBrush", brush);
}
}