示例#1
0
        public StandAloneContext(Func <dynamic> createVMSApp)
        {
            Exception e = null;

            if (createVMSApp == null)
            {
                throw new Exception("Must assign a function to create VMS app. Call SetAppFunction() prior to this.");
            }

            var thread = new AppComThread();

            thread.Invoke(() =>
            {
                var vms = createVMSApp();
                _app    = new X.Application(vms);
            });
            this.Thread = thread;

            if (_app == null)
            {
                throw new Exception("App was not created. Check to make sure the VMS dll references are correct.", e);
            }

            if (ExpandoGetter.GetClient(_app) == null)
            {
                throw new Exception(
                          "App was not created. Make sure FacadeInitializer.Initialize() in ESAPIX.Bootstrapper is being called before invoking static methods",
                          e);
            }

            XContext.Instance.CurrentContext = this;
            CurrentUser = _app?.CurrentUser;
            Logger      = new Logger();
        }
示例#2
0
        public static PlanSetup GetProstatePlanSetup()
        {
            var json   = ASCIIEncoding.ASCII.GetString(Resources.plan);
            var ps     = JsonConvert.DeserializeObject <PlanSetup>(json, FacadeSerializer.DeserializeSettings);
            var client = ExpandoGetter.GetClient(ps);

            return(ps);
            //ps.GetDoseAtVolume()
        }