// 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;
            }
        }
Ejemplo n.º 2
0
        internal static void GetEntryPoint(ActivationContext activationContext, out string fileName, out string parameters)
        {
            parameters = (string)null;
            fileName   = (string)null;
            ICMS componentManifest = activationContext.ApplicationComponentManifest;

            if (componentManifest == null || componentManifest.EntryPointSection == null)
            {
                throw new ArgumentException(Environment.GetResourceString("Argument_NoMain"));
            }
            IEnumUnknown enumUnknown = (IEnumUnknown)componentManifest.EntryPointSection._NewEnum;
            uint         num1        = 0;

            object[] objArray = new object[1];
            int      num2     = 1;

            object[] rgelt = objArray;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            uint& celtFetched = @num1;

            if (enumUnknown.Next((uint)num2, rgelt, celtFetched) != 0 || (int)num1 != 1)
            {
                return;
            }
            EntryPointEntry allData = ((IEntryPointEntry)objArray[0]).AllData;

            if (allData.CommandLine_File != null && allData.CommandLine_File.Length > 0)
            {
                fileName = allData.CommandLine_File;
            }
            else
            {
                object ppUnknown = (object)null;
                if (allData.Identity != null)
                {
                    ((ISectionWithReferenceIdentityKey)componentManifest.AssemblyReferenceSection).Lookup(allData.Identity, out ppUnknown);
                    IAssemblyReferenceEntry assemblyReferenceEntry = (IAssemblyReferenceEntry)ppUnknown;
                    fileName = assemblyReferenceEntry.DependentAssembly.Codebase;
                }
            }
            parameters = allData.CommandLine_Parameters;
        }
 public EntryPoint(System.Deployment.Internal.Isolation.Manifest.EntryPointEntry entryPointEntry, AssemblyManifest manifest)
 {
     this._name                 = entryPointEntry.Name;
     this._commandLineFile      = entryPointEntry.CommandLine_File;
     this._commandLineParamater = entryPointEntry.CommandLine_Parameters;
     this._hostInBrowser        = (entryPointEntry.Flags & 1) != 0;
     this._customHostSpecified  = (entryPointEntry.Flags & 2) != 0;
     this._customUX             = (entryPointEntry.Flags & 4) != 0;
     if (!this._customHostSpecified)
     {
         if (entryPointEntry.Identity != null)
         {
             this._dependentAssembly = manifest.GetDependentAssemblyByIdentity(entryPointEntry.Identity);
         }
         if (this._dependentAssembly == null)
         {
             throw new InvalidDeploymentException(ExceptionTypes.ManifestParse, Resources.GetString("Ex_NoMatchingAssemblyForEntryPoint"));
         }
     }
 }
Ejemplo n.º 4
0
        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;
            }
        }
Ejemplo n.º 5
0
        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;
            }
        }