Пример #1
0
        private void lboxSubMenuLevel2_DragDrop(object sender, DragEventArgs e)
        {
            formStreamedMpEditor.subMenuItem subItem = new formStreamedMpEditor.subMenuItem();

              if (e.Data.GetDataPresent(DataFormats.StringFormat))
              {
            int index = int.Parse((string)e.Data.GetData(DataFormats.StringFormat));

            formStreamedMpEditor.menuItems[menuIndex].subMenuLevel1ID = (formStreamedMpEditor.menuItems[menuIndex].id - 999) * 10000;

            SubItemProperties itemProperties = new SubItemProperties(formStreamedMpEditor.pluginTakesParameter(ids[index]), ids[index]);

            if (xmlFilesDisplayed)
            {
              itemProperties.ShowDialog();
              subItem.displayName = itemProperties.DisplayName;
              subItem.xmlFileName = rawXMLFileNames[index];
              subItem.hyperlink = ids[index];
            }
            else
            {
              subItem.displayName = formStreamedMpEditor.prettyItems[index].name;
              subItem.xmlFileName = formStreamedMpEditor.prettyItems[index].xmlfile;
              subItem.hyperlink = formStreamedMpEditor.prettyItems[index].id;
              subItem.hyperlinkParameter = formStreamedMpEditor.prettyItems[index].pluginParmeter;
            }
              }
              formStreamedMpEditor.changeOutstanding = true;
              subItem.baseDisplayName = subItem.displayName;
              subMenuLevel2.Add(subItem);
              lboxSubMenuLevel2.Items.Add(subItem.displayName);
        }
