コード例 #1
0
        /// <summary>
        /// Opens a new desktop window with the specified creation arguments.
        /// </summary>
        public DesktopWindow AddNew(DesktopWindowCreationArgs args)
        {
            DesktopWindow window = CreateWindow(args);

            Open(window);
            return(window);
        }
コード例 #2
0
        /// <summary>
        /// Creates a new <see cref="DesktopWindow"/>.
        /// </summary>
        private DesktopWindow CreateWindow(DesktopWindowCreationArgs args)
        {
            IDesktopWindowFactory factory = CollectionUtils.FirstElement <IDesktopWindowFactory>(
                (new DesktopWindowFactoryExtensionPoint()).CreateExtensions()) ?? new DefaultDesktopWindowFactory();

            return(factory.CreateWindow(args, _owner));
        }
コード例 #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        protected internal DesktopWindow(DesktopWindowCreationArgs args, Application application)
            : base(args)
        {
            _application = application;
            _workspaces  = new WorkspaceCollection(this);
            _shelves     = new ShelfCollection(this);
            _dialogs     = new DialogBoxCollection(this);

            // if no title supplied, create a default title
            _baseTitle = !string.IsNullOrEmpty(args.Title) ? args.Title : DefaultBaseTitle;

            _menuActionSite    = args.MenuSite ?? GlobalMenus;
            _toolbarActionSite = args.ToolbarSite ?? GlobalToolbars;
        }
コード例 #4
0
ファイル: WebDesktopWindow.cs プロジェクト: nhannd/Xian
 internal WebDesktopWindow(DesktopWindowCreationArgs args, Application application) 
     : base(args, application)
 {
 }
コード例 #5
0
ファイル: Factories.cs プロジェクト: bangush/server-1
 public DesktopWindow CreateWindow(DesktopWindowCreationArgs args, Application application)
 {
     return(new DesktopWindow(args, application));
 }
コード例 #6
0
        void Desktop2()
        {
            DesktopWindowCreationArgs args = new DesktopWindowCreationArgs("Desktop2", "Desktop2");

            Application.DesktopWindows.AddNew(args);
        }
コード例 #7
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="args"></param>
        /// <param name="application"></param>
        protected internal RisDesktopWindow(DesktopWindowCreationArgs args, Desktop.Application application)
            :base(args, application)
        {
			// set the current session before attempting to access other services, as these will require authentication
			LoginSession.Create(SessionManager.FacilityCode);
		}
コード例 #8
0
 /// <summary>
 /// Creates a new desktop window for the specified arguments.
 /// </summary>
 /// <param name="args">Arguments that control the creation of the desktop window.</param>
 /// <param name="application">The application with which the window is associated.</param>
 /// <returns>A new desktop window instance.</returns>
 public DesktopWindow CreateWindow(DesktopWindowCreationArgs args, Desktop.Application application)
 {
     return new RisDesktopWindow(args, application);
 }
コード例 #9
0
ファイル: ViewerApplication.cs プロジェクト: nhannd/Xian
	    protected override void OnStart(StartApplicationRequest request)
		{
			lock (_syncLock)
			{
                Platform.Log(LogLevel.Info, "Viewer Application is starting...");
                if (Application.Instance == null)
					Platform.StartApp("ClearCanvas.Desktop.Application",new string[] {"-r"});
			}

            


            if (Platform.IsLogLevelEnabled(LogLevel.Debug))
                Platform.Log(LogLevel.Debug, "Finding studies...");
			var startRequest = (StartViewerApplicationRequest)request;
			IList<StudyRootStudyIdentifier> studies = FindStudies(startRequest);

			List<LoadStudyArgs> loadArgs = CollectionUtils.Map(studies, (StudyRootStudyIdentifier identifier) => CreateLoadStudyArgs(identifier));

		    DesktopWindowCreationArgs args = new DesktopWindowCreationArgs("", Identifier.ToString());
            WebDesktopWindow window = new WebDesktopWindow(args, Application.Instance);
            window.Open();

            _viewer = CreateViewerComponent(startRequest);

			try
			{
                if (Platform.IsLogLevelEnabled(LogLevel.Debug))
                    Platform.Log(LogLevel.Debug, "Loading study...");
                _viewer.LoadStudies(loadArgs);
			}
			catch (Exception e)
			{
				if (!AnySopsLoaded(_viewer)) //end the app.
                    throw;

				//Show an error and continue.
				ExceptionHandler.Report(e, window);
			}

            if (Platform.IsLogLevelEnabled(LogLevel.Debug))
                Platform.Log(LogLevel.Info, "Launching viewer...");
			
			ImageViewerComponent.Launch(_viewer, window, "");

			_viewerHandler = EntityHandler.Create<ViewerEntityHandler>();
			_viewerHandler.SetModelObject(_viewer);
		    _app = new Common.ViewerApplication
		               {
		                   Identifier = Identifier,
		                   Viewer = (Viewer) _viewerHandler.GetEntity(),

                           VersionString = GetProductVersionString()
                                
			           };
            

            // Push the ViewerApplication object to the client
            Event @event = new PropertyChangedEvent
            {
                PropertyName = "Application",
                Value = _app,
                Identifier = Guid.NewGuid(),
                SenderId = request.Identifier
            };

            ApplicationContext.Current.FireEvent(@event);
		}