本文整理汇总了C#中App类的典型用法代码示例。如果您正苦于以下问题:C# App类的具体用法?C# App怎么用?C# App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
App类属于命名空间,在下文中一共展示了App类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Window_ECG
public Window_ECG(App app)
{
initMembers(app);
InitializeComponent();
initWindow();
initTabs();
}
开发者ID:Nefarin,项目名称:DadmProject,代码行数:7,代码来源:Window_ECGArchitecture.cs
示例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);
}
}
}
}
}
开发者ID:kahinke,项目名称:PingApp,代码行数:34,代码来源:UpdateNotifier.cs
示例3: Main
static void Main()
{
using (App game = new App())
{
game.Run();
}
}
开发者ID:Kitsune001,项目名称:Samples,代码行数:7,代码来源:Program.cs
示例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);
//}
}
开发者ID:sealuzh,项目名称:PersonalAnalytics,代码行数:27,代码来源:App.xaml.cs
示例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;
}
开发者ID:Koushi009,项目名称:SWGEmuLauncher,代码行数:25,代码来源:GlobalAppData.cs
示例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();
}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:App.cs
示例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
}
开发者ID:DOPS-CCI,项目名称:CCI_project,代码行数:25,代码来源:App.cs
示例8: Main
static void Main()
{
ServiceFactory.StartupService.Run();
var app = new App();
ServiceFactory.ResourceService.AddResource(typeof(UIBehavior).Assembly, "Themes/Styles.xaml");
app.Run();
}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:7,代码来源:App.cs
示例9: MainPage
public MainPage()
{
this.InitializeComponent();
this.DataContext = viewModel = App.Current;
initSocket("http://heartrate.azurewebsites.net");
}
开发者ID:dwcares,项目名称:heartrate,代码行数:7,代码来源:MainPage.xaml.cs
示例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();
}
}
开发者ID:kaushik1605,项目名称:sample_DotNet,代码行数:34,代码来源:Program.cs
示例11: AccountInfo
public AccountInfo() {
this.InitializeComponent();
myApp = (Application.Current) as App;
dc = new DataContext();
a = dc.getAccount(myApp._accountId);
}
开发者ID:AndrejLavrionovic,项目名称:MobAppProject,代码行数:7,代码来源:AccountInfo.xaml.cs
示例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;
}
开发者ID:jerryhuangn,项目名称:cs340project,代码行数:26,代码来源:NetworkGUI.cs
示例13: InitAppRuntime
protected static void InitAppRuntime()
{
ManualConfigSource configSource = new ManualConfigSource { ObjectContainer = typeof(UnityObjectContainer) };
application = AppRuntime.Create(configSource);
application.AppInitEvent += application_AppInitEvent;
application.Start();
}
开发者ID:vebin,项目名称:BDDD,代码行数:7,代码来源:Global.asax.cs
示例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;
}
}
开发者ID:RigsOfRods,项目名称:ror-updater,代码行数:25,代码来源:ChoicePage.xaml.cs
示例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();
}
开发者ID:jammerxd,项目名称:NOWPLAYINGVLC,代码行数:28,代码来源:Program.cs
示例16: Same_model_to_save_twice_will_update_the_existed_values
public void Same_model_to_save_twice_will_update_the_existed_values()
{
var app = new App();
app.Id = "Same_model_to_save_twice_will_update_the_existed_values";
app.Name = "SameAppToSaveTwice";
app.Price = 111;
using (var redis = new RedisService())
{
var exited = redis.Get<App>(app.Id);
redis.Delete<App>(exited);
redis.Add<App>(app);
app.Name = "Name1";
redis.Add<App>(app);
var getApp = redis.Get<App>(app.Id);
Assert.NotEmpty(getApp.Name);
redis.Delete<App>(exited);
}
}
开发者ID:chengchencc,项目名称:Redis-Mapper,代码行数:25,代码来源:RedisMapperTest.cs
示例17: UStanje
public void UStanje(App.Stanje stanje)
{
buttonDodaj.IsEnabled = stanje.Equals(App.Stanje.Detaljno) || stanje.Equals(App.Stanje.Osnovno);
buttonIzmeni.IsEnabled = stanje.Equals(App.Stanje.Detaljno);
buttonObrisi.IsEnabled = stanje.Equals(App.Stanje.Detaljno);
buttonOsvezi.IsEnabled = stanje.Equals(App.Stanje.Detaljno);
}
开发者ID:vodolijabg,项目名称:LS,代码行数:7,代码来源:NosilacGrupe.xaml.cs
示例18: App
public App()
{
Instance = this;
Directory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string stringsFile = Path.Combine(Directory, "Styles", _DefaultStyle);
LoadStyleDictionaryFromFile(stringsFile);
}
开发者ID:soufatn,项目名称:Windows8-XMPP-Client,代码行数:7,代码来源:App.xaml.cs
示例19: Main
public static void Main(string[] args)
{
if (SingleInstance<App>.InitializeAsFirstInstance(Unique))
{
string filename;
if (args != null && args.Length == 1)
{
if (System.IO.File.Exists(System.IO.Path.GetFullPath(args[0])))
{
filename = System.IO.Path.GetFileName(System.IO.Path.GetFullPath(args[0]));
if (filename.EndsWith("osapp", StringComparison.Ordinal))
{
// its a plugin package
PluginInstallerHelper pInst = new PluginInstallerHelper();
pInst.InstallPlugin(System.IO.Path.GetFullPath(args[0]));
}
}
}
else
{
var application = new App();
application.InitializeComponent();
application.Run();
}
// Allow single instance code to perform cleanup operations
SingleInstance<App>.Cleanup();
}
}
开发者ID:Kiwiroo,项目名称:Open-Source-Automation,代码行数:32,代码来源:MainWindow.xaml.cs
示例20: Main
public static void Main()
{
// Set the image file's build action to "Resource" and "Never copy" for this to work.
if (!Debugger.IsAttached)
{
App.SplashScreen = new SplashScreen("Images/TxFlag_256.png");
App.SplashScreen.Show(false, true);
}
// Set up FieldLog
FL.AcceptLogFileBasePath();
FL.RegisterPresentationTracing();
TaskHelper.UnhandledTaskException = ex => FL.Critical(ex, "TaskHelper.UnhandledTaskException", true);
// Keep the setup away
GlobalMutex.Create("Unclassified.TxEditor");
App.InitializeSettings();
// Make sure the settings are properly saved in the end
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
// Setup logging
//Tx.LogFileName = "tx.log";
//Tx.LogFileName = "";
//Environment.SetEnvironmentVariable("TX_LOG_UNUSED", "1", EnvironmentVariableTarget.User);
//Environment.SetEnvironmentVariable("TX_LOG_UNUSED", null, EnvironmentVariableTarget.User);
InitializeLocalisation();
App app = new App();
app.InitializeComponent();
app.Run();
}
开发者ID:uxoricide,项目名称:TxTranslation,代码行数:34,代码来源:Program.cs
注:本文中的App类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论