private void GinTubBuilderManager_NounRead(object sender, GinTubBuilderManager.NounReadEventArgs args)
 {
     if (ParagraphStateId == args.ParagraphState)
     {
         if (!Items.OfType<ComboBoxItem_Noun>().Any(i => i.NounId == args.Id))
             Items.Add(new ComboBoxItem_Noun(args.Id, args.Text, args.ParagraphState));
     }
 }
 private void GinTubBuilderManager_ActionRead(object sender, GinTubBuilderManager.ActionReadEventArgs args)
 {
     if (NounId == args.Noun)
     {
         if (!Items.OfType<ComboBoxItem_Action>().Any(i => i.ActionId == args.Id))
             Items.Add(new ComboBoxItem_Action(args.Id, args.Noun, args.VerbType, args.Name));
     }
 }
 private void GinTubBuilderManager_RoomRead(object sender, GinTubBuilderManager.RoomReadEventArgs args)
 {
     if (AreaId == args.Area)
     {
         if (!Items.OfType<ComboBoxItem_Room>().Any(i => i.RoomId == args.Id))
             Items.Add(new ComboBoxItem_Room(args.Id, args.Name, args.X, args.Y, args.Z, args.Area));
     }
 }
 private void GinTubBuilderManager_MessageChoiceRead(object sender, GinTubBuilderManager.MessageChoiceReadEventArgs args)
 {
     if (MessageId == args.Message)
     {
         if (!Items.OfType<ComboBoxItem_MessageChoice>().Any(i => i.MessageChoiceId == args.Id))
             Items.Add(new ComboBoxItem_MessageChoice(args.Id, args.Name, args.Text, args.Message));
     }
 }
 private void GinTubBuilderManager_ResultUpdated(object sender, GinTubBuilderManager.ResultUpdatedEventArgs args)
 {
     ComboBoxItem_Result item = Items.OfType<ComboBoxItem_Result>().SingleOrDefault(i => i.ResultId == args.Id);
     if (item != null)
     {
         item.SetResultName(args.Name);
         item.SetResultTypeId(args.ResultType);
     }
 }
 private void GinTubBuilderManager_LocationUpdated(object sender, GinTubBuilderManager.LocationUpdatedEventArgs args)
 {
     ComboBoxItem_Location item = Items.OfType<ComboBoxItem_Location>().SingleOrDefault(i => i.LocationId == args.Id);
     if(item != null)
     {
         item.SetLocationName(args.Name);
         item.SetLocationFile(args.LocationFile);
     }
 }
 private void GinTubBuilderManager_EventUpdated(object sender, GinTubBuilderManager.EventUpdatedEventArgs args)
 {
     ComboBoxItem_Event evnt = Items.OfType<ComboBoxItem_Event>().SingleOrDefault(i => i.EventId == args.Id);
     if (evnt != null)
     {
         evnt.SetEventName(args.Name);
         evnt.SetEventDescription(args.Description);
     }
 }
 private void GinTubBuilderManager_MessageUpdated(object sender, GinTubBuilderManager.MessageUpdatedEventArgs args)
 {
     ComboBoxItem_Message message = Items.OfType<ComboBoxItem_Message>().SingleOrDefault(i => i.MessageId == args.Id);
     if (message != null)
     {
         message.SetMessageName(args.Name);
         message.SetMessageText(args.Text);
     }
 }
 private void GinTubBuilderManager_CharacterUpdated(object sender, GinTubBuilderManager.CharacterUpdatedEventArgs args)
 {
     ComboBoxItem_Character character = Items.OfType<ComboBoxItem_Character>().SingleOrDefault(i => i.CharacterId == args.Id);
     if (character != null)
     {
         character.SetCharacterName(args.Name);
         character.SetCharacterDescription(args.Description);
     }
 }
 private void GinTubBuilderManager_ItemUpdated(object sender, GinTubBuilderManager.ItemUpdatedEventArgs args)
 {
     ComboBoxItem_Item item = Items.OfType<ComboBoxItem_Item>().SingleOrDefault(i => i.ItemId == args.Id);
     if (item != null)
     {
         item.SetItemName(args.Name);
         item.SetItemDescription(args.Description);
     }
 }
 private void GinTubBuilderManager_MessageChoiceRead(object sender, GinTubBuilderManager.MessageChoiceReadEventArgs args)
 {
     if (MessageId == args.Message && !m_stackPanel_messageChoices.Children.OfType<UserControl_MessageChoiceModification>().Any(i => i.MessageChoiceId == args.Id))
     {
         UserControl_MessageChoiceModification grid = new UserControl_MessageChoiceModification(args.Id, args.Name, args.Text, args.Message);
         grid.SetActiveAndRegisterForGinTubEvents();
         m_stackPanel_messageChoices.Children.Add(grid);
         GinTubBuilderManager.ReadAllMessages();
     }
 }
 private void GinTubBuilderManager_VerbRead(object sender, GinTubBuilderManager.VerbReadEventArgs args)
 {
     if (args.VerbType == VerbTypeId && !m_itemsControl_results.Items.OfType<UserControl_VerbModification>().Any(i => i.VerbId == args.Id))
     {
         UserControl_VerbModification grid = new UserControl_VerbModification(args.Id, args.Name, args.VerbType);
         grid.SetActiveAndRegisterForGinTubEvents();
         m_itemsControl_results.Items.Add(grid);
         GinTubBuilderManager.ReadAllVerbTypes();
     }
 }
 private void GinTubBuilderManager_ResultRead(object sender, GinTubBuilderManager.ResultReadEventArgs args)
 {
     if (args.ResultType == ResultTypeId && !m_itemsControl_results.Items.OfType<UserControl_ResultModification>().Any(i => i.ResultId == args.Id))
     {
         UserControl_ResultModification grid = new UserControl_ResultModification(args.Id, args.Name, args.JSONData, args.ResultType);
         grid.SetActiveAndRegisterForGinTubEvents();
         m_itemsControl_results.Items.Add(grid);
         GinTubBuilderManager.ReadAllResultTypes();
         GinTubBuilderManager.ReadAllResultTypeJSONPropertiesForResultType(args.ResultType);
     }
 }
 private void GinTubBuilderManager_NounUpdated(object sender, GinTubBuilderManager.NounUpdatedEventArgs args)
 {
     if (ParagraphStateId == args.ParagraphState)
     {
         ComboBoxItem_Noun item = Items.OfType<ComboBoxItem_Noun>().SingleOrDefault(i => i.NounId == args.Id);
         if (item != null)
         {
             item.SetNounText(args.Text);
             item.SetParagraphStateId(args.ParagraphState);
         }
     }
 }
 private void GinTubBuilderManager_MessageChoiceUpdated(object sender, GinTubBuilderManager.MessageChoiceUpdatedEventArgs args)
 {
     if (MessageId == args.Message)
     {
         ComboBoxItem_MessageChoice item = Items.OfType<ComboBoxItem_MessageChoice>().SingleOrDefault(i => i.MessageChoiceId == args.Id);
         if (item != null)
         {
             item.SetMessageChoiceName(args.Name);
             item.SetMessageChoiceText(args.Text);
             item.SetMessageId(args.Message);
         }
     }
 }
 private void GinTubBuilderManager_ActionUpdated(object sender, GinTubBuilderManager.ActionUpdatedEventArgs args)
 {
     if (NounId == args.Noun)
     {
         ComboBoxItem_Action item = Items.OfType<ComboBoxItem_Action>().SingleOrDefault(i => i.ActionId == args.Id);
         if (item != null)
         {
             item.SetActionVerbType(args.VerbType);
             item.SetActionNoun(args.Noun);
             item.SetActionName(args.Name);
         }
     }
 }
 private void GinTubBuilderManager_RoomUpdated(object sender, GinTubBuilderManager.RoomUpdatedEventArgs args)
 {
     if (AreaId == args.Area)
     {
         ComboBoxItem_Room item = Items.OfType<ComboBoxItem_Room>().SingleOrDefault(i => i.RoomId == args.Id);
         if (item != null)
         {
             item.SetRoomName(args.Name);
             item.SetRoomX(args.X);
             item.SetRoomY(args.Y);
             item.SetRoomZ(args.Z);
             item.SetAreaId(args.Area);
         }
     }
 }
 private void GinTubBuilderManager_ParagraphRead(object sender, GinTubBuilderManager.ParagraphReadEventArgs args)
 {
     if(args.Room == SelectedRoomId)
     {
         m_button_roomAuthoring.Visibility = System.Windows.Visibility.Collapsed;
     }
 }
 private void GinTubBuilderManager_ResultTypeRead(object sender, GinTubBuilderManager.ResultTypeReadEventArgs args)
 {
     if (!Items.OfType<ComboBoxItem_ResultType>().Any(i => i.ResultTypeId == args.Id))
         Items.Add(new ComboBoxItem_ResultType(args.Id, args.Name));
 }
 void GinTubBuilderManager_ItemUpdated(object sender, GinTubBuilderManager.ItemUpdatedEventArgs args)
 {
     if (ItemId == args.Id)
     {
         SetItemName(args.Name);
         SetItemDescription(args.Description);
     }
 }
 private void GinTubBuilderManager_JSONPropertyDataTypeUpdated(object sender, GinTubBuilderManager.JSONPropertyDataTypeUpdatedEventArgs args)
 {
     ComboBoxItem_JSONPropertyDataType item = Items.OfType<ComboBoxItem_JSONPropertyDataType>().SingleOrDefault(i => i.JSONPropertyDataTypeId == args.Id);
     if (item != null)
         item.SetJSONPropertyDataTypeDataType(args.DataType);
 }
 private void GinTubBuilderManager_JSONPropertyDataTypeRead(object sender, GinTubBuilderManager.JSONPropertyDataTypeReadEventArgs args)
 {
     if (!Items.OfType<ComboBoxItem_JSONPropertyDataType>().Any(i => i.JSONPropertyDataTypeId == args.Id))
         Items.Add(new ComboBoxItem_JSONPropertyDataType(args.Id, args.DataType));
 }
 private void GinTubBuilderManager_RoomPreviewParagraphStateSelect(object sender, GinTubBuilderManager.RoomPreviewParagraphStateSelectEventArgs args)
 {
     DisplayParagraphState(args.Text, args.Nouns.Select(n => n.Text));
 }
        private void GinTubBuilderManager_ParagraphRoomStateRead(object sender, GinTubBuilderManager.ParagraphRoomStateReadEventArgs args)
        {
            // Is this the first time we've seen this state?
            // If so, add a group
            UserControl_GroupedParagraphRoomStates userControl =
                m_stackPanel_groupedParagraphRoomStates.Children.OfType<UserControl_GroupedParagraphRoomStates>().FirstOrDefault(x => x.RoomStateState == args.RoomStateState);
            if (ParagraphId == args.Paragraph && userControl == null)
                userControl = AddGroupedParagraphRoomState(args.RoomStateState);

            if (userControl != null && !userControl.RoomStates.Contains(args.RoomStateState))
                userControl.AddParagraphRoomState(args.Id, args.Paragraph, args.Paragraph, args.RoomState, args.RoomStateName, args.RoomStateTime, true);
        }
 private void GinTubBuilderManager_VerbTypeUpdated(object sender, GinTubBuilderManager.VerbTypeUpdatedEventArgs args)
 {
     ComboBoxItem_VerbType item = Items.OfType<ComboBoxItem_VerbType>().SingleOrDefault(i => i.VerbTypeId == args.Id);
     if (item != null)
         item.SetVerbTypeName(args.Name);
 }
 private void GinTubBuilderManager_ParagraphStateRead(object sender, GinTubBuilderManager.ParagraphStateReadEventArgs args)
 {
     if (SelectedParagraphId == args.Paragraph && !m_stackPanel_paragraphStates.Children.OfType<UserControl_ParagraphStateModification>().Any(t => t.ParagraphStateId == args.Id))
     {
         UserControl_ParagraphStateModification grid = new UserControl_ParagraphStateModification(args.Id, args.Text, args.State, args.Paragraph);
         m_stackPanel_paragraphStates.Children.Add(grid);
     }
 }
        private void GinTubBuilderManager_ParagraphRead(object sender, GinTubBuilderManager.ParagraphReadEventArgs args)
        {
            if (!m_stackPanel_paragraphs.Children.OfType<UserControl_Bordered_ParagraphWithPreview>().Any(t => t.ParagraphId == args.Id))
            {
                UserControl_Bordered_ParagraphWithPreview border = new UserControl_Bordered_ParagraphWithPreview(args.Id, args.Order, args.Room, false);
                border.MouseLeftButtonDown += UserControl_ParagraphWithPreview_MouseLeftButtonDown;
                border.SetActiveAndRegisterForGinTubEvents();
                m_stackPanel_paragraphs.Children.Add(border);

                GinTubBuilderManager.ReadParagraphStateForParagraphPreview(0, args.Id);
            }
        }
 private void GinTubBuilderManager_RoomStateRead(object sender, GinTubBuilderManager.RoomStateReadEventArgs args)
 {
     if(SelectedRoomId == args.Room && !m_stackPanel_roomStates.Children.OfType<UserControl_RoomStateModification>().Any(x => x.RoomStateId == args.Id))
         CreateRoomState(args.Id, args.State, args.Time, args.Location, args.Room);
 }
 private void GinTubBuilderManager_AreaUpdated(object sender, GinTubBuilderManager.AreaUpdatedEventArgs args)
 {
     if (AreaId == args.Id)
     {
         SetAreaName(args.Name);
         SetAreaDisplayTime(args.DisplayTime);
         SetAreaAudio(args.Audio);
     }
 }
 private void GinTubBuilderManager_RoomPreviewNounSelect(object sender, GinTubBuilderManager.RoomPreviewNounSelectEventArgs args)
 {
     throw new NotImplementedException();
 }