System.Deployment.Internal.Isolation.StoreOperationSetDeploymentMetadata.MarshalProperties C# (CSharp) Méthode

MarshalProperties() private static méthode

private static MarshalProperties ( System.Deployment.Internal.Isolation.StoreOperationMetadataProperty Props ) : IntPtr
Props System.Deployment.Internal.Isolation.StoreOperationMetadataProperty
Résultat System.IntPtr
        private static IntPtr MarshalProperties(StoreOperationMetadataProperty[] Props)
        {
            if ((Props == null) || (Props.Length == 0))
            {
                return IntPtr.Zero;
            }
            int num = Marshal.SizeOf(typeof(StoreOperationMetadataProperty));
            IntPtr ptr = Marshal.AllocCoTaskMem(num * Props.Length);
            for (int i = 0; i != Props.Length; i++)
            {
                Marshal.StructureToPtr(Props[i], new IntPtr((i * num) + ptr.ToInt64()), false);
            }
            return ptr;
        }
        public enum Disposition

Usage Example

Exemple #1
0
 public StoreOperationSetDeploymentMetadata(IDefinitionAppId Deployment, StoreApplicationReference Reference, StoreOperationMetadataProperty[] SetProperties, StoreOperationMetadataProperty[] TestProperties)
 {
     this.Size       = (uint)Marshal.SizeOf(typeof(StoreOperationSetDeploymentMetadata));
     this.Flags      = StoreOperationSetDeploymentMetadata.OpFlags.Nothing;
     this.Deployment = Deployment;
     if (SetProperties != null)
     {
         this.PropertiesToSet  = StoreOperationSetDeploymentMetadata.MarshalProperties(SetProperties);
         this.cPropertiesToSet = new IntPtr(SetProperties.Length);
     }
     else
     {
         this.PropertiesToSet  = IntPtr.Zero;
         this.cPropertiesToSet = IntPtr.Zero;
     }
     if (TestProperties != null)
     {
         this.PropertiesToTest  = StoreOperationSetDeploymentMetadata.MarshalProperties(TestProperties);
         this.cPropertiesToTest = new IntPtr(TestProperties.Length);
     }
     else
     {
         this.PropertiesToTest  = IntPtr.Zero;
         this.cPropertiesToTest = IntPtr.Zero;
     }
     this.InstallerReference = Reference.ToIntPtr();
 }