Пример #2
0
        void ItemTwoProperties()
        {
            formStreamedMpEditor.changeOutstanding = false;
              if (lboxSubMenuLevel2.SelectedIndex != -1)
              {
            int index = lboxSubMenuLevel2.SelectedIndex;

            SubItemProperties itemProperties = new SubItemProperties(formStreamedMpEditor.pluginTakesParameter(subMenuLevel2[index].hyperlink), subMenuLevel2[index].hyperlink);

            itemProperties.DisplayName = subMenuLevel2[index].displayName;
            switch (subMenuLevel2[index].hyperlink)
            {
              case formStreamedMpEditor.tvseriesSkinID:
            itemProperties.tvseriesHypelinkParameter = subMenuLevel2[index].hyperlinkParameter;
            break;
              case formStreamedMpEditor.musicSkinID:
            itemProperties.musicHypelinkParameter = subMenuLevel2[index].hyperlinkParameter;
            break;
              case formStreamedMpEditor.onlineVideosSkinID:
            itemProperties.onlineVideosHypelinkParameter = subMenuLevel2[index].hyperlinkParameter;
            itemProperties.onlineVideosReturnOption = subMenuLevel2[index].hyperlinkParameterOption;
            itemProperties.onlineVideosSearchString = subMenuLevel2[index].hyperlinkParameterSearch;
            itemProperties.onlinevideosHyperlinkCategory = subMenuLevel2[index].hyperlinkParameterCategory;
            break;
              case formStreamedMpEditor.movingPicturesSkinID:
            itemProperties.movingPicturesHyperlinkParmeter = subMenuLevel2[index].hyperlinkParameter;
            break;
            }
            itemProperties.BaseName = subMenuLevel2[index].baseDisplayName;
            itemProperties.initialIndex = index;
            itemProperties.ShowDialog();

            if (itemProperties.DisplayName != subMenuLevel2[index].displayName)
            {
              if (!formStreamedMpEditor.changeOutstanding)
            subMenuLevel2[index].displayName = itemProperties.DisplayName;
              formStreamedMpEditor.changeOutstanding = true;
            }
            //
            // Only do this part if we care about hyperlink parameters
            //
            if (formStreamedMpEditor.pluginTakesParameter(subMenuLevel2[index].hyperlink))
            {
              //TvSeries
              if (subMenuLevel2[index].hyperlink == formStreamedMpEditor.tvseriesSkinID)
              {
            if (string.IsNullOrEmpty(itemProperties.tvseriesHypelinkParameter) || itemProperties.tvseriesHypelinkParameter == "false")
            {
              subMenuLevel2[index].hyperlinkParameter = "false";
              if (!formStreamedMpEditor.changeOutstanding)
                subMenuLevel2[index].displayName = subMenuLevel2[index].baseDisplayName;
              formStreamedMpEditor.changeOutstanding = true;
            }
            else if (formStreamedMpEditor.pluginTakesParameter(subMenuLevel2[index].hyperlink))
            {
              subMenuLevel2[index].hyperlinkParameter = itemProperties.tvseriesHypelinkParameter;
              formStreamedMpEditor.changeOutstanding = true;
            }
              }
              //Music
              if (subMenuLevel2[index].hyperlink == formStreamedMpEditor.musicSkinID)
              {
            if (string.IsNullOrEmpty(itemProperties.musicHypelinkParameter) || itemProperties.musicHypelinkParameter == "false")
            {
              subMenuLevel2[index].hyperlinkParameter = "false";
              if (!formStreamedMpEditor.changeOutstanding)
                subMenuLevel2[index].displayName = subMenuLevel2[index].baseDisplayName;
              formStreamedMpEditor.changeOutstanding = true;
            }
            else if (formStreamedMpEditor.pluginTakesParameter(subMenuLevel2[index].hyperlink))
            {
              subMenuLevel2[index].hyperlinkParameter = itemProperties.musicHypelinkParameter;
              formStreamedMpEditor.changeOutstanding = true;
            }
              }
              //Onlinevideos
              if (subMenuLevel2[index].hyperlink == formStreamedMpEditor.onlineVideosSkinID)
              {
            if (string.IsNullOrEmpty(itemProperties.onlineVideosHypelinkParameter) || itemProperties.onlineVideosHypelinkParameter == "false")
            {
              subMenuLevel2[index].hyperlinkParameter = "false";
              if (!formStreamedMpEditor.changeOutstanding)
                subMenuLevel2[index].displayName = subMenuLevel2[index].baseDisplayName;
              formStreamedMpEditor.changeOutstanding = true;
            }
            else if (formStreamedMpEditor.pluginTakesParameter(subMenuLevel2[index].hyperlink))
            {
              subMenuLevel2[index].hyperlinkParameter = itemProperties.onlineVideosHypelinkParameter;
              subMenuLevel2[index].hyperlinkParameterOption = itemProperties.onlineVideosReturnOption;
              subMenuLevel2[index].hyperlinkParameterSearch = itemProperties.onlineVideosSearchString;
              subMenuLevel2[index].hyperlinkParameterCategory = itemProperties.onlinevideosHyperlinkCategory;
              formStreamedMpEditor.changeOutstanding = true;
            }
              }
              //MovingPictures
              if (subMenuLevel2[index].hyperlink == formStreamedMpEditor.movingPicturesSkinID)
              {
            if (string.IsNullOrEmpty(itemProperties.movingPicturesHyperlinkParmeter) || itemProperties.movingPicturesHyperlinkParmeter == "false")
            {
              subMenuLevel2[index].hyperlinkParameter = "false";
              if (!formStreamedMpEditor.changeOutstanding)
                subMenuLevel2[index].displayName = subMenuLevel2[index].baseDisplayName;
              formStreamedMpEditor.changeOutstanding = true;
            }
            else if (formStreamedMpEditor.pluginTakesParameter(subMenuLevel2[index].hyperlink))
            {
              subMenuLevel2[index].hyperlinkParameter = itemProperties.movingPicturesHyperlinkParmeter;
              formStreamedMpEditor.changeOutstanding = true;
            }
              }
            }
            // Refresh the listbox, only way to do this is clear re-populate.
            if (formStreamedMpEditor.changeOutstanding)
            {
              lboxSubMenuLevel2.Items.Clear();
              for (int i = 0; i < subMenuLevel2.Count; i++)
              {
            lboxSubMenuLevel2.Items.Add(subMenuLevel2[i].displayName);
              }
            }
              }
        }