public void Open()
        {
            SelectFolderDialogCreationArgs args = new SelectFolderDialogCreationArgs();

            args.AllowCreateNewFolder = false;
            args.Path   = _lastFolder;
            args.Prompt = SR.MessageSelectFolderToFilter;

            FileDialogResult result = base.Context.DesktopWindow.ShowSelectFolderDialogBox(args);

            if (result.Action == DialogBoxAction.Ok)
            {
                _lastFolder = result.FileName;

                string[] file = Directory.GetFiles(_lastFolder, "*.*", SearchOption.AllDirectories);
                fileName = file;

                ClearCanvas.ImageViewer.ImageViewerComponent viewer = null;
                DesktopWindow desktopWindow = null;
                List <string> _filenames    = new List <string>();

                foreach (DesktopWindow window in Application.DesktopWindows)
                {
                    foreach (Workspace space in window.Workspaces)
                    {
                        if (space.Title == "imageview")
                        {
                            desktopWindow = window;
                            viewer        = space.Component as ClearCanvas.ImageViewer.ImageViewerComponent;
                        }
                    }
                }
                if (viewer != null)
                {
                    viewer.PhysicalWorkspace.Clear();
                    viewer.LogicalWorkspace.Clear();
                    viewer.ReAllocateStudyTree();
                    viewer.Layout();
                    viewer.LoadImages(file, "");
                    viewer.Layout();
                }
            }
        }
Ejemplo n.º 2
0
        private void Mytest()
        {
            ClearCanvas.ImageViewer.ImageViewerComponent viewer = null;
            DesktopWindow desktopWindow = null;
            List <string> _filenames    = new List <string>();

            foreach (DesktopWindow window in Application.DesktopWindows)
            {
                foreach (Workspace space in window.Workspaces)
                {
                    if (space.Title == "imageview")
                    {
                        desktopWindow = window;
                        viewer        = space.Component as ClearCanvas.ImageViewer.ImageViewerComponent;
                    }
                }
            }
            if (viewer != null)
            {
                viewer.PhysicalWorkspace.Clear();
                viewer.LogicalWorkspace.Clear();
                viewer.ReAllocateStudyTree();
                viewer.Layout();
                viewer.LoadStudyFromFtp(this);
            }
            else
            {
                try
                {
                    string[] files = { "e:\\26885681.dcm", "e:\\26885683.dcm" };
                    //new OpenFilesHelper(files) { WindowBehaviour = ViewerLaunchSettings.WindowBehaviour }.OpenFiles();
                }
                catch (Exception e)
                {
                    //ExceptionHandler.Report(e, SR.MessageUnableToOpenImages, Context.DesktopWindow);
                }
            }
        }