本文整理汇总了C#中System.App类的典型用法代码示例。如果您正苦于以下问题:C# App类的具体用法?C# App怎么用?C# App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
App类属于System命名空间,在下文中一共展示了App类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:2sic,项目名称:2sxc,代码行数:34,代码来源:AdamNavigator.cs
示例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();
}
开发者ID:sk8tz,项目名称:TradingDemo,代码行数:25,代码来源:BootStrap.cs
示例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); }
}
开发者ID:sivarajankumar,项目名称:dentalsmile,代码行数:27,代码来源:MeasurementForm.xaml.cs
示例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;
}
开发者ID:erindm,项目名称:route-planner-csharp,代码行数:11,代码来源:DelayedOptimizeAndEditPage.cs
示例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();
}
}
}
开发者ID:jsulak,项目名称:Switcheroo,代码行数:28,代码来源:Program.cs
示例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);
}
开发者ID:noda0320,项目名称:Design-Pattern,代码行数:26,代码来源:ChainOfResponsibility.cs
示例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
{
}
}
}
}
开发者ID:cpm2710,项目名称:cellbank,代码行数:32,代码来源:Program.cs
示例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);
}
开发者ID:RailPhase,项目名称:RailPhase,代码行数:33,代码来源:Requests.cs
示例9: Main
static void Main(string[] args)
{
App app = new App();
app.Run();
Console.ReadLine();
}
开发者ID:syrotkin,项目名称:algdesign,代码行数:7,代码来源:Program.cs
示例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>());
}
}
}
开发者ID:Core2D,项目名称:Core2D,代码行数:30,代码来源:Program.cs
示例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();
}
开发者ID:LukasBoersma,项目名称:RailPhase.Blog,代码行数:28,代码来源:Program.cs
示例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;
}
开发者ID:hatashinya,项目名称:cybozu-crosssync,代码行数:39,代码来源:Program.cs
示例13: Main
static void Main()
{
App app = new App();
app.MainWindow = new MainWindow();
app.MainWindow.Show();
app.Run();
}
开发者ID:siderevs,项目名称:ZippedImageViewer,代码行数:7,代码来源:Startup.cs
示例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();
}
开发者ID:komelio,项目名称:Dimeng.LinkToMicrocad,代码行数:7,代码来源:SubPromptWindow.cs
示例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;
}
开发者ID:traceyt,项目名称:SensorTag-Azure,代码行数:25,代码来源:HomePage.xaml.cs
示例16: PatientDetails
public PatientDetails()
{
InitializeComponent();
app = Application.Current as App;
DB = DentalSmileDBFactory.GetInstance();
DetailsEdit.Visibility = Visibility.Collapsed;
DetailsAdd.Visibility = Visibility.Collapsed;
DetailsList.Visibility = Visibility.Collapsed;
HistoryList.Visibility = Visibility.Collapsed;
CollapseDetailsEdit = ((Storyboard)this.Resources["CollapseDetailsEdit"]);
CollapseDetailsAdd = ((Storyboard)this.Resources["CollapseDetailsAdd"]);
PatientListView.ItemsSource = patients;
patients = DB.SelectAllPatient();
ICollectionView view = System.Windows.Data.CollectionViewSource.GetDefaultView(patients);
view.SortDescriptions.Add(new SortDescription("FirstName", ListSortDirection.Ascending));
PatientListView.ItemsSource = patients;
ignoreSelection = false;
navigateButton();
Storyboard ExpandDetailsList = ((Storyboard)this.Resources["ExpandDetailsList"]);
ExpandDetailsList.Begin();
}
开发者ID:sivarajankumar,项目名称:dentalsmile,代码行数:27,代码来源:PatientDetails.xaml.cs
示例17: Init
public void Init(Template template, App app, ModuleInfo hostingModule, IDataSource dataSource, InstancePurposes instancePurposes, SxcInstance sexy)
{
var templatePath = VirtualPathUtility.Combine(Internal.TemplateManager.GetTemplatePathRoot(template.Location, app) + "/", template.Path);
// Throw Exception if Template does not exist
if (!File.Exists(HostingEnvironment.MapPath(templatePath)))
// todo: rendering exception
throw new SexyContentException("The template file '" + templatePath + "' does not exist.");
Template = template;
TemplatePath = templatePath;
App = app;
ModuleInfo = hostingModule;
DataSource = dataSource;
InstancePurposes = instancePurposes;
Sexy = sexy;
// check common errors
CheckExpectedTemplateErrors();
// check access permissions - before initializing or running data-code in the template
CheckTemplatePermissions(sexy.AppPortalSettings);
// Run engine-internal init stuff
Init();
// call engine internal feature to optionally change what data is actually used or prepared for search...
CustomizeData();
// check if rendering is possible, or throw exceptions...
CheckExpectedNoRenderConditions();
if(PreRenderStatus == RenderStatusType.Unknown)
PreRenderStatus = RenderStatusType.Ok;
}
开发者ID:2sic,项目名称:2sxc,代码行数:35,代码来源:EngineBase.cs
示例18: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
this.SetIoc();
Forms.Init();
var formsApp = new App();
LoadApplication (formsApp);
// this._window = new UIWindow(UIScreen.MainScreen.Bounds)
// {
// RootViewController = App.GetMainPage().CreateViewController()
// };
Forms.ViewInitialized += (sender, e) =>
{
if (!string.IsNullOrWhiteSpace(e.View.StyleId))
{
e.NativeView.AccessibilityIdentifier = e.View.StyleId;
}
};
base.FinishedLaunching(app, options);
return true;
}
开发者ID:codelinguist,项目名称:Pdia,代码行数:27,代码来源:AppDelegate.cs
示例19: FacebookPageRenderer
public FacebookPageRenderer()
{
var activity = this.Context as Activity;
var auth = new OAuth2Authenticator(
clientId: "476292725915235",
scope: "",
authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));
auth.Completed += async (sender, eventArgs) => {
if (eventArgs.IsAuthenticated)
{
var accessToken = eventArgs.Account.Properties["access_token"].ToString();
var expiresIn = Convert.ToDouble(eventArgs.Account.Properties["expires_in"]);
var expiryDate = DateTime.Now + TimeSpan.FromSeconds(expiresIn);
var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me"), null, eventArgs.Account);
var response = await request.GetResponseAsync();
var obj = JObject.Parse(response.GetResponseText());
var id = obj["id"].ToString().Replace("\"", "");
var name = obj["name"].ToString().Replace("\"", "");
App app = new App();
await app.NavigateToProfile(string.Format("Olá {0}", name));
}
else
{
await App.Current.MainPage.DisplayAlert("Alerta", "lOGIN CANCELADO", " OK");
}
};
activity.StartActivity(auth.GetUI(activity));
}
开发者ID:bruno-wladimir,项目名称:Faculdade,代码行数:35,代码来源:FacebookPageRenderer.cs
示例20: Controller
public Controller(App app)
{
this.app = app;
this.app.Exit += aboutToExit;
initializeModel();
initializeGUI();
controller = this;
ServicePointManager.DefaultConnectionLimit = 65000;
if (System.Environment.MachineName.Equals("DOMI-PC")) {
ThreadStart ts = () => {
SerialBoxOfficeMovieParser b = new SerialBoxOfficeMovieParser("titanic");
b.run();
b.getResult().printToConsole();
b = new SerialBoxOfficeMovieParser("abduction11");
b.run();
b.getResult().printToConsole();
b = new SerialBoxOfficeMovieParser("inception");
b.run();
b.getResult().printToConsole();
};
(new Thread(ts)).Start();
} else {
Console.WriteLine("Nicht auf DOMI-PC sonder auf {0}, deswegen jetzt kein BO Parsen", System.Environment.MachineName);
}
}
开发者ID:Isodome,项目名称:MovieRack,代码行数:26,代码来源:Controller.cs
注:本文中的System.App类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论