public void setEnableState(formStreamedMpEditor.displayMostRecent overlayType, bool state) { switch (overlayType) { case formStreamedMpEditor.displayMostRecent.tvSeries: rbSubTVSeries.Enabled = state; rbSubTVSeries.Checked = state; break; case formStreamedMpEditor.displayMostRecent.movies: rbSubMovies.Enabled = state; rbSubMovies.Checked = state; break; case formStreamedMpEditor.displayMostRecent.music: rbSubMusic.Enabled = state; rbSubMusic.Checked = state; break; case formStreamedMpEditor.displayMostRecent.recordedTV: rbSubTV.Enabled = state; rbSubTV.Checked = state; break; case formStreamedMpEditor.displayMostRecent.musicVideos: rbSubMusicVideos.Enabled = state; rbSubMusicVideos.Checked = state; break; case formStreamedMpEditor.displayMostRecent.freeDriveSpace: rbSubFreeDriveSpace.Enabled = state; rbSubFreeDriveSpace.Checked = state; break; case formStreamedMpEditor.displayMostRecent.powerControl: rbSubPowerControl.Enabled = state; rbSubPowerControl.Checked = state; break; case formStreamedMpEditor.displayMostRecent.sleepControl: rbSubSleepControl.Enabled = state; rbSubSleepControl.Checked = state; break; case formStreamedMpEditor.displayMostRecent.stocks: rbSubStocks.Enabled = state; rbSubStocks.Checked = state; break; case formStreamedMpEditor.displayMostRecent.htpcInfo: rbSubHtpcInfo.Enabled = state; rbSubHtpcInfo.Checked = state; break; case formStreamedMpEditor.displayMostRecent.updateControl: rbSubUpdateControl.Enabled = state; rbSubUpdateControl.Checked = state; break; default: rbSubOff.Checked = true; break; } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); formStreamedMpEditor appStart = new formStreamedMpEditor(); if (args.Length != 0) { if (args[0].ToLower().Contains("regenerateonly")) appStart.reGenerateMenu(true); } else appStart.ShowPlugin(); }
string writeSubMenuLevel1V(formStreamedMpEditor.menuItem parentMenu) { string dummyFocusControls = "Control.HasFocus("; int isSecondLevel = 0; if (parentMenu.subMenuLevel2.Count > 0) isSecondLevel = 100; for (int i = 0; i < parentMenu.subMenuLevel1.Count; i++) { if (i < (parentMenu.subMenuLevel1.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")|Control.HasFocus("; else if (parentMenu.subMenuLevel2.Count == 0) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")"; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")|Control.HasFocus("; } if (parentMenu.subMenuLevel2.Count > 0) { for (int i = 0; i < parentMenu.subMenuLevel2.Count; i++) { if (i < (parentMenu.subMenuLevel2.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")|Control.HasFocus("; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")"; } } localxml += "<control>" + "<description>dummy for lateral blade visibility</description>" + "<type>label</type>" + "<id>" + parentMenu.subMenuLevel1ID.ToString() + "</id>" + "<label></label>" + "<visible>" + dummyFocusControls + "</visible>" + "</control>" + "<control>" + "<type>group</type>" + "<description>group element</description>" + "<animation effect=\"fade\" time=\"200\" delay=\"400\">WindowOpen</animation>" + "<animation effect=\"fade\" time=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" time=\"200\">visible</animation>" + "<animation effect=\"fade\" time=\"200\">hidden</animation>" + "<posX>" + (int.Parse(txtMenuPos.Text) - 5).ToString() + "</posX>" + "<posY>325</posY>" + "<width>225</width>" + "<height>405</height>" + "<dimColor>ffffffff</dimColor>" + "<layout>StackLayout</layout>"; for (int j = 0; j < parentMenu.subMenuLevel1.Count; j++) { onup = (parentMenu.subMenuLevel1ID + (j)).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 2)).ToString(); if (j == 0) { onup = (parentMenu.subMenuLevel1ID + parentMenu.subMenuLevel1.Count).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 2)).ToString(); } if (j == (parentMenu.subMenuLevel1.Count - 1)) { onup = (parentMenu.subMenuLevel1ID + j).ToString(); ondown = (parentMenu.subMenuLevel1ID + 1).ToString(); } localxml += "<control Style=\"settingsbutton\">" + "<description>SUB ITEM " + j.ToString() + "</description>" + "<type>button</type>" + "<id>" + (parentMenu.subMenuLevel1ID + (j + 1)).ToString() + "</id>" + "<label>" + parentMenu.subMenuLevel1[j].displayName + "</label>" + "<width>225</width>"; if (parentMenu.subMenuLevel1[j].hyperlink == "196299") localxml += "<action>99</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == "196297") localxml += "<action>97</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == "196250") localxml += "<action>196250</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == formStreamedMpEditor.musicSkinID && parentMenu.subMenuLevel1[j].hyperlinkParameter != "false") localxml += "<hyperlink>504</hyperlink>"; else localxml += "<hyperlink>" + parentMenu.subMenuLevel1[j].hyperlink + "</hyperlink>"; //Plugin Parameter handling if (parentMenu.subMenuLevel1[j].hyperlinkParameter != "false") { switch (parentMenu.subMenuLevel1[j].hyperlink) { case onlineVideosSkinID: if (!IsOnlineVideosGroup(parentMenu.subMenuLevel1[j].hyperlinkParameter)) { string search = string.IsNullOrEmpty(parentMenu.subMenuLevel1[j].hyperlinkParameterSearch) ? string.Empty : "|search:" + parentMenu.subMenuLevel1[j].hyperlinkParameterSearch; string category = string.IsNullOrEmpty(parentMenu.subMenuLevel1[j].hyperlinkParameterCategory) ? string.Empty : "|category:" + parentMenu.subMenuLevel1[j].hyperlinkParameterCategory; localxml += "<hyperlinkParameter>site:" + parentMenu.subMenuLevel1[j].hyperlinkParameter + category + search + "|return:" + parentMenu.subMenuLevel1[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } else { localxml += "<hyperlinkParameter>group:" + parentMenu.subMenuLevel1[j].hyperlinkParameter.Substring(7) + "|return:" + parentMenu.subMenuLevel1[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } break; case movingPicturesSkinID: localxml += "<hyperlinkParameter>categoryid:" + parentMenu.subMenuLevel1[j].hyperlinkParameter + "</hyperlinkParameter>"; break; default: localxml += "<hyperlinkParameter>" + parentMenu.subMenuLevel1[j].hyperlinkParameter + "</hyperlinkParameter>"; break; } } // Right arrow to 2nd level menu or exit/shutdown/restart.. menu if (cbExitStyleNew.Checked || parentMenu.subMenuLevel2.Count > 0) rightArrowValue = (parentMenu.subMenuLevel1ID + (1 + isSecondLevel)).ToString(); else rightArrowValue = "7777"; localxml += "<onleft>" + (parentMenu.id + 900).ToString() + "</onleft>" + "<onright>" + rightArrowValue + "</onright>" + "<ondown>" + ondown + "</ondown>" + "<onup>" + onup + "</onup>" + "<visible allowhiddenfocus=\"true\">control.isvisible(" + parentMenu.subMenuLevel1ID.ToString() + ")</visible>" + "</control>"; } localxml += "</control>"; // main level indocation arrow subArrowVisible = "control.isvisible(11111)|Control.HasFocus("; foreach (menuItem item in menuItems) { if (item.subMenuLevel1ID != 0) subArrowVisible += (item.id + 700).ToString() + ")|control.hasfocus(" + (item.id + 800).ToString() + ")|control.hasfocus(" + (item.id + 900).ToString() + ")|control.hasfocus("; } subArrowVisible = subArrowVisible.Substring(0, (subArrowVisible.Length - 18)); localxml += "<control>" + "<description>Sub Menu Indicator (Main)</description>" + "<type>image</type>" + "<posX>" + (int.Parse(txtMenuPos.Text) - 27).ToString() + "</posX>" + "<posY>330</posY>" + "<align>right</align>" + "<width>16</width>" + "<height>16</height>" + "<visible>" + subArrowVisible + "</visible>" + "<texture>arrowrightfo.png</texture>" + "<colordiffuse>77ffffff</colordiffuse>" + "<animation effect=\"fade\" time=\"400\">Visible</animation>" + "<animation effect=\"fade\" time=\"400\" delay=\"400\">WindowOpen</animation>" + "<animation effect=\"slide\" end=\"-400,0\" tween=\"quadratic\" easing=\"in\" time=\" 400\" delay=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" time=\"400\">WindowClose</animation>" + "</control>"; // 2nd level indicator arrow subArrowVisible = "control.isvisible(22222)|control.hasfocus("; foreach (menuItem item in menuItems) { if (item.subMenuLevel1ID != 0) if (item.subMenuLevel2.Count > 0) { for (int i = 0; i < item.subMenuLevel1.Count; i++) { subArrowVisible += (item.subMenuLevel1ID + (i + 1)).ToString() + ")|control.hasfocus("; } } } subArrowVisible = subArrowVisible.Substring(0, (subArrowVisible.Length - 18)); localxml += "<control>" + "<description>Sub Menu Indicator (Level1)</description>" + "<type>image</type>" + "<posX>" + (int.Parse(txtMenuPos.Text) + 195).ToString() + "</posX>" + "<posY>338</posY>" + "<align>right</align>" + "<width>16</width>" + "<height>16</height>" + "<visible>" + subArrowVisible + "</visible>" + "<texture>arrowrightfo.png</texture>" + "<colordiffuse>77ffffff</colordiffuse>" + "<animation effect=\"fade\" time=\"400\">Visible</animation>" + "<animation effect=\"fade\" time=\"400\" delay=\"400\">WindowOpen</animation>" + "<animation effect=\"slide\" end=\"-400,0\" tween=\"quadratic\" easing=\"in\" time=\" 400\" delay=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" time=\"400\">WindowClose</animation>" + "</control>"; return localxml; }
string writeSubMenuLevel2V(formStreamedMpEditor.menuItem parentMenu) { string dummyFocusControls = "Control.HasFocus("; for (int i = 0; i < parentMenu.subMenuLevel2.Count; i++) { if (i < (parentMenu.subMenuLevel2.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")|Control.HasFocus("; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")"; } localxml += "<control>" + "<description>dummy for lateral blade visibility</description>" + "<type>label</type>" + "<id>" + (parentMenu.subMenuLevel1ID + 100).ToString() + "</id>" + "<label></label>" + "<visible>" + dummyFocusControls + "</visible>" + "</control>" + "<control>" + "<type>group</type>" + "<description>group element</description>" + "<animation effect=\"fade\" time=\"200\" delay=\"400\">WindowOpen</animation>" + "<animation effect=\"fade\" time=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" time=\"200\">visible</animation>" + "<animation effect=\"fade\" time=\"200\">hidden</animation>" + "<posX>" + (int.Parse(txtMenuPos.Text) + 226).ToString() + "</posX>" + "<posY>325</posY>" + "<width>225</width>" + "<height>405</height>" + "<dimColor>ffffffff</dimColor>" + "<layout>StackLayout</layout>"; for (int j = 0; j < parentMenu.subMenuLevel2.Count; j++) { onup = (parentMenu.subMenuLevel1ID + (j + 100)).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 102)).ToString(); if (j == 0) { onup = (parentMenu.subMenuLevel1ID + parentMenu.subMenuLevel2.Count).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 102)).ToString(); } if (j == (parentMenu.subMenuLevel2.Count - 1)) { onup = (parentMenu.subMenuLevel1ID + 100 + j).ToString(); ondown = (parentMenu.subMenuLevel1ID + 101).ToString(); } localxml += "<control Style=\"settingsbutton\">" + "<description>SUB ITEM " + j.ToString() + "</description>" + "<type>button</type>" + "<id>" + (parentMenu.subMenuLevel1ID + (j + 101)).ToString() + "</id>" + "<label>" + parentMenu.subMenuLevel2[j].displayName + "</label>" + "<width>225</width>"; if (parentMenu.subMenuLevel2[j].hyperlink == "196299") localxml += "<action>99</action>"; else if (parentMenu.subMenuLevel2[j].hyperlink == "196297") localxml += "<action>97</action>"; else if (parentMenu.subMenuLevel2[j].hyperlink == "196250") localxml += "<action>196250</action>"; else if (parentMenu.subMenuLevel2[j].hyperlink == formStreamedMpEditor.musicSkinID && parentMenu.subMenuLevel2[j].hyperlinkParameter != "false") localxml += "<hyperlink>504</hyperlink>"; else localxml += "<hyperlink>" + parentMenu.subMenuLevel2[j].hyperlink + "</hyperlink>"; //Plugin Parameter handling if (parentMenu.subMenuLevel2[j].hyperlinkParameter != "false") { switch (parentMenu.subMenuLevel2[j].hyperlink) { case onlineVideosSkinID: if (!IsOnlineVideosGroup(parentMenu.subMenuLevel2[j].hyperlinkParameter)) { string search = string.IsNullOrEmpty(parentMenu.subMenuLevel2[j].hyperlinkParameterSearch) ? string.Empty : "|search:" + parentMenu.subMenuLevel2[j].hyperlinkParameterSearch; string category = string.IsNullOrEmpty(parentMenu.subMenuLevel2[j].hyperlinkParameterCategory) ? string.Empty : "|category:" + parentMenu.subMenuLevel2[j].hyperlinkParameterCategory; localxml += "<hyperlinkParameter>site:" + parentMenu.subMenuLevel2[j].hyperlinkParameter + category + search + "|return:" + parentMenu.subMenuLevel2[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } else { localxml += "<hyperlinkParameter>group:" + parentMenu.subMenuLevel2[j].hyperlinkParameter.Substring(7) + "|return:" + parentMenu.subMenuLevel2[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } break; case movingPicturesSkinID: localxml += "<hyperlinkParameter>categoryid:" + parentMenu.subMenuLevel2[j].hyperlinkParameter + "</hyperlinkParameter>"; break; default: localxml += "<hyperlinkParameter>" + parentMenu.subMenuLevel2[j].hyperlinkParameter + "</hyperlinkParameter>"; break; } } if (cbExitStyleNew.Checked) rightArrowValue = (parentMenu.subMenuLevel1ID + (j + 101)).ToString(); else rightArrowValue = "7777"; localxml += "<onleft>" + (parentMenu.subMenuLevel1ID + (1)).ToString() + "</onleft>" + "<onright>" + rightArrowValue + "</onright>" + "<ondown>" + ondown + "</ondown>" + "<onup>" + onup + "</onup>" + "<visible allowhiddenfocus=\"true\">control.isvisible(" + (parentMenu.subMenuLevel1ID + 100).ToString() + ")</visible>" + "</control>"; } localxml += "</control>"; return localxml; }
public DialogResult showError(string errorText, formStreamedMpEditor.errorCode errorType) { DialogResult rtype = new DialogResult(); switch (errorType) { case formStreamedMpEditor.errorCode.info: MessageBox.Show(errorText, "Click OK to continue.", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); break; case formStreamedMpEditor.errorCode.infoQuestion: return MessageBox.Show(errorText, "Continue Editing", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); case formStreamedMpEditor.errorCode.loadError: MessageBox.Show("Error loading menu, file seems invalid\r\rReason: " + errorText + " ", "Click OK to continue.", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); break; case formStreamedMpEditor.errorCode.readError: MessageBox.Show("Error loading menu, file seems invalid\r\rReason: " + errorText + " ", "Click OK to continue.", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); break; case formStreamedMpEditor.errorCode.major: MessageBox.Show(errorText + "\r\rEditor will now terminate.", "Click OK to Exit", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); Application.Exit(); break; } return rtype; }
private void setMostRecent(formStreamedMpEditor.displayMostRecent rbSetting) { switch (rbSetting) { case formStreamedMpEditor.displayMostRecent.off: rbSubOff.Checked = true; break; case formStreamedMpEditor.displayMostRecent.tvSeries: rbSubTVSeries.Checked = true; break; case formStreamedMpEditor.displayMostRecent.movies: rbSubMovies.Checked = true; break; case formStreamedMpEditor.displayMostRecent.music: rbSubMusic.Checked = true; break; case formStreamedMpEditor.displayMostRecent.recordedTV: rbSubTV.Checked = true; break; case formStreamedMpEditor.displayMostRecent.musicVideos: rbSubMusicVideos.Checked = true; break; case formStreamedMpEditor.displayMostRecent.freeDriveSpace: rbSubFreeDriveSpace.Checked = true; break; case formStreamedMpEditor.displayMostRecent.powerControl: rbSubPowerControl.Checked = true; break; case formStreamedMpEditor.displayMostRecent.sleepControl: rbSubSleepControl.Checked = true; break; case formStreamedMpEditor.displayMostRecent.stocks: rbSubStocks.Checked = true; break; case formStreamedMpEditor.displayMostRecent.htpcInfo: rbSubHtpcInfo.Checked = true; break; case formStreamedMpEditor.displayMostRecent.updateControl: rbSubUpdateControl.Checked = true; break; } }
string writeSubMenuLevel1H(formStreamedMpEditor.menuItem parentMenu) { string dummyFocusControls = "Control.HasFocus("; int isSecondLevel = 0; if (menuStyle != chosenMenuStyle.verticalStyle && horizontalContextLabels.Checked) conextOffsett = 26; if (enableTwitter.Checked) conextOffsett += 43; if (parentMenu.subMenuLevel2.Count > 0) isSecondLevel = 100; for (int i = 0; i < parentMenu.subMenuLevel1.Count; i++) { if (i < (parentMenu.subMenuLevel1.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")|Control.HasFocus("; else if (parentMenu.subMenuLevel2.Count == 0) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")"; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")|Control.HasFocus("; } if (parentMenu.subMenuLevel2.Count > 0) { for (int i = 0; i < parentMenu.subMenuLevel2.Count; i++) { if (i < (parentMenu.subMenuLevel2.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")|Control.HasFocus("; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")"; } } localxml += "<control>" + "<description>dummy for lateral blade visibility</description>" + "<type>label</type>" + "<id>" + parentMenu.subMenuLevel1ID.ToString() + "</id>" + "<label></label>" + "<visible>" + dummyFocusControls + "</visible>" + "</control>" + "<control>" + "<type>group</type>" + "<description>group element</description>" + "<animation effect=\"fade\" time=\"200\" start=\"0\" end=\"100\">visible</animation>" + "<animation effect=\"fade\" time=\"200\" start=\"100\" end=\"0\">hidden</animation>" + "<animation effect=\"fade\" start=\"100\" end=\"0\" time=\"400\" delay=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"400\" delay=\"200\">WindowOpen</animation>" + "<animation effect=\"zoom\" start=\"10,10\" end=\"100,100\" center=\"960," + (int.Parse(txtMenuPos.Text) - 383 + 188).ToString() + "\" time=\"200\">Visible</animation>" + "<animation effect=\"zoom\" start=\"100,100\" end=\"10,10\" center=\"960," + (int.Parse(txtMenuPos.Text) - 383 + 188).ToString() + "\" time=\"200\">Hidden</animation>" + "<posX>780</posX>" + "<posY>" + (int.Parse(txtMenuPos.Text) - 533 - conextOffsett).ToString() + "</posY>" + "<width>345</width>" + "<height>608</height>" + "<dimColor>ffffffff</dimColor>" + "<layout>StackLayout</layout>"; for (int j = 0; j < parentMenu.subMenuLevel1.Count; j++) { onup = (parentMenu.subMenuLevel1ID + (j)).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 2)).ToString(); if (j == 0) { onup = (parentMenu.subMenuLevel1ID + parentMenu.subMenuLevel1.Count).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 2)).ToString(); } if (j == (parentMenu.subMenuLevel1.Count - 1)) { onup = (parentMenu.subMenuLevel1ID + j).ToString(); ondown = (parentMenu.id + 900).ToString(); } localxml += "<control Style=\"settingsbutton\">" + "<description>SUB ITEM " + j.ToString() + "</description>" + "<type>button</type>" + "<id>" + (parentMenu.subMenuLevel1ID + (j + 1)).ToString() + "</id>" + "<label>" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel1[j].displayName) + "</label>" + "<width>369</width>"; if (parentMenu.subMenuLevel1[j].hyperlink == "196299") localxml += "<action>99</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == "196297") localxml += "<action>97</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == "196250") localxml += "<action>196250</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == formStreamedMpEditor.musicSkinID && parentMenu.subMenuLevel1[j].hyperlinkParameter != "false") localxml += "<hyperlink>504</hyperlink>"; else localxml += "<hyperlink>" + parentMenu.subMenuLevel1[j].hyperlink + "</hyperlink>"; //Plugin Parameter handling if (parentMenu.subMenuLevel1[j].hyperlinkParameter != "false") { switch (parentMenu.subMenuLevel1[j].hyperlink) { case onlineVideosSkinID: if (!IsOnlineVideosGroup(parentMenu.subMenuLevel1[j].hyperlinkParameter)) { string search = string.IsNullOrEmpty(parentMenu.subMenuLevel1[j].hyperlinkParameterSearch) ? string.Empty : "|search:" + parentMenu.subMenuLevel1[j].hyperlinkParameterSearch; string category = string.IsNullOrEmpty(parentMenu.subMenuLevel1[j].hyperlinkParameterCategory) ? string.Empty : "|category:" + parentMenu.subMenuLevel1[j].hyperlinkParameterCategory; localxml += "<hyperlinkParameter>site:" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel1[j].hyperlinkParameter + category + search) + "|return:" + parentMenu.subMenuLevel1[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } else { localxml += "<hyperlinkParameter>group:" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel1[j].hyperlinkParameter.Substring(7)) + "|return:" + parentMenu.subMenuLevel1[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } break; case movingPicturesSkinID: localxml += "<hyperlinkParameter>categoryid:" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel1[j].hyperlinkParameter) + "</hyperlinkParameter>"; break; default: localxml += "<hyperlinkParameter>" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel1[j].hyperlinkParameter) + "</hyperlinkParameter>"; break; } } localxml += "<onleft>" + (parentMenu.id + 900).ToString() + "</onleft>" + "<onright>" + (parentMenu.subMenuLevel1ID + (1 + isSecondLevel)).ToString() + "</onright>" + "<ondown>" + ondown + "</ondown>" + "<onup>" + onup + "</onup>" + "<visible allowhiddenfocus=\"true\">control.isvisible(" + parentMenu.subMenuLevel1ID.ToString() + ")</visible>" + "</control>"; } localxml += "</control>"; // Main Level menu Indicator subArrowVisible = "control.isvisible(11111)|Control.HasFocus("; foreach (menuItem item in menuItems) { if (item.subMenuLevel1ID != 0) subArrowVisible += (item.id + 700).ToString() + ")|control.hasfocus(" + (item.id + 800).ToString() + ")|control.hasfocus(" + (item.id + 900).ToString() + ")|control.hasfocus("; } subArrowVisible = subArrowVisible.Substring(0, (subArrowVisible.Length - 18)); localxml += "<control>" + "<description>Sub Menu Indicator (Main)</description>" + "<type>image</type>" + "<posX>948</posX>" + "<posY>" + (int.Parse(txtMenuPos.Text) + 11 - (conextOffsett + 20)).ToString() + "</posY>" + "<align>right</align>" + "<width>24</width>" + "<height>24</height>" + "<visible>" + subArrowVisible + "</visible>" + "<colorDiffuse>77fffffff</colorDiffuse>" + "<texture>arrowupfo.png</texture>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"800\" reversible=\"false\">WindowOpen</animation>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"250\" delay=\"700\" reversible=\"false\">Visible</animation>" + "<animation effect=\"slide\" end=\"0,450\" time=\"250\" acceleration=\" -0.1\" reversible=\"false\">windowclose</animation>" + "</control>"; // 2nd Level Menu Indicator subArrowVisible = "control.isvisible(22222)|control.hasfocus("; foreach (menuItem item in menuItems) { if (item.subMenuLevel1ID != 0) if (item.subMenuLevel2.Count > 0) { for (int i = 0; i < item.subMenuLevel1.Count; i++) { subArrowVisible += (item.subMenuLevel1ID + (i + 1)).ToString() + ")|control.hasfocus("; } } } subArrowVisible = subArrowVisible.Substring(0, (subArrowVisible.Length - 18)); localxml += "<control>" + "<description>Sub Menu Indicator (Level1)</description>" + "<type>image</type>" + "<posX>1125</posX>" + "<posY>" + (int.Parse(txtMenuPos.Text) - 510 - conextOffsett).ToString() + "</posY>" + "<align>right</align>" + "<width>24</width>" + "<height>24</height>" + "<visible>" + subArrowVisible + "</visible>" + "<colorDiffuse>77fffffff</colorDiffuse>" + "<texture>arrowrightfo.png</texture>" + "<animation effect=\"slide\" start=\"-600,0\" end=\"0,0\" tween=\"quadratic\" easing=\"in\" time=\"400\" delay=\"200\">WindowOpen</animation>" + "<animation effect=\"slide\" end=\"-600,0\" tween=\"quadratic\" easing=\"in\" time=\"400\" delay=\"200\">WindowClose</animation>" + "</control>"; return localxml; }
/// <summary> /// Write out Sunmenu Level 1 /// </summary> /// <param name="parentMenu"></param> /// <returns></returns> string writeSubMenuLevel1Graphical(formStreamedMpEditor.menuItem parentMenu) { string dummyFocusControls = "Control.HasFocus("; for (int i = 0; i < parentMenu.subMenuLevel1.Count; i++) { if (i < (parentMenu.subMenuLevel1.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")|Control.HasFocus("; else if (parentMenu.subMenuLevel2.Count == 0) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")"; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 1)).ToString() + ")|Control.HasFocus("; } if (parentMenu.subMenuLevel2.Count > 0) { for (int i = 0; i < parentMenu.subMenuLevel2.Count; i++) { if (i < (parentMenu.subMenuLevel2.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")|Control.HasFocus("; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")"; } } // //work out where to start the menu // int menuStart = (int.Parse(txtMenuPos.Text) - (50 * parentMenu.subMenuLevel1.Count) - 20); localxml += "<control>" + "<description>dummy for lateral blade visibility</description>" + "<type>label</type>" + "<id>" + parentMenu.subMenuLevel1ID.ToString() + "</id>" + "<label></label>" + "<visible>" + dummyFocusControls + "</visible>" + "</control>" + "<control>" + "<type>group</type>" + "<description>group element</description>" + "<animation effect=\"fade\" time=\"200\" start=\"0\" end=\"100\">visible</animation>" + "<animation effect=\"fade\" time=\"200\" start=\"100\" end=\"0\">hidden</animation>" + "<animation effect=\"fade\" start=\"100\" end=\"0\" time=\" 400\" delay=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"400\" delay=\"200\">WindowOpen</animation>" + "<animation effect=\"zoom\" start=\"10,10\" end=\"100,100\" center=\"640," + (int.Parse(txtMenuPos.Text) - 255 + 125).ToString() + "\" time=\"200\">Visible</animation>" + "<animation effect=\"zoom\" start=\"100,100\" end=\"10,10\" center=\"640," + (int.Parse(txtMenuPos.Text) - 255 + 125).ToString() + "\" time=\"200\">Hidden</animation>" + "<posX>480</posX>" + "<posY>" + menuStart.ToString() + "</posY>" + "<width>320</width>" + "<height>405</height>" + "<dimColor>ffffffff</dimColor>" + "<layout>StackLayout</layout>"; for (int j = 0; j < parentMenu.subMenuLevel1.Count; j++) { onup = (parentMenu.subMenuLevel1ID + (j)).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 2)).ToString(); if (j == 0) { onup = (parentMenu.subMenuLevel1ID + parentMenu.subMenuLevel1.Count).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 2)).ToString(); } if (j == (parentMenu.subMenuLevel1.Count - 1)) { onup = (parentMenu.subMenuLevel1ID + j).ToString(); ondown = (parentMenu.id + 900).ToString(); } localxml += "<control Style=\"submenubutton\">" + "<description>SUB ITEM " + j.ToString() + "</description>" + "<type>button</type>" + "<id>" + (parentMenu.subMenuLevel1ID + (j + 1)).ToString() + "</id>" + "<label>" + parentMenu.subMenuLevel1[j].displayName + "</label>"; if (parentMenu.subMenuLevel1[j].hyperlink == "196299") localxml += "<action>99</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == "196297") localxml += "<action>97</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == "196250") localxml += "<action>196250</action>"; else if (parentMenu.subMenuLevel1[j].hyperlink == formStreamedMpEditor.musicSkinID && parentMenu.subMenuLevel1[j].hyperlinkParameter != "false") localxml += "<hyperlink>504</hyperlink>"; else localxml += "<hyperlink>" + parentMenu.subMenuLevel1[j].hyperlink + "</hyperlink>"; //Plugin Parameter handling if (parentMenu.subMenuLevel1[j].hyperlinkParameter != "false") { switch (parentMenu.subMenuLevel1[j].hyperlink) { case onlineVideosSkinID: if (!IsOnlineVideosGroup(parentMenu.subMenuLevel1[j].hyperlinkParameter)) { string search = string.IsNullOrEmpty(parentMenu.subMenuLevel1[j].hyperlinkParameterSearch) ? string.Empty : "|search:" + parentMenu.subMenuLevel1[j].hyperlinkParameterSearch; string category = string.IsNullOrEmpty(parentMenu.subMenuLevel1[j].hyperlinkParameterCategory) ? string.Empty : "|category:" + parentMenu.subMenuLevel1[j].hyperlinkParameterCategory; localxml += "<hyperlinkParameter>site:" + parentMenu.subMenuLevel1[j].hyperlinkParameter + category + search + "|return:" + parentMenu.subMenuLevel1[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } else { localxml += "<hyperlinkParameter>group:" + parentMenu.subMenuLevel1[j].hyperlinkParameter.Substring(7) + "|return:" + parentMenu.subMenuLevel1[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } break; case movingPicturesSkinID: localxml += "<hyperlinkParameter>categoryid:" + parentMenu.subMenuLevel1[j].hyperlinkParameter + "</hyperlinkParameter>"; break; default: localxml += "<hyperlinkParameter>" + parentMenu.subMenuLevel1[j].hyperlinkParameter + "</hyperlinkParameter>"; break; } } localxml += "<onleft>" + (parentMenu.id + 900).ToString() + "</onleft>" + "<onright>" + (parentMenu.id + 900).ToString() + "</onright>" + //"<onright>" + (parentMenu.subMenuLevel1ID + (1 + isSecondLevel)).ToString() + "</onright>" + "<ondown>" + ondown + "</ondown>" + "<onup>" + onup + "</onup>" + "<visible allowhiddenfocus=\"true\">control.isvisible(" + parentMenu.subMenuLevel1ID.ToString() + ")</visible>" + "</control>"; } localxml += "</control>"; // Main Level menu Indicator subArrowVisible = "control.isvisible(11111)|Control.HasFocus("; foreach (menuItem item in menuItems) { if (item.subMenuLevel1ID != 0) subArrowVisible += (item.id + 700).ToString() + ")|control.hasfocus(" + (item.id + 800).ToString() + ")|control.hasfocus(" + (item.id + 900).ToString() + ")|control.hasfocus("; } subArrowVisible = subArrowVisible.Substring(0, (subArrowVisible.Length - 18)); localxml += "<control>" + "<description>Sub Menu Indicator (Main)</description>" + "<type>image</type>" + "<posX>630</posX>" + "<posY>" + (int.Parse(txtMenuPos.Text) + basicHomeValues.textYOffset + 205).ToString() + "</posY>" + "<align>center</align>" + "<width>24</width>" + "<height>24</height>" + "<visible>" + subArrowVisible + "</visible>" + "<colorDiffuse>77fffffff</colorDiffuse>" + "<texture>submenuarrow.png</texture>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"800\" reversible=\"false\">WindowOpen</animation>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"250\" delay=\"700\" reversible=\"false\">Visible</animation>" + "<animation effect=\"slide\" end=\"0,300\" time=\"250\" acceleration=\" -0.1\" reversible=\"false\">windowclose</animation>" + "</control>"; // 2nd Level Menu Indicator //subArrowVisible = "control.isvisible(22222)|control.hasfocus("; //foreach (menuItem item in menuItems) //{ // if (item.subMenuLevel1ID != 0) // if (item.subMenuLevel2.Count > 0) // { // for (int i = 0; i < item.subMenuLevel1.Count; i++) // { // subArrowVisible += (item.subMenuLevel1ID + (i + 1)).ToString() + ")|control.hasfocus("; // } // } //} //subArrowVisible = subArrowVisible.Substring(0, (subArrowVisible.Length - 18)); //localxml += "<control>" + // "<description>Sub Menu Indicator (Level1)</description>" + // "<type>image</type>" + // "<posX>750</posX>" + // "<posY>" + (int.Parse(txtMenuPos.Text) + basicHomeValues.textYOffset + 165).ToString() + "</posY>" + // "<align>right</align>" + // "<width>16</width>" + // "<height>16</height>" + // "<visible>" + subArrowVisible + "</visible>" + // "<colorDiffuse>77fffffff</colorDiffuse>" + // "<texture>arrowrightfo.png</texture>" + // "<animation effect=\"slide\" start=\"-400,0\" end=\"0,0\" tween=\"quadratic\" easing=\"in\" time=\" 400\" delay=\"200\">WindowOpen</animation>" + // "<animation effect=\"slide\" end=\"-400,0\" tween=\"quadratic\" easing=\"in\" time=\" 400\" delay=\"200\">WindowClose</animation>" + // "</control>"; return localxml; }
/// <summary> /// Indicates whether plugin can be enabled/disabled /// </summary> public void ShowPlugin() { formStreamedMpEditor startEditor = new formStreamedMpEditor(); startEditor.ShowDialog(); }
/// <summary> /// Write out Submenu Level 2 /// </summary> /// <param name="parentMenu"></param> /// <returns></returns> string writeSubMenuLevel2Graphical(formStreamedMpEditor.menuItem parentMenu) { string dummyFocusControls = "Control.HasFocus("; if (menuStyle != chosenMenuStyle.verticalStyle && horizontalContextLabels.Checked) conextOffsett = 26; for (int i = 0; i < parentMenu.subMenuLevel2.Count; i++) { if (i < (parentMenu.subMenuLevel2.Count - 1)) dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")|Control.HasFocus("; else dummyFocusControls += (parentMenu.subMenuLevel1ID + (i + 101)).ToString() + ")"; } localxml += "<control>" + "<description>dummy for lateral blade visibility</description>" + "<type>label</type>" + "<id>" + (parentMenu.subMenuLevel1ID + 100).ToString() + "</id>" + "<label></label>" + "<visible>" + dummyFocusControls + "</visible>" + "</control>" + "<control>" + "<type>group</type>" + "<description>group element</description>" + "<animation effect=\"fade\" time=\"200\" start=\"0\" end=\"100\">visible</animation>" + "<animation effect=\"fade\" time=\"200\" start=\"100\" end=\"0\">hidden</animation>" + "<animation effect=\"fade\" start=\"100\" end=\"0\" time=\"400\" delay=\"200\">WindowClose</animation>" + "<animation effect=\"fade\" start=\"0\" end=\"100\" time=\"400\" delay=\"200\">WindowOpen</animation>" + "<animation effect=\"zoom\" start=\"10,10\" end=\"100,100\" center=\"1148," + (int.Parse(txtMenuPos.Text) - 383 + 188).ToString() + "\" time=\"200\">Visible</animation>" + "<animation effect=\"zoom\" start=\"100,100\" end=\"10,10\" center=\"1148," + (int.Parse(txtMenuPos.Text) - 383 + 188).ToString() + "\" time=\"200\">Hidden</animation>" + "<posY>" + (int.Parse(txtMenuPos.Text) - 533 - conextOffsett).ToString() + "</posY>" + "<posX>1152</posX>" + "<width>345</width>" + "<height>608</height>" + "<dimColor>ffffffff</dimColor>" + "<layout>StackLayout</layout>"; for (int j = 0; j < parentMenu.subMenuLevel2.Count; j++) { onup = (parentMenu.subMenuLevel1ID + (j + 100)).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 102)).ToString(); if (j == 0) { onup = (parentMenu.subMenuLevel1ID + parentMenu.subMenuLevel2.Count).ToString(); ondown = (parentMenu.subMenuLevel1ID + (j + 102)).ToString(); } if (j == (parentMenu.subMenuLevel2.Count - 1)) { onup = (parentMenu.subMenuLevel1ID + 100 + j).ToString(); ondown = (parentMenu.subMenuLevel1ID + 101).ToString(); } localxml += "<control Style=\"submenubutton\">" + "<description>SUB ITEM " + j.ToString() + "</description>" + "<type>button</type>" + "<id>" + (parentMenu.subMenuLevel1ID + (j + 101)).ToString() + "</id>" + "<label>" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel2[j].displayName) + "</label>" + "<width>369</width>"; if (parentMenu.subMenuLevel2[j].hyperlink == "196299") localxml += "<action>99</action>"; else if (parentMenu.subMenuLevel2[j].hyperlink == "196297") localxml += "<action>97</action>"; else if (parentMenu.subMenuLevel2[j].hyperlink == "196250") localxml += "<action>196250</action>"; else if (parentMenu.subMenuLevel2[j].hyperlink == formStreamedMpEditor.musicSkinID && parentMenu.subMenuLevel2[j].hyperlinkParameter != "false") localxml += "<hyperlink>504</hyperlink>"; else localxml += "<hyperlink>" + parentMenu.subMenuLevel2[j].hyperlink + "</hyperlink>"; //Plugin Parameter handling if (parentMenu.subMenuLevel2[j].hyperlinkParameter != "false") { switch (parentMenu.subMenuLevel2[j].hyperlink) { case onlineVideosSkinID: if (!IsOnlineVideosGroup(parentMenu.subMenuLevel2[j].hyperlinkParameter)) { string search = string.IsNullOrEmpty(parentMenu.subMenuLevel2[j].hyperlinkParameterSearch) ? string.Empty : "|search:" + parentMenu.subMenuLevel2[j].hyperlinkParameterSearch; string category = string.IsNullOrEmpty(parentMenu.subMenuLevel2[j].hyperlinkParameterCategory) ? string.Empty : "|category:" + parentMenu.subMenuLevel2[j].hyperlinkParameterCategory; localxml += "<hyperlinkParameter>site:" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel2[j].hyperlinkParameter + category + search) + "|return:" + parentMenu.subMenuLevel2[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } else { localxml += "<hyperlinkParameter>group:" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel2[j].hyperlinkParameter.Substring(7)) + "|return:" + parentMenu.subMenuLevel2[j].hyperlinkParameterOption + "</hyperlinkParameter>"; } break; case movingPicturesSkinID: localxml += "<hyperlinkParameter>categoryid:" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel2[j].hyperlinkParameter) + "</hyperlinkParameter>"; break; default: localxml += "<hyperlinkParameter>" + HttpUtility.HtmlEncode(parentMenu.subMenuLevel2[j].hyperlinkParameter) + "</hyperlinkParameter>"; break; } } localxml += "<onleft>" + (parentMenu.subMenuLevel1ID + 1).ToString() + "</onleft>" + "<onright>" + (parentMenu.subMenuLevel1ID + (j + 101)).ToString() + "</onright>" + "<ondown>" + ondown + "</ondown>" + "<onup>" + onup + "</onup>" + "<visible allowhiddenfocus=\"true\">control.isvisible(" + (parentMenu.subMenuLevel1ID + 100).ToString() + ")</visible>" + "</control>"; } localxml += "</control>"; return localxml; }