本文整理汇总了C#中System.App类的典型用法代码示例。如果您正苦于以下问题:C# App类的具体用法?C# App怎么用?C# App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
App类属于System命名空间,在下文中一共展示了App类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdamNavigator
public AdamNavigator(SxcInstance sexy, App app, PortalSettings ps, Guid entityGuid, string fieldName)
{
EntityBase = new EntityBase(sexy, app, ps, entityGuid, fieldName);
Manager = new AdamManager(ps.PortalId, app);
if (!Exists)
return;
var f = Manager.Get(Root) as FolderInfo;
if (f == null)
return;
PortalID = f.PortalID;
FolderPath = f.FolderPath;
MappedPath = f.MappedPath;
StorageLocation = f.StorageLocation;
IsProtected = f.IsProtected;
IsCached = f.IsCached;
FolderMappingID = f.FolderMappingID;
LastUpdated = f.LastUpdated;
FolderID = f.FolderID;
DisplayName = f.DisplayName;
DisplayPath = f.DisplayPath;
IsVersioned = f.IsVersioned;
KeyID = f.KeyID;
ParentID = f.ParentID;
UniqueId = f.UniqueId;
VersionGuid = f.VersionGuid;
WorkflowID = f.WorkflowID;
// IAdamItem interface properties
Name = DisplayName;
}
示例2: Main
public static void Main(string[] args)
{
var app = new App { ShutdownMode = ShutdownMode.OnLastWindowClose };
app.InitializeComponent();
var container = new Container(x=> x.AddRegistry<AppRegistry>());
var factory = container.GetInstance<TraderWindowFactory>();
var window = factory.Create(true);
container.Configure(x => x.For<Dispatcher>().Add(window.Dispatcher));
//run start up jobs
var priceUpdater = container.GetInstance<TradePriceUpdateJob>();
window.Show();
app.Resources.Add(SystemParameters.ClientAreaAnimationKey, null);
app.Resources.Add(SystemParameters.MinimizeAnimationKey, null);
app.Resources.Add(SystemParameters.UIEffectsKey, null);
app.Run();
}
示例3: MeasurementForm
public MeasurementForm(Treatment treatment, SmileFile file, MainWindow m)
{
InitializeComponent();
app = System.Windows.Application.Current as App;
Mantooth = new List<MeasurementTeeth>();
Autotooth = new List<MeasurementTeeth>();
DB = DentalSmileDBFactory.GetInstance();
this.mw = m;
//TODO: DB.User = app.user.UserId;
measurement = new Measurement();
string treatment_id = treatment.Id;
if (treatment_id == null)
{
treatment_id = treatment.RefId;
}
measurement.Treatment = treatment_id;
measurement.Patient = treatment.Patient.Id;
measurement.Pfile = file.Id;
string measurement_id = checkPreviousData(file.Id) ;
if(measurement_id !=null)
{ LoadMeasurementGrid(measurement_id); }
}
示例4: DelayedOptimizeAndEditPage
/// <summary>
/// Initializes a new instance of the DelayedOptimizeAndEditPage class.
/// </summary>
/// <param name="application">Reference to the current application object.</param>
public DelayedOptimizeAndEditPage(App application)
{
Debug.Assert(application != null);
_application = application;
_application.ApplicationInitialized += _ApplicationApplicationInitialized;
}
示例5: Main
static void Main()
{
using (var mutex = new Mutex(false, mutex_id))
{
var hasHandle = false;
try
{
try
{
hasHandle = mutex.WaitOne(5000, false);
if (hasHandle == false) return; //another instance exist
}
catch (AbandonedMutexException)
{
// Log the fact the mutex was abandoned in another process, it will still get aquired
}
App app = new App();
app.MainWindow = new MainWindow();
app.Run();
}
finally
{
if (hasHandle)
mutex.ReleaseMutex();
}
}
}
示例6: FullTest
public void FullTest()
{
// ChainOfResponsibilityの作成
var button = new Button(null, RequestNumber.BUTTON);
var dialog = new Dialog(button, RequestNumber.DIALOG);
var app = new App(dialog, RequestNumber.APP);
Handler handler = app;
string result = "";
// ボタン処理
result = handler.HandleRequest(RequestNumber.BUTTON);
Assert.AreEqual("Button で処理されました", result);
// ダイアログ処理
result = handler.HandleRequest(RequestNumber.DIALOG);
Assert.AreEqual("Dialog で処理されました", result);
// アプリ処理
result = handler.HandleRequest(RequestNumber.APP);
Assert.AreEqual("App で処理されました", result);
// 何も処理がない
result = handler.HandleRequest(-1);
Assert.AreEqual("処理がみつかりませんでした。", result);
}
示例7: Main
static void Main(string[] args)
{
if (args.Length == 0)
{
App app = new App();
app.MainWindow = new MainWindow();
app.MainWindow.Show();
app.Run();
}
else
{
InitializeParameterSet();
// now we came into command line mode.
if (args[0] == "/?" || args[0] == "/h")
{
PrintHelp();
}
else
{
ParseParameter(args);
if (!ParasAllSet())
{
PrintHelp();
}
else
{
}
}
}
}
示例8: Requests_ParallelRequests
public void Requests_ParallelRequests()
{
var expectedResponse = "Hello World";
var app = new App();
app.AddStaticStringView("/", (c) => expectedResponse);
Action InnerTest = () =>
{
var clientThreads = new Thread[10];
for (int i = 0; i < 10; i++)
{
clientThreads[i] = new Thread(() =>
{
var client = new WebClient();
var actualResponse = client.DownloadString(TestUtils.AppPrefix);
Assert.AreEqual(expectedResponse, actualResponse);
});
}
for (int i = 0; i < 10; i++)
clientThreads[i].Start();
for (int i = 0; i < 10; i++)
clientThreads[i].Join();
};
// First, test without async request processing
app.EnableAsyncProcessing = false;
TestUtils.AppTest(app, InnerTest);
app.EnableAsyncProcessing = true;
TestUtils.AppTest(app, InnerTest);
}
示例9: Main
static void Main(string[] args)
{
App app = new App();
app.Run();
Console.ReadLine();
}
示例10: Main
/// <summary>
/// Program entry point.
/// </summary>
/// <param name="args">The program arguments.</param>
static void Main(string[] args)
{
InitializeLogging();
var builder = new ContainerBuilder();
builder.RegisterModule<LocatorModule>();
builder.RegisterModule<CoreModule>();
builder.RegisterModule<DependenciesModule>();
builder.RegisterModule<AppModule>();
builder.RegisterModule<ViewModule>();
builder.RegisterModule<SkiaModule>();
using (IContainer container = builder.Build())
{
using (var log = container.Resolve<ILog>())
{
var app = new App();
AppBuilder.Configure(app)
.UseWin32()
.UseSkia()
.SetupWithoutStarting();
app.Start(container.Resolve<IServiceProvider>());
}
}
}
示例11: Main
static void Main(string[] args)
{
var app = new App();
// Configure the static URLs
app.AddUrl("/", Pages.Frontpage);
app.AddUrl("/rss-feed.xml", Pages.RssFeed);
app.AddUrl("/archive", Pages.Archive);
// For static pages, you can directly give the path to a template
app.AddUrl(@"/about", "templates/about.html");
// Add a URL pattern with a regular expression for the article pages.
// The expression captures the name of the article so we can access it in Article.View.
app.AddUrlPattern(@"^/article/(?<articleSlug>[\w\-]+)$", Article.View);
// Serve files from the "/static" folder.
// In production use, you should add a rule to your webserver configuration that directly
// serves the static files from this directory, without passing the requests to this app.
app.AddStaticDirectory("static/");
// Set a custom 404 error page
app.NotFoundView = Pages.NotFound;
// Start accepting requests.
// This method never returns!
app.RunTestServer();
}
示例12: CanSync
public const string DescriptionHeaderName = "# CrossSync: "; // Don't modify this.
#endregion Fields
#region Methods
public static bool CanSync(out CybozuException ex)
{
ex = null;
Properties.Settings settings = Properties.Settings.Default;
if (!IsConfigured(settings)) return false;
App firstApp, secondApp;
Schedule firstSchedule, secondSchedule;
try
{
firstApp = new App(settings.FirstUrl);
firstApp.Auth(settings.FirstUsername, settings.FirstPassword);
firstSchedule = new Schedule(firstApp);
secondApp = new App(settings.SecondUrl);
secondApp.Auth(settings.SecondUsername, settings.SecondPassword);
secondSchedule = new Schedule(secondApp);
}
catch (CybozuException e)
{
// fail to auth
ex = e;
return false;
}
catch (Exception)
{
return false;
}
return true;
}
示例13: Main
static void Main()
{
App app = new App();
app.MainWindow = new MainWindow();
app.MainWindow.Show();
app.Run();
}
示例14: SubPromptWindow
public SubPromptWindow(Logger logger, App app, string subCutxFilePath, IWorkbookSet books, SubassemblyItem item)
: this(logger, app)
{
this.Manager = new PromptsViewModel(subCutxFilePath, item.Width.PropertyValue, item.Height.PropertyValue, item.Depth.PropertyValue, books, logger);
Init();
}
示例15: HomePage
public HomePage()
{
this.InitializeComponent();
localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
//StatusField.Text = "Please ensure the sensor is connected";
app = App.Current as SensorTagReader.App;
if (app.HorseName != null) HorseNameField.Text = app.HorseName;
if (app.SessionID != null)
SesssionIDField.Text = app.SessionID;
else
SesssionIDField.Text = _sessionID;
tagReaders = new List<TagReaderService>();
deviceInfoService = new DeviceInfoService();
eventHubWriterTimer = new DispatcherTimer();
eventHubWriterTimer.Interval = new TimeSpan(0, 0, 1);
eventHubWriterTimer.Tick += OnEventHubWriterTimerTick;
}