本文整理汇总了C#中App类的典型用法代码示例。如果您正苦于以下问题:C# App类的具体用法?C# App怎么用?C# App使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
App类属于命名空间,在下文中一共展示了App类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Window_ECG
public Window_ECG(App app)
{
initMembers(app);
InitializeComponent();
initWindow();
initTabs();
}
示例2: SendMail
private void SendMail(App app, AppUpdate update) {
ICollection<AppTrack> tracks = repository.AppTrack.RetrieveByApp(app.Id);
foreach (AppTrack track in tracks) {
User user = repository.User.Retrieve(track.User);
if (track.RequireNotification(user, update.Type)) {
MailMessage message = CreateMailMessage(user, app, update);
if (settings.Debug) {
StringBuilder text = new StringBuilder()
.AppendLine("Send mail:")
.AppendLine("From: " + message.From.Address)
.AppendLine("To: " + message.To[0].Address)
.AppendLine("Subject: " + message.Subject)
.AppendLine(message.Body);
logger.Trace(text.ToString());
}
else {
try {
smtp.Send(message);
logger.Trace(
"Sent mail to user {0}-{1} via {2} for update{3}",
user.Id, user.Username, user.Email, update.Id
);
}
catch (SmtpFailedRecipientException) {
logger.Warn("Failed to send email to {0}, address may be invalid", user.Email);
}
catch (Exception ex) {
logger.ErrorException("Encountered unexpected exception when send email", ex);
}
}
}
}
}
示例3: Main
static void Main()
{
using (App game = new App())
{
game.Run();
}
}
示例4: Main
public static void Main()
{
// before actually starting up, check if there is already an instance running
if (SingleInstance<App>.InitializeAsFirstInstance(UniqueAppName))
{
var application = new App();
application.InitializeComponent();
application.Run();
// Allow single instance code to perform cleanup operations
SingleInstance<App>.Cleanup();
// then do the rest
if (null == Current)
{
new Application();
}
Current.DispatcherUnhandledException += App_DispatcherUnhandledException;
Current.SessionEnding += App_SessionEnding;
}
//else
//{
// var msg = "An instance of PersonalAnalytics was already running. Access it from the task bar on the bottom right of your screen.";
// MessageBox.Show("Info", msg);
//}
}
示例5: initalize
public static bool initalize(App app)
{
GlobalAppData.patchInformation = null;
GlobalAppData.app = app;
settingsPath = getUserProfilePath();
if (settings == null)
{
String f = settingsFile;
String d = settingsPath;
if (!Directory.Exists(settingsPath))
{
DirectoryInfo dInfo = Directory.CreateDirectory(settingsPath);
if (!dInfo.Exists)
{
MessageBox.Show("Failed to create profile directory: " + settingsPath);
return false;
}
}
loadSettings();
return true;
}
return true;
}
示例6: Main
static void Main()
{
App app = new App();
Current.Resources.MergedDictionaries.Add(LoadComponent(
new Uri("Controls;component/Themes/Styles.xaml", UriKind.Relative)) as ResourceDictionary);
app.Run();
}
示例7: Main
static void Main()
{
App app = new App();
#if !DEBUG
Console.WriteLine("NOT in DEBUG mode");
try
{
app.Run(new MainWindow());
}
catch (Exception e)
{
ErrorWindow ew = new ErrorWindow();
if (e.StackTrace != null)
ew.Message = "In " + e.TargetSite + ": " + e.Message +
";\r\n" + e.StackTrace;
else
ew.Message = "In EEGArtifactEditor: " + e.Message;
ew.ShowDialog();
}
#else
Console.WriteLine("In DEBUG mode");
app.Run(new MainWindow());
#endif
}
示例8: Main
static void Main()
{
ServiceFactory.StartupService.Run();
var app = new App();
ServiceFactory.ResourceService.AddResource(typeof(UIBehavior).Assembly, "Themes/Styles.xaml");
app.Run();
}
示例9: MainPage
public MainPage()
{
this.InitializeComponent();
this.DataContext = viewModel = App.Current;
initSocket("http://heartrate.azurewebsites.net");
}
示例10: StartUp
private static void StartUp()
{
var isFirstInstance = false;
for (var i = 1; i <= MAXTRIES; i++)
{
try
{
isFirstInstance = SingleInstance<App>.InitializeAsFirstInstance("18980929-1342-4467-bc3d-37b0d13fa938");
break;
}
catch (RemotingException)
{
break;
}
catch (Exception)
{
if (i == MAXTRIES)
{
return;
}
}
}
if (isFirstInstance)
{
var application = new App();
application.InitializeComponent();
application.Run();
// Allow single instance code to perform cleanup operations
SingleInstance<App>.Cleanup();
}
}
示例11: AccountInfo
public AccountInfo() {
this.InitializeComponent();
myApp = (Application.Current) as App;
dc = new DataContext();
a = dc.getAccount(myApp._accountId);
}
示例12: NetworkGUI
public NetworkGUI()
{
HypeerWeb = App.GetApp("HypeerWeb");
InitializeComponent();
IPAddress addr;
string address = TextPrompt.Show("Which address to listen on?", "127.0.0.1");
if (address == null || !IPAddress.TryParse(address, out addr))
{
throw new Exception("ARGH");
return;
}
int iPort;
string port = TextPrompt.Show("Which port to listen on?", "30000");
if (port == null || !int.TryParse(port, out iPort) || iPort < 1000 || iPort > (1 << 16))
{
throw new Exception("ARGH");
return;
}
HypeerWeb.Network.Listen(new IPEndPoint(addr, iPort));
lbl_ip.Text = port;
}
示例13: InitAppRuntime
protected static void InitAppRuntime()
{
ManualConfigSource configSource = new ManualConfigSource { ObjectContainer = typeof(UnityObjectContainer) };
application = AppRuntime.Create(configSource);
application.AppInitEvent += application_AppInitEvent;
application.Start();
}
示例14: ChoicePage
public ChoicePage(App MainThread)
{
InitializeComponent();
mainApp = MainThread;
mainApp.LOG("Info| Choise menu opened.");
if (mainApp.b_DevBuilds)
info_label.Content = "You have dev builds enabled! You'll be updated to unstable test builds if you continue!";
//TODO: Install button is disabled for the moment.
//Repair game is also update game, both do the same, both do their work.
if (mainApp.str_local_version != mainApp.str_online_version || mainApp.str_online_devbuild != mainApp.str_local_devbuild)
{
button_choise1.IsEnabled = true;
button_choise2.IsEnabled = false;
button_choise3.IsEnabled = false;
}
else
{
info_label.Content = "Your game is up to date!";
button_choise3.IsEnabled = true;
button_choise1.IsEnabled = false;
button_choise2.IsEnabled = false;
}
}
示例15: Main
public static void Main(string[] args)
{
Assembly myAssemblyList = Assembly.GetExecutingAssembly();
string[] myResources = myAssemblyList.GetManifestResourceNames();
foreach (string resource in myResources)
{
if (resource.EndsWith(".dll"))
{
string[] temp_name = resource.Split('.');
List<String> temp_lst = new List<string>();
temp_lst = temp_name.ToList();
temp_lst.RemoveAt(0);
string filename = "";
foreach (string part in temp_lst)
{
filename += part + ".";
}
EmbeddedAssembly.Load(resource, filename);
}
}
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
var app = new App();
app.InitializeComponent();
app.Run();
}