当前位置: 首页>>代码示例>>C#>>正文


C# System.App类代码示例

本文整理汇总了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;
        }
开发者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


注:本文中的System.App类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。