Пример #1
0
        internal static IEnumerable <ExtendedTypeDefinition> GetFormatData()
        {
            var SignatureTypes_GroupingFormat = CustomControl.Create()
                                                .StartEntry()
                                                .StartFrame()
                                                .AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
                                                .AddScriptBlockExpressionBinding(@"split-path $_.Path")
                                                .EndFrame()
                                                .EndEntry()
                                                .EndControl();

            var sharedControls = new CustomControl[] {
                SignatureTypes_GroupingFormat
            };

            yield return(new ExtendedTypeDefinition(
                             "System.Security.Cryptography.X509Certificates.X509Certificate2",
                             ViewsOf_System_Security_Cryptography_X509Certificates_X509Certificate2()));

            var td2 = new ExtendedTypeDefinition(
                "Microsoft.PowerShell.Commands.X509StoreLocation",
                ViewsOf_CertificateProviderTypes());

            td2.TypeNames.Add("System.Security.Cryptography.X509Certificates.X509Certificate2");
            td2.TypeNames.Add("System.Security.Cryptography.X509Certificates.X509Store");
            yield return(td2);

            yield return(new ExtendedTypeDefinition(
                             "System.Management.Automation.Signature",
                             ViewsOf_System_Management_Automation_Signature(sharedControls)));

            yield return(new ExtendedTypeDefinition(
                             "System.Security.Cryptography.X509Certificates.X509CertificateEx",
                             ViewsOf_System_Security_Cryptography_X509Certificates_X509CertificateEx()));
        }
Пример #2
0
        internal static IEnumerable <ExtendedTypeDefinition> GetFormatData()
        {
            var FileSystemTypes_GroupingFormat = CustomControl.Create()
                                                 .StartEntry()
                                                 .StartFrame(leftIndent: 4)
                                                 .AddText(FileSystemProviderStrings.DirectoryDisplayGrouping)
                                                 .AddScriptBlockExpressionBinding(@"
                                                  $_.PSParentPath.Replace(""Microsoft.PowerShell.Core\FileSystem::"", """")
                                              ")
                                                 .AddNewline()
                                                 .EndFrame()
                                                 .EndEntry()
                                                 .EndControl();

            var sharedControls = new CustomControl[] {
                FileSystemTypes_GroupingFormat
            };

            var td1 = new ExtendedTypeDefinition(
                "System.IO.DirectoryInfo",
                ViewsOf_FileSystemTypes(sharedControls));

            td1.TypeNames.Add("System.IO.FileInfo");
            yield return(td1);

            yield return(new ExtendedTypeDefinition(
                             "System.Security.AccessControl.FileSystemSecurity",
                             ViewsOf_System_Security_AccessControl_FileSystemSecurity(sharedControls)));

            yield return(new ExtendedTypeDefinition(
                             "Microsoft.PowerShell.Commands.AlternateStreamData",
                             ViewsOf_Microsoft_PowerShell_Commands_AlternateStreamData()));
        }
Пример #3
0
        internal static IEnumerable <ExtendedTypeDefinition> GetFormatData()
        {
            var Registry_GroupingFormat = CustomControl.Create()
                                          .StartEntry()
                                          .StartFrame()
                                          .AddText("    Hive: ")
                                          .AddScriptBlockExpressionBinding(@"$_.PSParentPath.Replace(""Microsoft.PowerShell.Core\Registry::"", """")")
                                          .EndFrame()
                                          .EndEntry()
                                          .EndControl();

            var sharedControls = new CustomControl[] {
                Registry_GroupingFormat
            };

            var td1 = new ExtendedTypeDefinition(
                "Microsoft.PowerShell.Commands.Internal.TransactedRegistryKey",
                ViewsOf_Microsoft_PowerShell_Commands_Internal_TransactedRegistryKey_Microsoft_Win32_RegistryKey_System_Management_Automation_TreatAs_RegistryValue(sharedControls));

            td1.TypeNames.Add("Microsoft.Win32.RegistryKey");
            td1.TypeNames.Add("System.Management.Automation.TreatAs.RegistryValue");
            yield return(td1);
        }