System.Deployment.Internal.Isolation.Manifest.CmsUtils.GetEntryPoint C# (CSharp) Méthode

GetEntryPoint() static private méthode

static private GetEntryPoint ( ActivationContext activationContext, string &fileName, string &parameters ) : void
activationContext System.ActivationContext
fileName string
parameters string
Résultat void
        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;
            }
        }

Usage Example

        // Token: 0x06004FF6 RID: 20470 RVA: 0x001195A8 File Offset: 0x001177A8
        internal static string GetEntryPointFullPath(ActivationContext activationContext)
        {
            string text;
            string text2;

            CmsUtils.GetEntryPoint(activationContext, out text, out text2);
            if (!string.IsNullOrEmpty(text))
            {
                string text3 = activationContext.ApplicationDirectory;
                if (text3 == null || text3.Length == 0)
                {
                    text3 = Directory.UnsafeGetCurrentDirectory();
                }
                text = Path.Combine(text3, text);
            }
            return(text);
        }
All Usage Examples Of System.Deployment.Internal.Isolation.Manifest.CmsUtils::GetEntryPoint