Esempio n. 1
0
        public void SetArcheoObjInCol(int choiseSearch, ArcheoObject archeoObj)
        {
            //TODO:  Verschiedene Suchfelder verwenden? Wie nach Code, ImagePfad, Title?
            switch (choiseSearch)
            {
            //0 nach Code, 1 nach Title, 2 nach Pfad
            //Suche nach Code:
            case 0:
                int i = 0;
                foreach (ArcheoObject item in archeoObjectCol)
                {
                    if (item.GetCode().Equals(archeoObj.GetCode()))
                    {
                        //Todo: Setze die Eigenschaft des Objektes und gebe das in die Collection... überschreiben? .. Habe da noch keine Idee.
                        archeoObjectCol.RemoveAt(i);
                        archeoObjectCol.Insert(i, archeoObj);
                    }
                    i++;
                }
                break;

            //suche nach Title:
            case 1:
                i = 0;
                foreach (ArcheoObject item in archeoObjectCol)
                {
                    if (item.GetTitle().Equals(archeoObj.GetTitle()))
                    {
                        //Todo: Setze die Eigenschaft des Objektes und gebe das in die Collection... überschreiben? .. Habe da noch keine Idee.
                        archeoObjectCol.RemoveAt(i);
                        archeoObjectCol.Insert(i, archeoObj);
                    }
                    i++;
                }
                break;

            //Suche nach ImagePfad:
            case 2:
                i = 0;
                foreach (ArcheoObject item in archeoObjectCol)
                {
                    if (item.GetImagelink().Equals(archeoObj.GetImagelink()))
                    {
                        //Todo: Setze die Eigenschaft des Objektes und gebe das in die Collection... überschreiben? .. Habe da noch keine Idee.
                        archeoObjectCol.RemoveAt(i);
                        archeoObjectCol.Insert(i, archeoObj);
                        break;
                    }
                    i++;
                }
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        public ArcheoObject GetArcheoObjFirstFromCol()
        {
            //Todo Das erste Element aus dem ArrayList zurückgeben
            int anzahl = archeoObjectCol.Count;

            if (anzahl < 1)
            {
                return(null);
            }
            //gibt das erste Element zurück
            ArcheoObject archeoObj = (ArcheoObject)archeoObjectCol[0];

            return(archeoObj);
        }
Esempio n. 3
0
        internal void GetBackArcheObjFromCol(ArcheoCatalogDetail archeoDetail)
        {
            int x = archeoObjectCol.LastIndexOf(GetArcheoObjFromCol(archeoDetail.getCode())) - 1;

            try
            {
                ArcheoObject archeoObj = (ArcheoObject)archeoObjectCol[x];
                SetArcheoDetail(archeoObj.GetCode(), archeoDetail);
            }
            catch (Exception)
            {
                Console.WriteLine("Fehler im Index. Element wird nicht gefunden, da die Bilder zwei Mal ");
                //throw;
            }
        }
Esempio n. 4
0
        internal void GetNextArcheObjFromCol(ArcheoCatalogDetail archeoDetail)
        {
            int x = archeoObjectCol.LastIndexOf(GetArcheoObjFromCol(archeoDetail.getCode())) + 1;

            try
            {
                ArcheoObject archeoObj = (ArcheoObject)archeoObjectCol[x];
                SetArcheoDetail(archeoObj.GetCode(), archeoDetail);
            }
            catch (Exception)
            {
                //TODO: Ausnahmefehler OutOIndex Warum erscheinen die Bilder zwei mal in der Liste?
                Console.WriteLine("Fehler im Index. Element wird nicht gefunden, da die Bilder zwei Mal ");
                //throw;
            }
        }
Esempio n. 5
0
        public void SetArcheoObjInCol(int choiseSearch, string title, string code, string typOfBuild, string height, string width, string depth, string typOfCoordinate, string coordinate, string description, string imagelink, string shortPath, string particularities)
        {
            ArcheoObject archeoObj = new ArcheoObject();

            archeoObj.SetCode(code);
            archeoObj.SetCoordinate(coordinate);
            archeoObj.SetDepth(int.Parse(depth));
            archeoObj.SetDescription(description);
            archeoObj.SetHeight(int.Parse(height));
            archeoObj.SetImagelink(imagelink);
            archeoObj.SetParticularities(particularities);
            archeoObj.SetShortPath(shortPath);
            archeoObj.SetTitle(title);
            archeoObj.SetTypOfBuild(typOfBuild);
            archeoObj.SetTypOfCoordinate(typOfCoordinate);
            archeoObj.SetWidth(int.Parse(width));
            SetArcheoObjInCol(choiseSearch, archeoObj);
        }
        public ArcheoCatalogDetail(ProgramCtl programControl, string code)
        {
            InitializeComponent();
            prgCtl = programControl;

            archeoObj = prgCtl.GetArcheoObjFromCol(code);
            //Todo: Select das Element mit dem Code
            //setTitle(archeoObj.GetTitle());
            //setCode(archeoObj.GetCode());
            //setWidth(archeoObj.GetWidth().ToString());
            //setHeight(archeoObj.GetHeight().ToString());
            //setDepth(archeoObj.GetDepth().ToString());
            //setDescription(archeoObj.GetDescription());
            //setCoordinate(archeoObj.GetCoordinate());
            //setParticularities(archeoObj.GetParticularities());
            //setTypeOfBuild(archeoObj.GetTypeOfBuild());
            //SetPictureBox(archeoObj.GetImagelink());
            //setTypeOfCoordinate(archeoObj.GetTypeOfCoordinate());
        }
Esempio n. 7
0
        public void SetArcheoObjInCol(ArcheoObject archeoObj)
        {
            //TODO: suche das Object in der Collection.
            // am Besten nach dem ImageLink Pfad.
            int i = 0;

            foreach (ArcheoObject item in archeoObjectCol)
            {
                if (item.GetImagelink().Equals(archeoObj.GetImagelink()))
                {
                    //Todo: Wie aktualisiere ich ein Object in einer Collection? Best Practise?
                    archeoObjectCol.RemoveAt(i);
                    archeoObjectCol.Insert(i, archeoObj);
                    break;
                }
                i++;
            }
            // Speicher das Object neu ab und am Besten gleich in das XML File

            //aktuallisiere die Ansichten
        }
Esempio n. 8
0
        /// <summary>
        /// create new Archeo Object
        /// </summary>
        /// <param name="title">Title</param>
        /// <param name="code">Code</param>
        /// <param name="typOfBuild">Type of Build</param>
        /// <param name="height">height of object</param>
        /// <param name="width">width of object</param>
        /// <param name="depth">dept of object</param>
        /// <param name="typOfCoordinate">Typ of coordinate</param>
        /// <param name="coordinate">coordinate</param>
        /// <param name="description">Description</param>
        /// <param name="imagelink">image in filesystem</param>
        /// <param name="particularities">particularities</param>
        public void AddArcheoObjectToCol(string title, string code, string typOfBuild, string height, string width, string depth, string typOfCoordinate, string coordinate, string description, string imagelink, string shortPath, string particularities)
        {
            ArcheoObject archeoObj = new ArcheoObject();

            archeoObj.SetTitle(title);
            archeoObj.SetCode(code);
            archeoObj.SetTypOfBuild(typOfBuild);
            //todo Wenn nicht umwandelbarer String, dann 0!
            try
            {
                archeoObj.SetHeight(int.Parse(height));
            }
            catch (Exception)
            {
                archeoObj.SetHeight(0);
            }
            try
            {
                archeoObj.SetWidth(int.Parse(width));
            }
            catch (Exception)
            {
                archeoObj.SetWidth(0);
            }
            try
            {
                archeoObj.SetDepth(int.Parse(depth));
            }
            catch (Exception)
            {
                archeoObj.SetDepth(0);
            }
            archeoObj.SetTypOfCoordinate(typOfCoordinate);
            archeoObj.SetCoordinate(coordinate);
            archeoObj.SetDescription(description);
            archeoObj.SetImagelink(imagelink);
            archeoObj.SetShortPath(shortPath);
            archeoObj.SetParticularities(particularities);
            archeoObjectCol.Add(archeoObj);
        }
Esempio n. 9
0
        private void SetArcheoDetail(string code, ArcheoCatalogDetail archeoDetail)
        {
            ArcheoObject archeoObj = GetArcheoObjFromCol(code);

            //Todo: Select das Element mit dem Code, better
            archeoDetail.setTitle(archeoObj.GetTitle());
            archeoDetail.setCode(archeoObj.GetCode());
            archeoDetail.setWidth(archeoObj.GetWidth().ToString());
            archeoDetail.setHeight(archeoObj.GetHeight().ToString());
            archeoDetail.setDepth(archeoObj.GetDepth().ToString());
            archeoDetail.setDescription(archeoObj.GetDescription());
            archeoDetail.setCoordinate(archeoObj.GetCoordinate());
            archeoDetail.setParticularities(archeoObj.GetParticularities());
            archeoDetail.setTypeOfBuild(archeoObj.GetTypeOfBuild());
            archeoDetail.setTypeOfCoordinate(archeoObj.GetTypeOfCoordinate());
            archeoDetail.SetPictureBox(archeoObj.GetImagelink());
            archeoDetail.setImageLink(archeoObj.GetImagelink());

            archeoDetail.Show();
            archeoDetail.BringToFront();
            archeoDetail.Focus();
            archeoDetail.Activate();
        }
Esempio n. 10
0
 public void AddArcheoObjectToCol(ArcheoObject archeoObj)
 {
     archeoObjectCol.Add(archeoObj);
 }