示例#1
0
        internal static IAssemblyReferenceEntry[] GetDependentAssemblies(ActivationContext activationContext)
        {
            IAssemblyReferenceEntry[] entries = null;
            ICMS appManifest = activationContext.ApplicationComponentManifest;

            if (appManifest == null)
            {
                return(null);
            }

            ISection dependencySection = appManifest.AssemblyReferenceSection;
            uint     count             = (dependencySection != null) ? dependencySection.Count : 0;

            if (count > 0)
            {
                uint fetched = 0;
                entries = new IAssemblyReferenceEntry[count];
                IEnumUnknown dependencyEnum = (IEnumUnknown)dependencySection._NewEnum;
                int          hr             = dependencyEnum.Next(count, entries, ref fetched);
                if (fetched != count || hr < 0)
                {
                    return(null); //
                }
            }
            return(entries);
        }
        // Token: 0x06004FF4 RID: 20468 RVA: 0x00119534 File Offset: 0x00117734
        internal static IAssemblyReferenceEntry[] GetDependentAssemblies(ActivationContext activationContext)
        {
            IAssemblyReferenceEntry[] array   = null;
            ICMS applicationComponentManifest = activationContext.ApplicationComponentManifest;

            if (applicationComponentManifest == null)
            {
                return(null);
            }
            ISection assemblyReferenceSection = applicationComponentManifest.AssemblyReferenceSection;
            uint     num = (assemblyReferenceSection != null) ? assemblyReferenceSection.Count : 0U;

            if (num > 0U)
            {
                uint num2 = 0U;
                array = new IAssemblyReferenceEntry[num];
                IEnumUnknown enumUnknown = (IEnumUnknown)assemblyReferenceSection._NewEnum;
                int          num3        = enumUnknown.Next(num, array, ref num2);
                if (num2 != num || num3 < 0)
                {
                    return(null);
                }
            }
            return(array);
        }
        // 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;
            }
        }
示例#4
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;
        }
示例#5
0
 internal static IAssemblyReferenceEntry[] GetDependentAssemblies(ActivationContext activationContext)
 {
     IAssemblyReferenceEntry[] entries = null;
     ICMS appManifest = activationContext.ApplicationComponentManifest;
     if (appManifest == null)
         return null;
     
     ISection dependencySection =  appManifest.AssemblyReferenceSection;
     uint count = (dependencySection != null) ? dependencySection.Count : 0;
     if (count > 0)
     {
         uint fetched = 0;
         entries = new IAssemblyReferenceEntry[count];
         IEnumUnknown dependencyEnum = (IEnumUnknown)dependencySection._NewEnum;
         int hr = dependencyEnum.Next(count, entries, ref fetched);
         if (fetched != count || hr < 0)
             return null; //
     }
     return entries;
 }
示例#6
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;
            }
        }
示例#7
0
 internal static IAssemblyReferenceEntry[] GetDependentAssemblies(ActivationContext activationContext)
 {
     IAssemblyReferenceEntry[] rgelt = null;
     ICMS applicationComponentManifest = activationContext.ApplicationComponentManifest;
     if (applicationComponentManifest != null)
     {
         ISection assemblyReferenceSection = applicationComponentManifest.AssemblyReferenceSection;
         uint celt = (assemblyReferenceSection != null) ? assemblyReferenceSection.Count : 0;
         if (celt <= 0)
         {
             return rgelt;
         }
         uint celtFetched = 0;
         rgelt = new IAssemblyReferenceEntry[celt];
         int num3 = ((IEnumUnknown) assemblyReferenceSection._NewEnum).Next(celt, rgelt, ref celtFetched);
         if ((celtFetched == celt) && (num3 >= 0))
         {
             return rgelt;
         }
     }
     return null;
 }
示例#8
0
        internal static IAssemblyReferenceEntry[] GetDependentAssemblies(ActivationContext activationContext)
        {
            IAssemblyReferenceEntry[] rgelt   = null;
            ICMS applicationComponentManifest = activationContext.ApplicationComponentManifest;

            if (applicationComponentManifest != null)
            {
                ISection assemblyReferenceSection = applicationComponentManifest.AssemblyReferenceSection;
                uint     celt = (assemblyReferenceSection != null) ? assemblyReferenceSection.Count : 0;
                if (celt <= 0)
                {
                    return(rgelt);
                }
                uint celtFetched = 0;
                rgelt = new IAssemblyReferenceEntry[celt];
                int num3 = ((IEnumUnknown)assemblyReferenceSection._NewEnum).Next(celt, rgelt, ref celtFetched);
                if ((celtFetched == celt) && (num3 >= 0))
                {
                    return(rgelt);
                }
            }
            return(null);
        }
示例#9
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;
            }
        }
示例#10
0
        internal static IAssemblyReferenceEntry[] GetDependentAssemblies(ActivationContext activationContext)
        {
            IAssemblyReferenceEntry[] assemblyReferenceEntryArray = (IAssemblyReferenceEntry[])null;
            ICMS componentManifest = activationContext.ApplicationComponentManifest;

            if (componentManifest == null)
            {
                return((IAssemblyReferenceEntry[])null);
            }
            ISection referenceSection = componentManifest.AssemblyReferenceSection;
            uint     celt             = referenceSection != null ? referenceSection.Count : 0U;

            if (celt > 0U)
            {
                uint celtFetched = 0;
                assemblyReferenceEntryArray = new IAssemblyReferenceEntry[(int)celt];
                int num = ((IEnumUnknown)referenceSection._NewEnum).Next(celt, (object[])assemblyReferenceEntryArray, ref celtFetched);
                if ((int)celtFetched != (int)celt || num < 0)
                {
                    return((IAssemblyReferenceEntry[])null);
                }
            }
            return(assemblyReferenceEntryArray);
        }