예제 #1
0
        private void showLowMedHigh()
        {
            // EMPTY INSTANCES ARE FOR DEFAULT USE ONLY ! ! !
            Exhibition DEFAULT_EXHIBITION = new Exhibition();
            Exhibit DEFAULT_EXHIBIT = new Exhibit();

            this.comboBox2.Items.Clear();
            this.comboBox2.Items.Add("niedrig"); // Low
            this.comboBox2.Items.Add("normal"); // Medium
            this.comboBox2.Items.Add("hoch"); // High

            switch (this.setting)
            {
                case Setting.None:
                    break;
                case Setting.UserPosition:
                    break;
                case Setting.BackgroundImage:
                    break;
                case Setting.Overview:
                    break;
                case Setting.Threshold:
                    this.comboBox2.SelectedIndex = detLessIsMore(DEFAULT_EXHIBITION.getThreshold(), this.exhibition.getThreshold());
                    break;
                case Setting.SelectionTime:
                    this.comboBox2.SelectedIndex = detLessIsLess(DEFAULT_EXHIBITION.getSelectionTime(), this.exhibition.getSelectionTime());
                    break;
                case Setting.LockTime:
                    this.comboBox2.SelectedIndex = detLessIsLess(DEFAULT_EXHIBITION.getLockTime(), this.exhibition.getLockTime());
                    break;
                case Setting.SlideTime:
                    this.comboBox2.SelectedIndex = detLessIsLess(DEFAULT_EXHIBITION.getSlideTime(), this.exhibition.getSlideTime());
                    break;
                case Setting.KernelSize:
                    this.comboBox2.SelectedIndex = detLessIsLess(DEFAULT_EXHIBIT.getKernelSize(), this.TMP_EXHIBIT.getKernelSize());
                    break;
                case Setting.KernelWeight:
                    this.comboBox2.SelectedIndex = detLessIsLess(DEFAULT_EXHIBIT.getKernelWeight(), this.TMP_EXHIBIT.getKernelWeight());
                    break;
                case Setting.Position:
                    break;
                default:
                    break;
            }
            this.comboBox2.Visibility = Visibility.Visible;
            this.button2.Visibility = Visibility.Hidden;
        }
예제 #2
0
파일: FileHandler.cs 프로젝트: user-mfp/IMI
        public void saveExhibit(Exhibit exhibit)
        {
            XmlWriter exhibitWriter = XmlWriter.Create(exhibit.getPath(), this.xmlWriterSettings); // Create XmlWriter for file's path
            exhibitWriter.WriteStartDocument(); // Start writing the file

            //<Exhibit>
            exhibitWriter.WriteStartElement("Exhibit");
            exhibitWriter.WriteAttributeString("Name", exhibit.getName());
            exhibitWriter.WriteAttributeString("Path", exhibit.getPath());
            exhibitWriter.WriteAttributeString("KernelSize", exhibit.getKernelSize().ToString().Replace(',', '.'));
            exhibitWriter.WriteAttributeString("KernelWeight", exhibit.getKernelWeight().ToString());

            if (exhibit.getDescription() != null) // The exhibit has a description
            {
                exhibitWriter.WriteAttributeString("Description", exhibit.getDescription());
            }

            //<Position>
            exhibitWriter.WriteStartElement("Position");
            exhibitWriter.WriteAttributeString("Position", exhibit.getPosition().ToString().Replace(',', '.').Replace(';', ' '));
            exhibitWriter.WriteEndElement();
            //</Position>

            if (exhibit.getImages() != null) // The exhibit has images
            {
                //<Images>
                exhibitWriter.WriteStartElement("Images");

                foreach (KeyValuePair<string, BitmapImage> image in exhibit.getImages())
                {
                    //<Image>
                    exhibitWriter.WriteStartElement("Image");
                    exhibitWriter.WriteAttributeString("Path", image.Key);
                    exhibitWriter.WriteEndElement();
                    //</Image>
                }

                exhibitWriter.WriteEndElement();
                //</Images>
            }
            exhibitWriter.WriteEndElement();
            //</Exhibit>

            exhibitWriter.WriteEndDocument(); // Stop writing the file
            exhibitWriter.Close(); // Close the file
        }
예제 #3
0
        private void setAttribute()
        {
            // EMPTY INSTANCES ARE FOR DEFAULT USE ONLY ! ! !
            Exhibition DEFAULT_EXHIBITION = new Exhibition();
            Exhibit DEFAULT_EXHIBIT = new Exhibit();

            double factor = 1.0;
            if (this.comboBox2.SelectedIndex == 0) //Low
            {
                factor = this.LOW;
            }
            else if (this.comboBox2.SelectedIndex == 2) //High
            {
                factor = this.HIGH;
            }

            switch (this.setting)
            {
                case Setting.Threshold:
                    if (factor != 1.0)
                        this.exhibition.setThreshold(DEFAULT_EXHIBITION.getThreshold() * ((this.LOW + this.HIGH) - factor));
                    else
                        this.exhibition.setThreshold(DEFAULT_EXHIBITION.getThreshold());
                    break;
                case Setting.SelectionTime:
                    if (factor != 1.0)
                        this.exhibition.setSelectionTime((int)(DEFAULT_EXHIBITION.getSelectionTime() * factor));
                    else
                        this.exhibition.setSelectionTime(DEFAULT_EXHIBITION.getSelectionTime());
                    break;
                case Setting.LockTime:
                    if (factor != 1.0)
                        this.exhibition.setLockTime((int)(DEFAULT_EXHIBITION.getLockTime() * factor));
                    else
                        this.exhibition.setLockTime(DEFAULT_EXHIBITION.getLockTime());
                    break;
                case Setting.SlideTime:
                    if (factor != 1.0)
                        this.exhibition.setSlideTime((int)(DEFAULT_EXHIBITION.getSlideTime() * factor));
                    else
                        this.exhibition.setSlideTime(DEFAULT_EXHIBITION.getSlideTime());
                    break;
                case Setting.KernelSize:
                    if (factor != 1.0)
                        this.TMP_EXHIBIT.setKernelSize(DEFAULT_EXHIBIT.getKernelSize() * factor);
                    else
                        this.TMP_EXHIBIT.setKernelSize(DEFAULT_EXHIBIT.getKernelSize());
                    break;
                case Setting.KernelWeight:
                    if (factor != 1.0)
                        this.TMP_EXHIBIT.setKernelWeight(DEFAULT_EXHIBIT.getKernelWeight() * factor);
                    else
                        this.TMP_EXHIBIT.setKernelWeight(DEFAULT_EXHIBIT.getKernelWeight());
                    break;
                default:
                    break;
            }
        }