Represents a workspace within a desktop window.
Наследование: ClearCanvas.Desktop.DesktopObject, IWorkspace
Пример #1
0
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="args"></param>
		/// <param name="workspace"></param>
		protected internal WorkspaceDialogBox(DialogBoxCreationArgs args, Workspace workspace)
			: base(args)
		{
			_workspace = workspace;
			_host = new Host(this, args.Component);
			_size = args.Size;
			_sizeHint = args.SizeHint;
		}
Пример #2
0
        /// <summary>
        /// Creates the title that is displayed in the title bar.  Overridden to display user name. 
        /// </summary>
        /// <param name="baseTitle"></param>
        /// <param name="activeWorkspace"></param>
        /// <returns></returns>
        protected override string MakeTitle(string baseTitle, Workspace activeWorkspace)
        {
            LoginSession currentSession = LoginSession.Current;

            // if there is a full person name associated with the session, use it
            // otherwise use the UserName (login id)
            string username = (currentSession.FullName == null) ? currentSession.UserName :
                PersonNameFormat.Format(currentSession.FullName);

            // show working facility if specified
            if (currentSession.WorkingFacility != null)
                username = string.Format("{0} @ {1}", username, currentSession.WorkingFacility.Name);

            // show the user name before the base title
            return string.Format("{0} - {1}", username, base.MakeTitle(baseTitle, activeWorkspace));
        }
Пример #3
0
        public static void Show(IDesktopWindow desktopWindow)
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            if (!PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.View))
            {
                desktopWindow.ShowMessageBox(SR.WarningActivityMonitorPermission, MessageBoxActions.Ok);
                return;
            }

            var component = new ActivityMonitorComponent();
            _workspace = ApplicationComponent.LaunchAsWorkspace(desktopWindow, component, SR.TitleActivityMonitor);
            _workspace.Closed += ((sender, args) =>
            {
                _workspace = null;
            });
        }
        //public WorkspaceDrawingArea(Workspace workspace)
        public ImageWorkspaceDrawingArea(Workspace workspace)
		{
            // set background to black
            this.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0));

            // tell GTK that we intend to handle painting ourselves
            // hopefully this will suppress the "flashing", but doesn't seem to help much
            this.AppPaintable = true;

			CreateRenderer();

            _workspace = (ImageWorkspace)workspace;
            _physicalWorkspace = _workspace.PhysicalWorkspace;
            _physicalWorkspace.ImageDrawing += new EventHandler<ImageDrawingEventArgs>(OnDrawImage);

            // tell Gtk that we are interested in receiving these events
            this.AddEvents((int)Gdk.EventMask.PointerMotionMask);
			this.AddEvents((int)Gdk.EventMask.PointerMotionHintMask);	// suppress queueing of motion messages
			this.AddEvents((int)Gdk.EventMask.ButtonPressMask);
            this.AddEvents((int)Gdk.EventMask.ButtonReleaseMask);
            this.AddEvents((int)Gdk.EventMask.KeyPressMask);

            _lastButtonPressed = 0; // no mouse button pressed
		}
Пример #5
0
		internal static KeyImageInformation GetKeyImageInformation(Workspace workspace)
		{
			IImageViewer viewer = ImageViewerComponent.GetAsImageViewer(workspace);
			return GetKeyImageInformation(viewer);
		}
Пример #6
0
			internal Host(Workspace workspace, IApplicationComponent component)
				: base(component)
			{
				Platform.CheckForNullReference(workspace, "workspace");
				_workspace = workspace;
			}
Пример #7
0
		/// <summary>
		/// Stops the hosted component.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			base.Dispose(disposing);

			if (disposing && _host != null)
			{
				_host.StopComponent();
				_host = null;
				_workspace = null;
			}
		}
Пример #8
0
 /// <summary>
 /// Creates a new view for the specified <see cref="Workspace"/>.
 /// </summary>
 /// <remarks>
 /// Override this method if you want to return a custom implementation of <see cref="IWorkspaceView"/>.
 /// In practice, it is preferable to subclass <see cref="WorkspaceView"/> rather than implement <see cref="IWorkspaceView"/>
 /// directly.
 /// </remarks>
 /// <param name="workspace"></param>
 /// <returns></returns>
 public virtual IWorkspaceView CreateWorkspaceView(Workspace workspace)
 {
     return new WorkspaceView(workspace, this);
 }
Пример #9
0
		public void SetWorkspace(Workspace workspace)
		{
			_imageWorkspace = workspace as ImageWorkspace;
			Platform.CheckForInvalidCast(_imageWorkspace, "workspace", "ImageWorkspace");
		}
Пример #10
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="workspace"></param>
 /// <param name="desktopView"></param>
 protected internal WorkspaceView(Workspace workspace, DesktopWindowView desktopView)
 {
     _desktopView = desktopView;
 }
Пример #11
0
		internal static KeyImageClipboard GetKeyImageClipboard(Workspace workspace)
		{
			IImageViewer viewer = ImageViewerComponent.GetAsImageViewer(workspace);
			return GetKeyImageClipboard(viewer);
		}