示例#1
0
        public void InitMuseumGuide()
        {
            MuseumGuideElement e = new MuseumGuideElement
            {
                Caption = "Museum Guide"
            };
            exportToXml.IsEnabled = exportToHtml.IsEnabled = true;
            wmTab.IsEnabled = webTab.IsEnabled = true;
            mtTab.IsEnabled = false;
            mapTab.Visibility = System.Windows.Visibility.Collapsed;

            tabPreview.SelectedIndex = 0;
            workArea.AddElement(e);
        }
示例#2
0
        public void AddElement(ElementType type, Point position)
        {
            Element newElement;
            switch (type)
            {
                case ElementType.Connector:
                    newElement = new Connector();
                    break;

                case ElementType.MuseumGuideApp:
                    newElement= new MuseumGuideElement { Caption = "Museum Guide"};
                    break;

                case ElementType.HistoryPuzzleApp:
                    newElement = new HistoryPuzzleElement { Caption = "History-Puzzle" };
                    break;

                case ElementType.ExcursionGameApp:
                    newElement = new ExcursionGameElement { Caption = "Excursion-Game" };
                    break;

                case ElementType.Prologue:
                    newElement = new PrologueElement();
                    break;

                case ElementType.Mission:
                    newElement = new MissionElement();
                    break;

                case ElementType.Goal:
                    newElement = new GoalElement();
                    break;

                case ElementType.CSound:
                    newElement = new ContextSoundElement();
                    break;

                case ElementType.OracleHint:
                    newElement = new OracleElement();
                    break;

                case ElementType.MissionList:
                    newElement = new MissionListElement();
                    break;

                case ElementType.QuestionsAnswers:
                    newElement = new QuestionElement { Caption = "Q&A" };
                    break;

                case ElementType.Theme:
                    newElement = new ThemeElement() { Caption = "Theme" };
                    break;

                case ElementType.Item:
                    newElement = new PageElement() { Caption = "Item" };
                    break;

                case ElementType.Map:
                    newElement = new MapElement() { Caption = "Map" };
                    break;

                case ElementType.UG_ContentItem:
                    newElement = new AvengersUtd.Explore.Environment.Controls.Elements.UG_Elements.UG_ContentItem() { Caption = "Monument" };
                    break;
                case ElementType.UG_GoalElement:
                    newElement = new AvengersUtd.Explore.Environment.Controls.Elements.UG_Elements.UG_GoalElement() { Caption = "Goal Monument" };
                    break;
                case ElementType.UG_CityElement:
                    if (elementList.Count(x => x is AvengersUtd.Explore.Environment.Controls.Elements.UG_Elements.UG_CityElement) > 0)
                    {
                        MessageBox.Show("Can not insert more than one item for City element");
                        return;
                    }
                    newElement = new AvengersUtd.Explore.Environment.Controls.Elements.UG_Elements.UG_CityElement() { Caption = "City element", Height=300 };
                    break;
                default:
                case ElementType.UG_ResourceElement:
                    newElement = new AvengersUtd.Explore.Environment.Controls.Elements.ResourceElement() { Caption="Resource element"  };
                    newElement.BuildingBlockLabel = "UG";
                    ((AvengersUtd.Explore.Environment.Controls.Elements.ResourceElement)newElement).ResourceRules = new Dictionary<Data.Resources.ResourceType, ResourceRule>();
                    ((AvengersUtd.Explore.Environment.Controls.Elements.ResourceElement)newElement).ResourceRules.Add(Data.Resources.ResourceType.Image, new ResourceRule(Data.Resources.ResourceType.Image, 0, 10));
                    ((AvengersUtd.Explore.Environment.Controls.Elements.ResourceElement)newElement).ResourceRules.Add(Data.Resources.ResourceType.Audio, new ResourceRule(Data.Resources.ResourceType.Audio, 0, 10));
                    ((AvengersUtd.Explore.Environment.Controls.Elements.ResourceElement)newElement).ResourceRules.Add(Data.Resources.ResourceType.Text, new ResourceRule(Data.Resources.ResourceType.Text, 0, 10));
                    ((AvengersUtd.Explore.Environment.Controls.Elements.ResourceElement)newElement).ResourceRules.Add(Data.Resources.ResourceType.Video, new ResourceRule(Data.Resources.ResourceType.Video, 0, 10));

                    break;
                case ElementType.Puzzle:
                    newElement = new PuzzleElement { Caption = "Puzzle" };
                    break;
            }

            SetLeft(newElement, position.X);
            SetTop(newElement, position.Y);

            AddElement(newElement);
        }