// Token: 0x06004FF3 RID: 20467 RVA: 0x00119454 File Offset: 0x00117654 internal static void GetEntryPoint(ActivationContext activationContext, out string fileName, out string parameters) { parameters = null; fileName = null; ICMS applicationComponentManifest = activationContext.ApplicationComponentManifest; if (applicationComponentManifest == null || applicationComponentManifest.EntryPointSection == null) { throw new ArgumentException(Environment.GetResourceString("Argument_NoMain")); } IEnumUnknown enumUnknown = (IEnumUnknown)applicationComponentManifest.EntryPointSection._NewEnum; uint num = 0U; object[] array = new object[1]; if (enumUnknown.Next(1U, array, ref num) == 0 && num == 1U) { IEntryPointEntry entryPointEntry = (IEntryPointEntry)array[0]; EntryPointEntry allData = entryPointEntry.AllData; if (allData.CommandLine_File != null && allData.CommandLine_File.Length > 0) { fileName = allData.CommandLine_File; } else { object obj = null; if (allData.Identity != null) { ((ISectionWithReferenceIdentityKey)applicationComponentManifest.AssemblyReferenceSection).Lookup(allData.Identity, out obj); IAssemblyReferenceEntry assemblyReferenceEntry = (IAssemblyReferenceEntry)obj; fileName = assemblyReferenceEntry.DependentAssembly.Codebase; } } parameters = allData.CommandLine_Parameters; } }
internal static void GetEntryPoint(ActivationContext activationContext, out string fileName, out string parameters) { parameters = null; fileName = null; ICMS appManifest = activationContext.ApplicationComponentManifest; if (appManifest == null || appManifest.EntryPointSection == null) { throw new ArgumentException(Environment.GetResourceString("Argument_NoMain")); } IEnumUnknown refEnum = (IEnumUnknown)appManifest.EntryPointSection._NewEnum; uint count = 0; Object[] entries = new Object[1]; // Look for the first entry point. ClickOnce semantic validation ensures exactly one entry point is present. if (refEnum.Next(1, entries, ref count) == 0 && count == 1) { IEntryPointEntry iref = (IEntryPointEntry)entries[0]; EntryPointEntry reference = iref.AllData; if (reference.CommandLine_File != null && reference.CommandLine_File.Length > 0) { fileName = reference.CommandLine_File; } else { // Locate the dependent assembly that is being refered to. Well-formed manifests should have an identity. IAssemblyReferenceEntry refEntry = null; object assemblyObj = null; if (reference.Identity != null) { ((ISectionWithReferenceIdentityKey)appManifest.AssemblyReferenceSection).Lookup(reference.Identity, out assemblyObj); refEntry = (IAssemblyReferenceEntry)assemblyObj; fileName = refEntry.DependentAssembly.Codebase; } } parameters = reference.CommandLine_Parameters; } }
internal static void GetEntryPoint(ActivationContext activationContext, out string fileName, out string parameters) { parameters = null; fileName = null; ICMS applicationComponentManifest = activationContext.ApplicationComponentManifest; if ((applicationComponentManifest == null) || (applicationComponentManifest.EntryPointSection == null)) { throw new ArgumentException(Environment.GetResourceString("Argument_NoMain")); } IEnumUnknown unknown = (IEnumUnknown)applicationComponentManifest.EntryPointSection._NewEnum; uint celtFetched = 0; object[] rgelt = new object[1]; if ((unknown.Next(1, rgelt, ref celtFetched) == 0) && (celtFetched == 1)) { IEntryPointEntry entry = (IEntryPointEntry)rgelt[0]; EntryPointEntry allData = entry.AllData; if ((allData.CommandLine_File != null) && (allData.CommandLine_File.Length > 0)) { fileName = allData.CommandLine_File; } else { IAssemblyReferenceEntry entry3 = null; object ppUnknown = null; if (allData.Identity != null) { ((ISectionWithReferenceIdentityKey)applicationComponentManifest.AssemblyReferenceSection).Lookup(allData.Identity, out ppUnknown); entry3 = (IAssemblyReferenceEntry)ppUnknown; fileName = entry3.DependentAssembly.Codebase; } } parameters = allData.CommandLine_Parameters; } }