Пример #1
0
        private void Edit()
        {
            DicomPrinterEditValidation oih = new DicomPrinterEditValidation
            {
                dicomPrinterSummaryComponent = this
            };

            oih.dicomPrinter = this._checkableDicomPrinter.Item;
            Checkable <DicomPrinter>    oldCheckAble = this._checkableDicomPrinter;
            DicomPrinterEditorComponent component    = new DicomPrinterEditorComponent(oih.dicomPrinter);

            component.Validation.Add(new ValidationRule("Name", new ValidationRule.ValidationDelegate(oih.Validation)));
            IApplicationComponentHost host          = base.Host;
            DesktopWindow             desktopWindow = host.DesktopWindow;

            if (ApplicationComponentExitCode.Accepted == ApplicationComponent.LaunchAsDialog(desktopWindow, component, "Edit DICOM Printer"))
            {
                int num = this._dicomPrinterTable.Items.IndexOf(oldCheckAble);
                this._dicomPrinterTable.Items.Remove(oldCheckAble);
                bool isChecked = oldCheckAble.IsChecked;
                Checkable <DicomPrinter> checkable = new Checkable <DicomPrinter>(oih.dicomPrinter, isChecked);
                this._dicomPrinterTable.Items.Insert(num, checkable);
                this.Modified = true;
            }
        }
Пример #2
0
        private void Add()
        {
            DicomPrinterAddValidation nih = new DicomPrinterAddValidation
            {
                dicomPrinterSummaryComponent = this
            };

            nih.dicomPringer = new DicomPrinter();
            DicomPrinterEditorComponent component = new DicomPrinterEditorComponent(nih.dicomPringer);

            component.Validation.Add(new ValidationRule("Name", new ValidationRule.ValidationDelegate(nih.Validation)));
            DesktopWindow desktopWindow = base.Host.DesktopWindow;

            if (ApplicationComponentExitCode.Accepted == ApplicationComponent.LaunchAsDialog(desktopWindow, component, "EditorDicomPrinter"))
            {
                this._dicomPrinterTable.Items.Add(new Checkable <DicomPrinter>(nih.dicomPringer));
                this.Modified = true;
            }
        }