コード例 #1
0
ファイル: ImageSop.cs プロジェクト: top501/GoldenEagle
        protected override IEnumerable <TransferSyntax> GetAllowableTransferSyntaxes()
        {
            var list = new List <TransferSyntax>(base.GetAllowableTransferSyntaxes());

            list.AddRange(DicomCodecRegistry.GetCodecTransferSyntaxes());
            return(list);
        }
コード例 #2
0
ファイル: SamplesForm.cs プロジェクト: ronmark1/ClearCanvas-1
        public SamplesForm()
        {
            InitializeComponent();
            _buttonStorageScuVerify.Text = STR_Verify;

            if (String.IsNullOrEmpty(Properties.Settings.Default.ScpStorageFolder))
            {
                Properties.Settings.Default.ScpStorageFolder = Path.Combine(Path.GetTempPath(), "DicomImages");
            }

            _destinationSyntaxCombo.Items.Clear();
            _destinationSyntaxCombo.Items.Add(TransferSyntax.ExplicitVrLittleEndian);
            foreach (TransferSyntax syntax in DicomCodecRegistry.GetCodecTransferSyntaxes())
            {
                _destinationSyntaxCombo.Items.Add(syntax);
            }

            ComboBoxQueryScuQueryTypeSelectedIndexChanged(null, null);
            ComboBoxMoveScuQueryTypeSelectedIndexChanged(null, null);

            // Logging stuff
            Closing += SamplesFormClosing;
            BasicConfigurator.Configure(_appender);
            _timer = new Timer(delegate
            {
                try
                {
                    LoggingEvent[] events = _appender.GetEvents();
                    if (events != null && events.Length > 0)
                    {
                        // if there are events, we clear them from the logger,
                        // since we're done with them
                        _appender.Clear();
                        foreach (LoggingEvent ev in events)
                        {
                            // the line we want to log
                            string line = String.Format("({0}) {1} {2} [{3}]: {4}\r\n",
                                                        ev.ThreadName,
                                                        ev.TimeStamp.ToShortDateString(),
                                                        ev.TimeStamp.ToLongTimeString(), ev.Level,
                                                        ev.RenderedMessage);

                            AppendText(line);

                            if (ev.ExceptionObject != null)
                            {
                                AppendText(string.Format("{0}: {1}\r\n", ev.ExceptionObject, ev.ExceptionObject.Message));
                                AppendText("Stack Trace:\r\n" + ev.ExceptionObject.StackTrace + "\r\n");
                            }
                        }
                    }
                }
                catch (Exception x)
                {
                    Platform.Log(LogLevel.Error, x, "Unexpected exception with logging event");
                }
            }, null, 500);
            _timer.Start();
        }
コード例 #3
0
ファイル: SamplesForm.cs プロジェクト: scottshea/monodicom
        public SamplesForm()
        {
            InitializeComponent();
            _buttonStorageScuVerify.Text = STR_Verify;

            Logger.RegisterLogHandler(OutputTextBox);

            if (String.IsNullOrEmpty(Properties.Settings.Default.ScpStorageFolder))
            {
                Properties.Settings.Default.ScpStorageFolder = Path.Combine(Path.GetTempPath(), "DicomImages");
            }

            _destinationSyntaxCombo.Items.Clear();
            _destinationSyntaxCombo.Items.Add(TransferSyntax.ExplicitVrLittleEndian);
            foreach (TransferSyntax syntax in DicomCodecRegistry.GetCodecTransferSyntaxes())
            {
                _destinationSyntaxCombo.Items.Add(syntax);
            }

            comboBoxQueryScuQueryType_SelectedIndexChanged(null, null);
        }