Beispiel #1
0
        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;
        }
Beispiel #2
0
        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();
        }
        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); }

        }
        /// <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;
        }
Beispiel #5
0
        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();
                }
            }
        }
        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);
        }
Beispiel #7
0
        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
                    {

                    }
                }
            }
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        static void Main(string[] args)
        {
            App app = new App();
            app.Run();

            Console.ReadLine();
        }
Beispiel #10
0
        /// <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>());
                }
            }
        }
Beispiel #11
0
        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();
        }
Beispiel #12
0
        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;
        }
Beispiel #13
0
 static void Main()
 {
     App app = new App();
     app.MainWindow = new MainWindow();
     app.MainWindow.Show();
     app.Run();
 }
        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();
        }
        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;

        }
        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();
        }
Beispiel #17
0
        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;
        }
Beispiel #18
0
		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;
		}
        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));
        }
Beispiel #20
0
        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);
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            try
            {
                var application = new App();
                LoadApplication(application);

                application.SwitchFloatingTools();
            }
            catch (Exception ex)
            {
            }

            //ActionBar.CustomView = LayoutInflater.Inflate(Resource.Layout.MyCard, null);
            //ActionBar.DisplayOptions = ActionBarDisplayOptions.ShowCustom;

            /*
            ActionBar.CustomView = Inflate(context, Resource.Layout.PersonControl, this);
            ActionBar.DisplayOptions = ActionBarDisplayOptions.ShowCustom;
            ActionBar.SetHomeButtonEnabled(true);
            */
            /*if ((int)Android.OS.Build.VERSION.SdkInt >= 21)
            {
                ActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent)));
            }*/
        }
Beispiel #22
0
        private Program1()
        {
            m_app = new App();

            //this applies the XAML, e.g. StartupUri, Application.Resources
            m_app.InitializeComponent();
        }
Beispiel #23
0
        public LoginPage(IKitsTajmService service, App app)
        {
            this._app = app;
            this._service = service;

            InitializeComponent();
        }
 public static void GotoLast(App app)
 {
     try {
         app.SelectedFrame = app.Data.Frames.Count - 1;
     } catch (NullReferenceException ex) {
         Console.Error.WriteLine(ex);
     }
 }
Beispiel #25
0
 public static int Main(string[] args)
 {
     Ice.InitializationData initData = new Ice.InitializationData();
     initData.properties = Ice.Util.createProperties();
     initData.properties.setProperty("Ice.Admin.DelayCreation", "1");
     App server = new App();
     return server.main(args, initData);
 }
Beispiel #26
0
 public static void SaveAs(App app, Gtk.Window window)
 {
     try {
         DocumentModule.Save(window, app.FileExtensions, app.FileName, app);
     } catch (NullReferenceException ex) {
         Console.Error.WriteLine(ex);
     }
 }
Beispiel #27
0
 public static void Close(App app)
 {
     try {
         Gtk.Application.Quit();
     } catch (NullReferenceException ex) {
         Console.Error.WriteLine(ex);
     }
 }
Beispiel #28
0
 public static void CancelCloseEvent(App app, Gtk.DeleteEventArgs args)
 {
     try {
         args.RetVal = true;
     } catch (NullReferenceException ex) {
         Console.Error.WriteLine(ex);
     }
 }
        void App_OnProtocolActivated(App sender, string FBtoken)
        {
            App.OnProtocolActivated -= App_OnProtocolActivated;

            if (AuthenSuccessed != null)
                AuthenSuccessed.Invoke(FBtoken);

        }
 public static void GotoPrevious(App app)
 {
     try {
         app.SelectedFrame--;
     } catch (NullReferenceException ex) {
         Console.Error.WriteLine(ex);
     }
 }