PageDownloadCompDetail.cs 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066
  1. using System;
  2. using System.CodeDom.Compiler;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Collections.ObjectModel;
  6. using System.ComponentModel;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Runtime.CompilerServices;
  10. using System.Threading;
  11. using System.Windows;
  12. using System.Windows.Controls;
  13. using System.Windows.Markup;
  14. using System.Windows.Media;
  15. using Microsoft.VisualBasic.CompilerServices;
  16. namespace PCL
  17. {
  18. // Token: 0x020000E4 RID: 228
  19. [DesignerGenerated]
  20. public class PageDownloadCompDetail : MyPageRight, IComponentConnector
  21. {
  22. // Token: 0x06000840 RID: 2112 RVA: 0x000440C0 File Offset: 0x000422C0
  23. public PageDownloadCompDetail()
  24. {
  25. base.Initialized += this.PageDownloadCompDetail_Inited;
  26. base.Loaded += new RoutedEventHandler(this.PageDownloadCompDetail_Loaded);
  27. base.IncludeBroadcaster(new MyPageRight.PageEnterEventHandler(this.Init));
  28. this._PoolReader = null;
  29. this._CustomerReader = new ModLoader.LoaderTask<int, List<ModComp.CompFile>>("Comp File", delegate(ModLoader.LoaderTask<int, List<ModComp.CompFile>> Task)
  30. {
  31. Task.Output = ModComp.CompFilesGet(this._PageReader._AuthenticationRepository, this._PageReader.listRepository);
  32. }, null, ThreadPriority.Normal);
  33. this._ProcessReader = true;
  34. this.InitializeComponent();
  35. }
  36. // Token: 0x06000841 RID: 2113 RVA: 0x0004413C File Offset: 0x0004233C
  37. private void PageDownloadCompDetail_Inited(object sender, EventArgs e)
  38. {
  39. this._PageReader = (ModComp.CompProject)NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  40. {
  41. 0
  42. }, null);
  43. this.m_InterceptorReader = Conversions.ToString(NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  44. {
  45. 2
  46. }, null));
  47. this.containerReader = (ModComp.CompModLoaderType)Conversions.ToInteger(NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  48. {
  49. 3
  50. }, null));
  51. base.PageLoaderInit(this.Load, this.PanLoad, this.PanMain, this.CardIntro, this._CustomerReader, delegate(ModLoader.LoaderBase a0)
  52. {
  53. this.Load_OnFinish();
  54. }, null, true);
  55. }
  56. // Token: 0x06000842 RID: 2114 RVA: 0x00044208 File Offset: 0x00042408
  57. private void PageDownloadCompDetail_Loaded(object sender, EventArgs e)
  58. {
  59. this._PageReader = (ModComp.CompProject)NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  60. {
  61. 0
  62. }, null);
  63. this.m_InterceptorReader = Conversions.ToString(NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  64. {
  65. 2
  66. }, null));
  67. this.containerReader = (ModComp.CompModLoaderType)Conversions.ToInteger(NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  68. {
  69. 3
  70. }, null));
  71. }
  72. // Token: 0x06000843 RID: 2115 RVA: 0x000442A4 File Offset: 0x000424A4
  73. private void Load_State(object sender, MyLoading.MyLoadingState state, MyLoading.MyLoadingState oldState)
  74. {
  75. ModBase.LoadState state2 = this._CustomerReader.State;
  76. if (state2 == ModBase.LoadState.Failed)
  77. {
  78. string text = "";
  79. if (this._CustomerReader.Error != null)
  80. {
  81. text = this._CustomerReader.Error.Message;
  82. }
  83. if (text.Contains("不是有效的 json 文件"))
  84. {
  85. ModBase.Log("[Comp] 下载的文件 json 列表损坏,已自动重试", ModBase.LogLevel.Debug, "出现错误");
  86. base.PageLoaderRestart(null, true);
  87. }
  88. }
  89. }
  90. // Token: 0x06000844 RID: 2116 RVA: 0x0004430C File Offset: 0x0004250C
  91. private void Load_OnFinish()
  92. {
  93. this.dispatcherReader = false;
  94. List<string> list = Enumerable.ToList<string>(Enumerable.OrderByDescending<string, string>(Enumerable.Distinct<string>(Enumerable.Select<string, string>(Enumerable.SelectMany<ModComp.CompFile, string>(this._CustomerReader.Output, (PageDownloadCompDetail._Closure$__.$I13-0 == null) ? (PageDownloadCompDetail._Closure$__.$I13-0 = ((ModComp.CompFile v) => v.m_ValueRepository)) : PageDownloadCompDetail._Closure$__.$I13-0), (string v) => this.GetGroupedVersionName(v, this.dispatcherReader, true))), (PageDownloadCompDetail._Closure$__.$I13-2 == null) ? (PageDownloadCompDetail._Closure$__.$I13-2 = ((string s) => s)) : PageDownloadCompDetail._Closure$__.$I13-2, new ModMinecraft.VersionComparer()));
  95. if (list.Count >= 9)
  96. {
  97. this.dispatcherReader = true;
  98. list = Enumerable.ToList<string>(Enumerable.OrderByDescending<string, string>(Enumerable.Distinct<string>(Enumerable.Select<string, string>(Enumerable.SelectMany<ModComp.CompFile, string>(this._CustomerReader.Output, (PageDownloadCompDetail._Closure$__.$I13-3 == null) ? (PageDownloadCompDetail._Closure$__.$I13-3 = ((ModComp.CompFile v) => v.m_ValueRepository)) : PageDownloadCompDetail._Closure$__.$I13-3), (string v) => this.GetGroupedVersionName(v, this.dispatcherReader, true))), (PageDownloadCompDetail._Closure$__.$I13-5 == null) ? (PageDownloadCompDetail._Closure$__.$I13-5 = ((string s) => s)) : PageDownloadCompDetail._Closure$__.$I13-5, new ModMinecraft.VersionComparer()));
  99. }
  100. this.PanFilter.Children.Clear();
  101. if (list.Count <= 2)
  102. {
  103. this.CardFilter.Visibility = Visibility.Collapsed;
  104. this.paramsReader = null;
  105. }
  106. else
  107. {
  108. this.CardFilter.Visibility = Visibility.Visible;
  109. list.Insert(0, "全部");
  110. try
  111. {
  112. foreach (string text in list)
  113. {
  114. MyRadioButton myRadioButton = new MyRadioButton
  115. {
  116. Text = text,
  117. Margin = new Thickness(2.0, 0.0, 2.0, 0.0),
  118. ColorType = MyRadioButton.ColorState.Highlight
  119. };
  120. myRadioButton.LabText.Margin = new Thickness(-2.0, 0.0, 8.0, 0.0);
  121. myRadioButton.LogoutTests(delegate(object a0, bool a1)
  122. {
  123. this._Lambda$__13-6((MyRadioButton)a0, a1);
  124. });
  125. this.PanFilter.Children.Add(myRadioButton);
  126. }
  127. }
  128. finally
  129. {
  130. List<string>.Enumerator enumerator;
  131. ((IDisposable)enumerator).Dispose();
  132. }
  133. MyRadioButton myRadioButton2 = null;
  134. if (Operators.CompareString(this.m_InterceptorReader, "", false) != 0 && Enumerable.FirstOrDefault<ModComp.CompFile>(this._CustomerReader.Output, (ModComp.CompFile v) => v.m_ValueRepository.Contains(this.m_InterceptorReader)) != null)
  135. {
  136. string groupedVersionName = this.GetGroupedVersionName(this.m_InterceptorReader, this.dispatcherReader, true);
  137. try
  138. {
  139. foreach (object obj in this.PanFilter.Children)
  140. {
  141. MyRadioButton myRadioButton3 = (MyRadioButton)obj;
  142. if (Operators.CompareString(myRadioButton3.Text, groupedVersionName, false) == 0)
  143. {
  144. myRadioButton2 = myRadioButton3;
  145. break;
  146. }
  147. }
  148. }
  149. finally
  150. {
  151. IEnumerator enumerator2;
  152. if (enumerator2 is IDisposable)
  153. {
  154. (enumerator2 as IDisposable).Dispose();
  155. }
  156. }
  157. }
  158. if (myRadioButton2 == null)
  159. {
  160. myRadioButton2 = (MyRadioButton)this.PanFilter.Children[0];
  161. }
  162. myRadioButton2.Checked = true;
  163. }
  164. this.UpdateFilterResult();
  165. }
  166. // Token: 0x06000845 RID: 2117 RVA: 0x00044630 File Offset: 0x00042830
  167. private void UpdateFilterResult()
  168. {
  169. string text = (Operators.CompareString(this.m_InterceptorReader, "", false) != 0 || this.containerReader != ModComp.CompModLoaderType.Any) ? string.Format("所选版本:{0}{1}", (this.containerReader != ModComp.CompModLoaderType.Any) ? (this.containerReader.ToString() + " ") : "", this.m_InterceptorReader) : "";
  170. SortedDictionary<string, List<ModComp.CompFile>> sortedDictionary = new SortedDictionary<string, List<ModComp.CompFile>>(new PageDownloadCompDetail.CardSorter(text));
  171. sortedDictionary.Add("其他版本", new List<ModComp.CompFile>());
  172. List<int> list = new List<int>((IEnumerable<int>)Enum.GetValues(typeof(ModComp.CompModLoaderType)));
  173. try
  174. {
  175. foreach (ModComp.CompFile compFile in this._CustomerReader.Output)
  176. {
  177. try
  178. {
  179. foreach (string name in compFile.m_ValueRepository)
  180. {
  181. if (this.paramsReader == null || Operators.CompareString(this.GetGroupedVersionName(name, this.dispatcherReader, true), this.paramsReader, false) == 0)
  182. {
  183. string groupedVersionName = this.GetGroupedVersionName(name, false, false);
  184. List<string> list2 = new List<string>();
  185. if (this._PageReader.predicateRepository.Count > 1 && this._PageReader.Type == ModComp.CompType.Mod && groupedVersionName.StartsWith("1."))
  186. {
  187. try
  188. {
  189. foreach (ModComp.CompModLoaderType compModLoaderType in compFile._VisitorRepository)
  190. {
  191. if (!Conversions.ToBoolean(compModLoaderType == ModComp.CompModLoaderType.Quilt && Conversions.ToBoolean(ModBase.m_IdentifierRepository.Get("ToolDownloadIgnoreQuilt", null))) && list.Contains((int)compModLoaderType))
  192. {
  193. list2.Add(compModLoaderType.ToString() + " ");
  194. }
  195. }
  196. }
  197. finally
  198. {
  199. List<ModComp.CompModLoaderType>.Enumerator enumerator3;
  200. ((IDisposable)enumerator3).Dispose();
  201. }
  202. }
  203. if (!Enumerable.Any<string>(list2))
  204. {
  205. list2.Add("");
  206. }
  207. try
  208. {
  209. foreach (string str in list2)
  210. {
  211. string text2 = str + groupedVersionName;
  212. if (!sortedDictionary.ContainsKey(text2))
  213. {
  214. sortedDictionary.Add(text2, new List<ModComp.CompFile>());
  215. }
  216. if (!sortedDictionary[text2].Contains(compFile))
  217. {
  218. sortedDictionary[text2].Add(compFile);
  219. }
  220. }
  221. }
  222. finally
  223. {
  224. List<string>.Enumerator enumerator4;
  225. ((IDisposable)enumerator4).Dispose();
  226. }
  227. }
  228. }
  229. }
  230. finally
  231. {
  232. List<string>.Enumerator enumerator2;
  233. ((IDisposable)enumerator2).Dispose();
  234. }
  235. }
  236. }
  237. finally
  238. {
  239. List<ModComp.CompFile>.Enumerator enumerator;
  240. ((IDisposable)enumerator).Dispose();
  241. }
  242. if (Operators.CompareString(text, "", false) != 0)
  243. {
  244. sortedDictionary.Add(text, new List<ModComp.CompFile>());
  245. try
  246. {
  247. foreach (ModComp.CompFile compFile2 in this._CustomerReader.Output)
  248. {
  249. if (compFile2.m_ValueRepository.Contains(this.m_InterceptorReader) && (this.containerReader == ModComp.CompModLoaderType.Any || compFile2._VisitorRepository.Contains(this.containerReader)) && (this.paramsReader == null || Enumerable.Any<string>(compFile2.m_ValueRepository, (string v) => Operators.CompareString(this.GetGroupedVersionName(v, this.dispatcherReader, true), this.paramsReader, false) == 0)) && !sortedDictionary[text].Contains(compFile2))
  250. {
  251. sortedDictionary[text].Add(compFile2);
  252. }
  253. }
  254. }
  255. finally
  256. {
  257. List<ModComp.CompFile>.Enumerator enumerator5;
  258. ((IDisposable)enumerator5).Dispose();
  259. }
  260. }
  261. try
  262. {
  263. this.PanResults.Children.Clear();
  264. try
  265. {
  266. foreach (KeyValuePair<string, List<ModComp.CompFile>> keyValuePair in sortedDictionary)
  267. {
  268. if (Enumerable.Any<ModComp.CompFile>(keyValuePair.Value))
  269. {
  270. MyCard myCard = new MyCard();
  271. myCard.Title = keyValuePair.Key;
  272. myCard.Margin = new Thickness(0.0, 0.0, 0.0, 15.0);
  273. myCard.CreateParser((this._PageReader.Type == ModComp.CompType.ModPack) ? 9 : 8);
  274. MyCard myCard2 = myCard;
  275. StackPanel stackPanel = new StackPanel
  276. {
  277. Margin = new Thickness(20.0, 40.0, 18.0, 0.0),
  278. VerticalAlignment = VerticalAlignment.Top,
  279. RenderTransform = new TranslateTransform(0.0, 0.0),
  280. Tag = keyValuePair.Value
  281. };
  282. myCard2.Children.Add(stackPanel);
  283. myCard2._Stub = stackPanel;
  284. this.PanResults.Children.Add(myCard2);
  285. if (Operators.CompareString(keyValuePair.Key, text, false) != 0 && (ModMain._ProcessIterator._MethodIterator.m_SingletonMap == null || !((List<string>)NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  286. {
  287. 1
  288. }, null)).Contains(myCard2.Title)))
  289. {
  290. myCard2.IsSwaped = true;
  291. }
  292. else
  293. {
  294. MyCard.StackInstall(ref stackPanel, (this._PageReader.Type == ModComp.CompType.ModPack) ? 9 : 8, keyValuePair.Key);
  295. }
  296. if (Operators.CompareString(keyValuePair.Key, "其他版本", false) == 0)
  297. {
  298. stackPanel.Children.Add(new MyHint
  299. {
  300. Text = "由于版本信息更新缓慢,可能无法识别刚更新的 MC 版本,只需等待几天即可自动恢复正常。",
  301. IsWarn = false,
  302. Margin = new Thickness(0.0, 0.0, 0.0, 7.0)
  303. });
  304. }
  305. }
  306. }
  307. }
  308. finally
  309. {
  310. SortedDictionary<string, List<ModComp.CompFile>>.Enumerator enumerator6;
  311. enumerator6.Dispose();
  312. }
  313. if (this.PanResults.Children.Count == 1)
  314. {
  315. ((MyCard)this.PanResults.Children[0]).IsSwaped = false;
  316. }
  317. }
  318. catch (Exception ex)
  319. {
  320. ModBase.Log(ex, "可视化工程下载列表出错", ModBase.LogLevel.Feedback, "出现错误");
  321. }
  322. }
  323. // Token: 0x06000846 RID: 2118 RVA: 0x00044CAC File Offset: 0x00042EAC
  324. private string GetGroupedVersionName(string Name, bool MajorOnly, bool FoldOldRelease)
  325. {
  326. string result;
  327. if (Name == null)
  328. {
  329. result = "其他版本";
  330. }
  331. else if (Name.Contains("w"))
  332. {
  333. result = "快照版本";
  334. }
  335. else if (!Name.StartsWith("1.0") && Name.StartsWith("1.") && (!FoldOldRelease || ModBase.Val(Name.Split(".")[1]) >= 10.0))
  336. {
  337. result = (MajorOnly ? ("1." + Name.Split(".")[1].BeforeFirst(" ", false)) : Name);
  338. }
  339. else
  340. {
  341. result = "远古版本";
  342. }
  343. return result;
  344. }
  345. // Token: 0x06000847 RID: 2119 RVA: 0x00044D48 File Offset: 0x00042F48
  346. public void Init()
  347. {
  348. checked
  349. {
  350. ModAnimation.AssetParser(ModAnimation.CalcParser() + 1);
  351. this._PageReader = (ModComp.CompProject)NewLateBinding.LateIndexGet(ModMain._ProcessIterator._MethodIterator.m_SingletonMap, new object[]
  352. {
  353. 0
  354. }, null);
  355. this.PanBack.ScrollToHome();
  356. if (this._ProcessReader)
  357. {
  358. this._ProcessReader = false;
  359. }
  360. else
  361. {
  362. base.PageLoaderRestart(null, true);
  363. }
  364. if (this._PoolReader != null)
  365. {
  366. this.PanIntro.Children.Remove(this._PoolReader);
  367. }
  368. this._PoolReader = this._PageReader.ToCompItem(true, true);
  369. this._PoolReader._EventField = false;
  370. this._PoolReader.Margin = new Thickness(-7.0, -7.0, 0.0, 8.0);
  371. this.PanIntro.Children.Insert(0, this._PoolReader);
  372. this.BtnIntroWeb.Text = (this._PageReader.listRepository ? "转到 CurseForge" : "转到 Modrinth");
  373. this.BtnIntroWiki.Visibility = ((this._PageReader.FlushTests() == 0) ? Visibility.Collapsed : Visibility.Visible);
  374. ModAnimation.AssetParser(ModAnimation.CalcParser() - 1);
  375. }
  376. }
  377. // Token: 0x06000848 RID: 2120 RVA: 0x00044E88 File Offset: 0x00043088
  378. public void Install_Click(MyListItem sender, EventArgs e)
  379. {
  380. try
  381. {
  382. ModComp.CompFile compFile = (ModComp.CompFile)sender.Tag;
  383. string name = string.Format("{0} 整合包下载:{1} ", this._PageReader.listRepository ? "CurseForge" : "Modrinth", this._PageReader.RemoveTests());
  384. string text = this._PageReader.RemoveTests().Replace(".zip", "").Replace(".rar", "").Replace(".mrpack", "").Replace("\\", "\").Replace("/", "/").Replace("|", "|").Replace(":", ":").Replace("<", "<").Replace(">", ">").Replace("*", "*").Replace("?", "?").Replace("\"", "").Replace(": ", ":");
  385. ValidateFolderName validateFolderName = new ValidateFolderName(ModMinecraft.m_ProxyTests + "versions", true, true);
  386. if (Operators.CompareString(validateFolderName.Validate(text), "", false) != 0)
  387. {
  388. text = "";
  389. }
  390. string VersionName = ModMain.MyMsgBoxInput("输入版本名称", "", text, new Collection<Validate>
  391. {
  392. validateFolderName
  393. }, "", "确定", "取消", false);
  394. if (!string.IsNullOrEmpty(VersionName))
  395. {
  396. List<ModLoader.LoaderBase> list = new List<ModLoader.LoaderBase>();
  397. string Target = string.Format("{0}versions\\{1}\\原始整合包.{2}", ModMinecraft.m_ProxyTests, VersionName, this._PageReader.listRepository ? "zip" : "mrpack");
  398. string LogoFileAddress = MyImage.GetTempPath(this._PoolReader.Logo);
  399. list.Add(new ModNet.LoaderDownload("下载整合包文件", new List<ModNet.NetFile>
  400. {
  401. compFile.ToNetFile(Target)
  402. })
  403. {
  404. ProgressWeight = 10.0,
  405. Block = true
  406. });
  407. list.Add(new ModLoader.LoaderTask<int, int>("准备安装整合包", delegate(ModLoader.LoaderTask<int, int> a0)
  408. {
  409. base._Lambda$__0();
  410. }, null, ThreadPriority.Normal)
  411. {
  412. ProgressWeight = 0.1
  413. });
  414. ModLoader.LoaderCombo<string> loaderCombo = new ModLoader.LoaderCombo<string>(name, list);
  415. loaderCombo.OnStateChanged = ((PageDownloadCompDetail._Closure$__.$I18-1 == null) ? (PageDownloadCompDetail._Closure$__.$I18-1 = delegate(ModLoader.LoaderBase MyLoader)
  416. {
  417. switch (MyLoader.State)
  418. {
  419. case ModBase.LoadState.Loading:
  420. return;
  421. case ModBase.LoadState.Failed:
  422. ModMain.Hint(MyLoader.Name + "失败:" + ModBase.GetExceptionSummary(MyLoader.Error), ModMain.HintType.Critical, true);
  423. break;
  424. case ModBase.LoadState.Aborted:
  425. ModMain.Hint(MyLoader.Name + "已取消!", ModMain.HintType.Info, true);
  426. break;
  427. }
  428. ModDownloadLib.McInstallFailedClearFolder(MyLoader);
  429. }) : PageDownloadCompDetail._Closure$__.$I18-1);
  430. loaderCombo.Start(ModMinecraft.m_ProxyTests + "versions\\" + VersionName + "\\", false);
  431. ModLoader.LoaderTaskbarAdd<string>(loaderCombo);
  432. ModMain._ProcessIterator.BtnExtraDownload.ShowRefresh();
  433. ModMain._ProcessIterator.BtnExtraDownload.Ribble();
  434. }
  435. }
  436. catch (Exception ex)
  437. {
  438. ModBase.Log(ex, "下载资源整合包失败", ModBase.LogLevel.Feedback, "出现错误");
  439. }
  440. }
  441. // Token: 0x06000849 RID: 2121 RVA: 0x00045190 File Offset: 0x00043390
  442. public void Save_Click(object sender, EventArgs e)
  443. {
  444. PageDownloadCompDetail._Closure$__20-0 CS$<>8__locals1 = new PageDownloadCompDetail._Closure$__20-0(CS$<>8__locals1);
  445. CS$<>8__locals1.$VB$Me = this;
  446. CS$<>8__locals1.$VB$Local_File = (ModComp.CompFile)NewLateBinding.LateGet((sender is MyListItem) ? sender : NewLateBinding.LateGet(sender, null, "Parent", new object[0], null, null, null), null, "Tag", new object[0], null, null, null);
  447. ModBase.RunInNewThread(delegate
  448. {
  449. try
  450. {
  451. PageDownloadCompDetail._Closure$__20-3 CS$<>8__locals2 = new PageDownloadCompDetail._Closure$__20-3(CS$<>8__locals2);
  452. CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2 = CS$<>8__locals1;
  453. CS$<>8__locals2.$VB$Local_Desc = ((CS$<>8__locals1.$VB$Me._PageReader.Type == ModComp.CompType.ModPack) ? "整合包" : ((CS$<>8__locals1.$VB$Me._PageReader.Type == ModComp.CompType.Mod) ? "Mod " : "资源包"));
  454. CS$<>8__locals2.$VB$Local_DefaultFolder = null;
  455. if (CS$<>8__locals1.$VB$Me._PageReader.Type == ModComp.CompType.Mod)
  456. {
  457. PageDownloadCompDetail._Closure$__20-2 CS$<>8__locals3 = new PageDownloadCompDetail._Closure$__20-2(CS$<>8__locals3);
  458. CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3 = CS$<>8__locals2;
  459. CS$<>8__locals3.$VB$Local_AllowForge = null;
  460. CS$<>8__locals3.$VB$Local_AllowFabric = null;
  461. if (Enumerable.Any<ModComp.CompModLoaderType>(CS$<>8__locals1.$VB$Local_File._VisitorRepository))
  462. {
  463. CS$<>8__locals3.$VB$Local_AllowForge = new bool?(CS$<>8__locals1.$VB$Local_File._VisitorRepository.Contains(ModComp.CompModLoaderType.Forge) || CS$<>8__locals1.$VB$Local_File._VisitorRepository.Contains(ModComp.CompModLoaderType.NeoForge));
  464. CS$<>8__locals3.$VB$Local_AllowFabric = new bool?(CS$<>8__locals1.$VB$Local_File._VisitorRepository.Contains(ModComp.CompModLoaderType.Fabric));
  465. }
  466. else if (Enumerable.Any<ModComp.CompModLoaderType>(CS$<>8__locals1.$VB$Me._PageReader.predicateRepository))
  467. {
  468. CS$<>8__locals3.$VB$Local_AllowForge = new bool?(CS$<>8__locals1.$VB$Me._PageReader.predicateRepository.Contains(ModComp.CompModLoaderType.Forge) || CS$<>8__locals1.$VB$Local_File._VisitorRepository.Contains(ModComp.CompModLoaderType.NeoForge));
  469. CS$<>8__locals3.$VB$Local_AllowFabric = new bool?(CS$<>8__locals1.$VB$Me._PageReader.predicateRepository.Contains(ModComp.CompModLoaderType.Fabric));
  470. }
  471. bool? flag2;
  472. bool? flag = flag2 = ((CS$<>8__locals3.$VB$Local_AllowForge != null) ? ((CS$<>8__locals3.$VB$Local_AllowForge != null) ? new bool?(!CS$<>8__locals3.$VB$Local_AllowForge.GetValueOrDefault()) : CS$<>8__locals3.$VB$Local_AllowForge) : new bool?(false));
  473. bool? flag3 = (flag2 == null || flag.GetValueOrDefault()) ? (flag & CS$<>8__locals3.$VB$Local_AllowFabric != null) : new bool?(false);
  474. if ((flag3 == null || flag3.GetValueOrDefault()) && ((CS$<>8__locals3.$VB$Local_AllowFabric != null) ? new bool?(!CS$<>8__locals3.$VB$Local_AllowFabric.GetValueOrDefault()) : CS$<>8__locals3.$VB$Local_AllowFabric).GetValueOrDefault() && flag3 != null)
  475. {
  476. CS$<>8__locals3.$VB$Local_AllowForge = null;
  477. CS$<>8__locals3.$VB$Local_AllowFabric = null;
  478. }
  479. ModBase.Log(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject("[Comp] 允许 Forge:", (CS$<>8__locals3.$VB$Local_AllowForge != null) ? CS$<>8__locals3.$VB$Local_AllowForge.GetValueOrDefault() : "未知"), ",允许 Fabric:"), (CS$<>8__locals3.$VB$Local_AllowFabric != null) ? CS$<>8__locals3.$VB$Local_AllowFabric.GetValueOrDefault() : "未知")), ModBase.LogLevel.Normal, "出现错误");
  480. Func<ModMinecraft.McVersion, bool> func = delegate(ModMinecraft.McVersion Version)
  481. {
  482. PageDownloadCompDetail._Closure$__20-1 CS$<>8__locals4 = new PageDownloadCompDetail._Closure$__20-1(CS$<>8__locals4);
  483. CS$<>8__locals4.$VB$Local_Version = Version;
  484. if (!CS$<>8__locals4.$VB$Local_Version.importerMap)
  485. {
  486. CS$<>8__locals4.$VB$Local_Version.Load();
  487. }
  488. bool result;
  489. if (!CS$<>8__locals4.$VB$Local_Version.RunThread())
  490. {
  491. result = false;
  492. }
  493. else if (Enumerable.Any<string>(CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$NonLocal_$VB$Closure_2.$VB$Local_File.m_ValueRepository, (PageDownloadCompDetail._Closure$__.$I20-2 == null) ? (PageDownloadCompDetail._Closure$__.$I20-2 = ((string v) => v.Contains("."))) : PageDownloadCompDetail._Closure$__.$I20-2) && !Enumerable.Any<string>(CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$NonLocal_$VB$Closure_2.$VB$Local_File.m_ValueRepository, (string v) => v.Contains(".") && Operators.CompareString(v, CS$<>8__locals4.$VB$Local_Version.Version._ConnectionMap, false) == 0))
  494. {
  495. result = false;
  496. }
  497. else if (CS$<>8__locals3.$VB$Local_AllowForge != null && CS$<>8__locals3.$VB$Local_AllowFabric != null)
  498. {
  499. bool? flag5 = CS$<>8__locals3.$VB$Local_AllowForge;
  500. if ((flag5 == null || flag5.GetValueOrDefault()) && (CS$<>8__locals4.$VB$Local_Version.Version.m_StructMap || CS$<>8__locals4.$VB$Local_Version.Version._ValMap) && flag5 != null)
  501. {
  502. result = true;
  503. }
  504. else
  505. {
  506. flag5 = CS$<>8__locals3.$VB$Local_AllowFabric;
  507. result = ((flag5 == null || flag5.GetValueOrDefault()) && CS$<>8__locals4.$VB$Local_Version.Version._CandidateMap && flag5 != null);
  508. }
  509. }
  510. else
  511. {
  512. result = true;
  513. }
  514. return result;
  515. };
  516. if (PageDownloadCompDetail.parameterReader != null)
  517. {
  518. CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$Local_DefaultFolder = PageDownloadCompDetail.parameterReader;
  519. ModBase.Log("[Comp] 使用上次下载时的文件夹作为默认下载位置", ModBase.LogLevel.Normal, "出现错误");
  520. }
  521. else if (ModMinecraft.AddClient() != null && func(ModMinecraft.AddClient()))
  522. {
  523. CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$Local_DefaultFolder = ModMinecraft.AddClient().ChangeMapper() + "mods\\";
  524. Directory.CreateDirectory(CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$Local_DefaultFolder);
  525. ModBase.Log("[Comp] 使用当前版本的 mods 文件夹作为默认下载位置(" + ModMinecraft.AddClient().Name + ")", ModBase.LogLevel.Normal, "出现错误");
  526. }
  527. else
  528. {
  529. bool flag4;
  530. if (flag4 = (ModMinecraft._ListenerTests.State != ModBase.LoadState.Finished))
  531. {
  532. ModMain.Hint("正在查找适合的游戏版本……", ModMain.HintType.Info, true);
  533. ModLoader.LoaderFolderRun(ModMinecraft._ListenerTests, ModMinecraft.m_ProxyTests, ModLoader.LoaderFolderRunType.ForceRun, 1, "versions\\", true);
  534. }
  535. List<ModMinecraft.McVersion> list = new List<ModMinecraft.McVersion>();
  536. try
  537. {
  538. foreach (ModMinecraft.McVersion mcVersion in Enumerable.SelectMany<List<ModMinecraft.McVersion>, ModMinecraft.McVersion>(ModMinecraft._RegTests.Values, (PageDownloadCompDetail._Closure$__.$I20-4 == null) ? (PageDownloadCompDetail._Closure$__.$I20-4 = ((List<ModMinecraft.McVersion> l) => l)) : PageDownloadCompDetail._Closure$__.$I20-4))
  539. {
  540. if (func(mcVersion))
  541. {
  542. list.Add(mcVersion);
  543. }
  544. }
  545. }
  546. finally
  547. {
  548. IEnumerator<ModMinecraft.McVersion> enumerator;
  549. if (enumerator != null)
  550. {
  551. enumerator.Dispose();
  552. }
  553. }
  554. if (!Enumerable.Any<ModMinecraft.McVersion>(list))
  555. {
  556. CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$Local_DefaultFolder = ModMinecraft.m_ProxyTests;
  557. if (flag4)
  558. {
  559. ModMain.Hint("当前 MC 文件夹中没有找到适合这个 Mod 的版本!", ModMain.HintType.Info, true);
  560. }
  561. else
  562. {
  563. ModBase.Log("[Comp] 由于当前版本不兼容,使用当前的 MC 文件夹作为默认下载位置", ModBase.LogLevel.Normal, "出现错误");
  564. }
  565. }
  566. else
  567. {
  568. ModMinecraft.McVersion mcVersion2 = Enumerable.LastOrDefault<ModMinecraft.McVersion>(Enumerable.OrderBy<ModMinecraft.McVersion, int>(list, (PageDownloadCompDetail._Closure$__.$I20-5 == null) ? (PageDownloadCompDetail._Closure$__.$I20-5 = delegate(ModMinecraft.McVersion v)
  569. {
  570. DirectoryInfo directoryInfo = new DirectoryInfo(v.ChangeMapper() + "mods\\");
  571. if (!directoryInfo.Exists)
  572. {
  573. return -1;
  574. }
  575. return directoryInfo.GetFiles().Length;
  576. }) : PageDownloadCompDetail._Closure$__.$I20-5));
  577. CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$Local_DefaultFolder = mcVersion2.ChangeMapper() + "mods\\";
  578. Directory.CreateDirectory(CS$<>8__locals3.$VB$NonLocal_$VB$Closure_3.$VB$Local_DefaultFolder);
  579. ModBase.Log("[Comp] 使用适合的游戏版本作为默认下载位置(" + mcVersion2.Name + ")", ModBase.LogLevel.Normal, "出现错误");
  580. }
  581. }
  582. }
  583. if (Operators.CompareString(CS$<>8__locals1.$VB$Me._PageReader.RemoveTests(), CS$<>8__locals1.$VB$Me._PageReader.comparatorRepository, false) == 0)
  584. {
  585. CS$<>8__locals2.$VB$Local_FileName = CS$<>8__locals1.$VB$Local_File._BridgeRepository;
  586. }
  587. else
  588. {
  589. string text = CS$<>8__locals1.$VB$Me._PageReader.RemoveTests().BeforeFirst(" (", false).BeforeFirst(" - ", false).Replace("\\", "\").Replace("/", "/").Replace("|", "|").Replace(":", ":").Replace("<", "<").Replace(">", ">").Replace("*", "*").Replace("?", "?").Replace("\"", "").Replace(": ", ":");
  590. object left = ModBase.m_IdentifierRepository.Get("ToolDownloadTranslate", null);
  591. if (Operators.ConditionalCompareObjectEqual(left, 0, false))
  592. {
  593. CS$<>8__locals2.$VB$Local_FileName = string.Format("[{0}] {1}", text, CS$<>8__locals1.$VB$Local_File._BridgeRepository);
  594. }
  595. else if (Operators.ConditionalCompareObjectEqual(left, 1, false))
  596. {
  597. CS$<>8__locals2.$VB$Local_FileName = string.Format("{0}-{1}", text, CS$<>8__locals1.$VB$Local_File._BridgeRepository);
  598. }
  599. else if (Operators.ConditionalCompareObjectEqual(left, 2, false))
  600. {
  601. CS$<>8__locals2.$VB$Local_FileName = string.Format("{0}-{1}", CS$<>8__locals1.$VB$Local_File._BridgeRepository, text);
  602. }
  603. else
  604. {
  605. CS$<>8__locals2.$VB$Local_FileName = CS$<>8__locals1.$VB$Local_File._BridgeRepository;
  606. }
  607. }
  608. ModBase.RunInUi(delegate()
  609. {
  610. string text2 = ModBase.SelectAs("选择保存位置", CS$<>8__locals2.$VB$Local_FileName, CS$<>8__locals2.$VB$Local_Desc + "文件|" + ((CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Me._PageReader.Type == ModComp.CompType.Mod) ? (CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_File._BridgeRepository.EndsWith(".litemod") ? "*.litemod" : "*.jar") : (CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_File._BridgeRepository.EndsWith(".mrpack") ? "*.mrpack" : "*.zip")), CS$<>8__locals2.$VB$Local_DefaultFolder);
  611. if (text2.Contains("\\"))
  612. {
  613. string name = CS$<>8__locals2.$VB$Local_Desc + "下载:" + ModBase.GetFileNameWithoutExtentionFromPath(text2) + " ";
  614. if (Operators.CompareString(text2, CS$<>8__locals2.$VB$Local_DefaultFolder, false) != 0 && CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Me._PageReader.Type == ModComp.CompType.Mod)
  615. {
  616. PageDownloadCompDetail.parameterReader = ModBase.GetPathFromFullPath(text2);
  617. }
  618. ModLoader.LoaderCombo<int> loaderCombo = new ModLoader.LoaderCombo<int>(name, new List<ModLoader.LoaderBase>
  619. {
  620. new ModNet.LoaderDownload("下载文件", new List<ModNet.NetFile>
  621. {
  622. CS$<>8__locals2.$VB$NonLocal_$VB$Closure_2.$VB$Local_File.ToNetFile(text2)
  623. })
  624. {
  625. ProgressWeight = 6.0,
  626. Block = true
  627. }
  628. });
  629. loaderCombo.OnStateChanged = new Action<ModLoader.LoaderBase>(ModDownloadLib.DownloadStateSave);
  630. loaderCombo.Start(1, false);
  631. ModLoader.LoaderTaskbarAdd<int>(loaderCombo);
  632. ModMain._ProcessIterator.BtnExtraDownload.ShowRefresh();
  633. ModMain._ProcessIterator.BtnExtraDownload.Ribble();
  634. }
  635. }, false);
  636. }
  637. catch (Exception ex)
  638. {
  639. ModBase.Log(ex, "保存资源文件失败", ModBase.LogLevel.Feedback, "出现错误");
  640. }
  641. }, "Download CompDetail Save", ThreadPriority.Normal);
  642. }
  643. // Token: 0x0600084A RID: 2122 RVA: 0x000063AE File Offset: 0x000045AE
  644. private void BtnIntroWeb_Click(object sender, EventArgs e)
  645. {
  646. ModBase.OpenWebsite(this._PageReader.m_TokenizerRepository);
  647. }
  648. // Token: 0x0600084B RID: 2123 RVA: 0x000063C0 File Offset: 0x000045C0
  649. private void BtnIntroWiki_Click(object sender, EventArgs e)
  650. {
  651. ModBase.OpenWebsite("https://www.mcmod.cn/class/" + Conversions.ToString(this._PageReader.FlushTests()) + ".html");
  652. }
  653. // Token: 0x0600084C RID: 2124 RVA: 0x000063E6 File Offset: 0x000045E6
  654. private void BtnIntroCopy_Click(object sender, EventArgs e)
  655. {
  656. ModBase.ClipboardSet(this._PoolReader.LabTitle.Text, true);
  657. }
  658. // Token: 0x1700010E RID: 270
  659. // (get) Token: 0x0600084D RID: 2125 RVA: 0x000063FE File Offset: 0x000045FE
  660. // (set) Token: 0x0600084E RID: 2126 RVA: 0x00006406 File Offset: 0x00004606
  661. internal virtual MyScrollViewer PanBack { get; set; }
  662. // Token: 0x1700010F RID: 271
  663. // (get) Token: 0x0600084F RID: 2127 RVA: 0x0000640F File Offset: 0x0000460F
  664. // (set) Token: 0x06000850 RID: 2128 RVA: 0x00006417 File Offset: 0x00004617
  665. internal virtual MyCard CardIntro { get; set; }
  666. // Token: 0x17000110 RID: 272
  667. // (get) Token: 0x06000851 RID: 2129 RVA: 0x00006420 File Offset: 0x00004620
  668. // (set) Token: 0x06000852 RID: 2130 RVA: 0x00006428 File Offset: 0x00004628
  669. internal virtual StackPanel PanIntro { get; set; }
  670. // Token: 0x17000111 RID: 273
  671. // (get) Token: 0x06000853 RID: 2131 RVA: 0x00006431 File Offset: 0x00004631
  672. // (set) Token: 0x06000854 RID: 2132 RVA: 0x00045204 File Offset: 0x00043404
  673. internal virtual MyButton BtnIntroWeb
  674. {
  675. [CompilerGenerated]
  676. get
  677. {
  678. return this.m_ProxyReader;
  679. }
  680. [CompilerGenerated]
  681. set
  682. {
  683. MyButton.ClickEventHandler value2 = new MyButton.ClickEventHandler(this.BtnIntroWeb_Click);
  684. MyButton proxyReader = this.m_ProxyReader;
  685. if (proxyReader != null)
  686. {
  687. proxyReader.Click -= value2;
  688. }
  689. this.m_ProxyReader = value;
  690. proxyReader = this.m_ProxyReader;
  691. if (proxyReader != null)
  692. {
  693. proxyReader.Click += value2;
  694. }
  695. }
  696. }
  697. // Token: 0x17000112 RID: 274
  698. // (get) Token: 0x06000855 RID: 2133 RVA: 0x00006439 File Offset: 0x00004639
  699. // (set) Token: 0x06000856 RID: 2134 RVA: 0x00045248 File Offset: 0x00043448
  700. internal virtual MyButton BtnIntroWiki
  701. {
  702. [CompilerGenerated]
  703. get
  704. {
  705. return this.messageReader;
  706. }
  707. [CompilerGenerated]
  708. set
  709. {
  710. MyButton.ClickEventHandler value2 = new MyButton.ClickEventHandler(this.BtnIntroWiki_Click);
  711. MyButton myButton = this.messageReader;
  712. if (myButton != null)
  713. {
  714. myButton.Click -= value2;
  715. }
  716. this.messageReader = value;
  717. myButton = this.messageReader;
  718. if (myButton != null)
  719. {
  720. myButton.Click += value2;
  721. }
  722. }
  723. }
  724. // Token: 0x17000113 RID: 275
  725. // (get) Token: 0x06000857 RID: 2135 RVA: 0x00006441 File Offset: 0x00004641
  726. // (set) Token: 0x06000858 RID: 2136 RVA: 0x0004528C File Offset: 0x0004348C
  727. internal virtual MyButton BtnIntroCopy
  728. {
  729. [CompilerGenerated]
  730. get
  731. {
  732. return this.creatorReader;
  733. }
  734. [CompilerGenerated]
  735. set
  736. {
  737. MyButton.ClickEventHandler value2 = new MyButton.ClickEventHandler(this.BtnIntroCopy_Click);
  738. MyButton myButton = this.creatorReader;
  739. if (myButton != null)
  740. {
  741. myButton.Click -= value2;
  742. }
  743. this.creatorReader = value;
  744. myButton = this.creatorReader;
  745. if (myButton != null)
  746. {
  747. myButton.Click += value2;
  748. }
  749. }
  750. }
  751. // Token: 0x17000114 RID: 276
  752. // (get) Token: 0x06000859 RID: 2137 RVA: 0x00006449 File Offset: 0x00004649
  753. // (set) Token: 0x0600085A RID: 2138 RVA: 0x00006451 File Offset: 0x00004651
  754. internal virtual StackPanel PanMain { get; set; }
  755. // Token: 0x17000115 RID: 277
  756. // (get) Token: 0x0600085B RID: 2139 RVA: 0x0000645A File Offset: 0x0000465A
  757. // (set) Token: 0x0600085C RID: 2140 RVA: 0x00006462 File Offset: 0x00004662
  758. internal virtual MyCard CardFilter { get; set; }
  759. // Token: 0x17000116 RID: 278
  760. // (get) Token: 0x0600085D RID: 2141 RVA: 0x0000646B File Offset: 0x0000466B
  761. // (set) Token: 0x0600085E RID: 2142 RVA: 0x00006473 File Offset: 0x00004673
  762. internal virtual StackPanel PanFilter { get; set; }
  763. // Token: 0x17000117 RID: 279
  764. // (get) Token: 0x0600085F RID: 2143 RVA: 0x0000647C File Offset: 0x0000467C
  765. // (set) Token: 0x06000860 RID: 2144 RVA: 0x00006484 File Offset: 0x00004684
  766. internal virtual StackPanel PanResults { get; set; }
  767. // Token: 0x17000118 RID: 280
  768. // (get) Token: 0x06000861 RID: 2145 RVA: 0x0000648D File Offset: 0x0000468D
  769. // (set) Token: 0x06000862 RID: 2146 RVA: 0x00006495 File Offset: 0x00004695
  770. internal virtual MyCard PanLoad { get; set; }
  771. // Token: 0x17000119 RID: 281
  772. // (get) Token: 0x06000863 RID: 2147 RVA: 0x0000649E File Offset: 0x0000469E
  773. // (set) Token: 0x06000864 RID: 2148 RVA: 0x000452D0 File Offset: 0x000434D0
  774. internal virtual MyLoading Load
  775. {
  776. [CompilerGenerated]
  777. get
  778. {
  779. return this.m_CollectionReader;
  780. }
  781. [CompilerGenerated]
  782. set
  783. {
  784. MyLoading.StateChangedEventHandler obj = new MyLoading.StateChangedEventHandler(this.Load_State);
  785. MyLoading collectionReader = this.m_CollectionReader;
  786. if (collectionReader != null)
  787. {
  788. collectionReader.InterruptField(obj);
  789. }
  790. this.m_CollectionReader = value;
  791. collectionReader = this.m_CollectionReader;
  792. if (collectionReader != null)
  793. {
  794. collectionReader.PrintField(obj);
  795. }
  796. }
  797. }
  798. // Token: 0x06000865 RID: 2149 RVA: 0x00045314 File Offset: 0x00043514
  799. [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  800. public void InitializeComponent()
  801. {
  802. if (!this.m_VisitorReader)
  803. {
  804. this.m_VisitorReader = true;
  805. Uri resourceLocator = new Uri("/Plain Craft Launcher 2;component/pages/pagedownload/pagedownloadcompdetail.xaml", UriKind.Relative);
  806. Application.LoadComponent(this, resourceLocator);
  807. }
  808. }
  809. // Token: 0x06000866 RID: 2150 RVA: 0x0000414E File Offset: 0x0000234E
  810. [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  811. internal Delegate _CreateDelegate(Type delegateType, string handler)
  812. {
  813. return Delegate.CreateDelegate(delegateType, this, handler);
  814. }
  815. // Token: 0x06000867 RID: 2151 RVA: 0x00045344 File Offset: 0x00043544
  816. [EditorBrowsable(EditorBrowsableState.Never)]
  817. [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  818. public void System_Windows_Markup_IComponentConnector_Connect(int connectionId, object target)
  819. {
  820. if (connectionId == 1)
  821. {
  822. this.PanBack = (MyScrollViewer)target;
  823. return;
  824. }
  825. if (connectionId == 2)
  826. {
  827. this.CardIntro = (MyCard)target;
  828. return;
  829. }
  830. if (connectionId == 3)
  831. {
  832. this.PanIntro = (StackPanel)target;
  833. return;
  834. }
  835. if (connectionId == 4)
  836. {
  837. this.BtnIntroWeb = (MyButton)target;
  838. return;
  839. }
  840. if (connectionId == 5)
  841. {
  842. this.BtnIntroWiki = (MyButton)target;
  843. return;
  844. }
  845. if (connectionId == 6)
  846. {
  847. this.BtnIntroCopy = (MyButton)target;
  848. return;
  849. }
  850. if (connectionId == 7)
  851. {
  852. this.PanMain = (StackPanel)target;
  853. return;
  854. }
  855. if (connectionId == 8)
  856. {
  857. this.CardFilter = (MyCard)target;
  858. return;
  859. }
  860. if (connectionId == 9)
  861. {
  862. this.PanFilter = (StackPanel)target;
  863. return;
  864. }
  865. if (connectionId == 10)
  866. {
  867. this.PanResults = (StackPanel)target;
  868. return;
  869. }
  870. if (connectionId == 11)
  871. {
  872. this.PanLoad = (MyCard)target;
  873. return;
  874. }
  875. if (connectionId == 12)
  876. {
  877. this.Load = (MyLoading)target;
  878. return;
  879. }
  880. this.m_VisitorReader = true;
  881. }
  882. // Token: 0x04000475 RID: 1141
  883. private MyCompItem _PoolReader;
  884. // Token: 0x04000476 RID: 1142
  885. private ModLoader.LoaderTask<int, List<ModComp.CompFile>> _CustomerReader;
  886. // Token: 0x04000477 RID: 1143
  887. private ModComp.CompProject _PageReader;
  888. // Token: 0x04000478 RID: 1144
  889. private string m_InterceptorReader;
  890. // Token: 0x04000479 RID: 1145
  891. private ModComp.CompModLoaderType containerReader;
  892. // Token: 0x0400047A RID: 1146
  893. private string paramsReader;
  894. // Token: 0x0400047B RID: 1147
  895. private bool dispatcherReader;
  896. // Token: 0x0400047C RID: 1148
  897. private bool _ProcessReader;
  898. // Token: 0x0400047D RID: 1149
  899. public static string parameterReader = null;
  900. // Token: 0x0400047E RID: 1150
  901. [AccessedThroughProperty("PanBack")]
  902. [CompilerGenerated]
  903. private MyScrollViewer m_RecordReader;
  904. // Token: 0x0400047F RID: 1151
  905. [CompilerGenerated]
  906. [AccessedThroughProperty("CardIntro")]
  907. private MyCard _ServiceReader;
  908. // Token: 0x04000480 RID: 1152
  909. [CompilerGenerated]
  910. [AccessedThroughProperty("PanIntro")]
  911. private StackPanel _InvocationReader;
  912. // Token: 0x04000481 RID: 1153
  913. [AccessedThroughProperty("BtnIntroWeb")]
  914. [CompilerGenerated]
  915. private MyButton m_ProxyReader;
  916. // Token: 0x04000482 RID: 1154
  917. [AccessedThroughProperty("BtnIntroWiki")]
  918. [CompilerGenerated]
  919. private MyButton messageReader;
  920. // Token: 0x04000483 RID: 1155
  921. [AccessedThroughProperty("BtnIntroCopy")]
  922. [CompilerGenerated]
  923. private MyButton creatorReader;
  924. // Token: 0x04000484 RID: 1156
  925. [CompilerGenerated]
  926. [AccessedThroughProperty("PanMain")]
  927. private StackPanel _InitializerReader;
  928. // Token: 0x04000485 RID: 1157
  929. [CompilerGenerated]
  930. [AccessedThroughProperty("CardFilter")]
  931. private MyCard singletonReader;
  932. // Token: 0x04000486 RID: 1158
  933. [AccessedThroughProperty("PanFilter")]
  934. [CompilerGenerated]
  935. private StackPanel m_RegReader;
  936. // Token: 0x04000487 RID: 1159
  937. [CompilerGenerated]
  938. [AccessedThroughProperty("PanResults")]
  939. private StackPanel m_ProductReader;
  940. // Token: 0x04000488 RID: 1160
  941. [CompilerGenerated]
  942. [AccessedThroughProperty("PanLoad")]
  943. private MyCard m_ListenerReader;
  944. // Token: 0x04000489 RID: 1161
  945. [AccessedThroughProperty("Load")]
  946. [CompilerGenerated]
  947. private MyLoading m_CollectionReader;
  948. // Token: 0x0400048A RID: 1162
  949. private bool m_VisitorReader;
  950. // Token: 0x020000E5 RID: 229
  951. private class CardSorter : IComparer<string>
  952. {
  953. // Token: 0x06000870 RID: 2160 RVA: 0x00045428 File Offset: 0x00043628
  954. public int Compare(string x, string y)
  955. {
  956. checked
  957. {
  958. int result;
  959. if (Operators.CompareString(x, y, false) == 0)
  960. {
  961. result = 0;
  962. }
  963. else if (Operators.CompareString(x, this.Topmost, false) == 0)
  964. {
  965. result = -1;
  966. }
  967. else if (Operators.CompareString(y, this.Topmost, false) == 0)
  968. {
  969. result = 1;
  970. }
  971. else
  972. {
  973. bool flag = x.EndsWithF("版本", false);
  974. bool flag2 = y.EndsWithF("版本", false);
  975. if (flag && flag2)
  976. {
  977. result = x.CompareTo(y);
  978. }
  979. else if (flag)
  980. {
  981. result = 1;
  982. }
  983. else if (flag2)
  984. {
  985. result = -1;
  986. }
  987. else
  988. {
  989. int num = 0 - ModMinecraft.VersionSortInteger(x.Replace(x.BeforeFirst(" ", false) + " ", ""), y.Replace(y.BeforeFirst(" ", false) + " ", ""));
  990. if (num != 0)
  991. {
  992. result = num;
  993. }
  994. else
  995. {
  996. result = 0 - ModMinecraft.VersionSortInteger(x, y);
  997. }
  998. }
  999. }
  1000. return result;
  1001. }
  1002. }
  1003. // Token: 0x06000871 RID: 2161 RVA: 0x00006557 File Offset: 0x00004757
  1004. public CardSorter(string Topmost = "")
  1005. {
  1006. this.Topmost = "";
  1007. this.Topmost = (Topmost ?? "");
  1008. }
  1009. // Token: 0x0400048B RID: 1163
  1010. public string Topmost;
  1011. }
  1012. }
  1013. }