// means that the problem is already quite complex and we should not be dealing with it - see
// ComEventsMethod.Invoke
+using System.Runtime.Versioning;
+
namespace System.Runtime.InteropServices
{
/// <summary>
/// The static methods provided in ComEventsHelper allow using .NET delegates to subscribe to events
/// raised COM objects.
/// </summary>
+ [SupportedOSPlatform("windows")]
public static class ComEventsHelper
{
/// <summary>
using System.Collections;
using System.Threading;
using System.Runtime.CompilerServices;
+using System.Runtime.Versioning;
using Internal.Runtime.CompilerServices;
namespace System.Runtime.InteropServices
/// <summary>
/// Class for managing wrappers of COM IUnknown types.
/// </summary>
+ [SupportedOSPlatform("windows")]
[CLSCompliant(false)]
public abstract partial class ComWrappers
{
<PackageVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</PackageVersion>
<AssemblyVersion>10.0.6.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public sealed partial class DateAndTime
{
internal DateAndTime() { }
- public static string DateString { get { throw null; } set { } }
+ public static string DateString { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static System.DateTime Now { get { throw null; } }
- public static System.DateTime TimeOfDay { get { throw null; } set { } }
+ public static System.DateTime TimeOfDay { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static double Timer { get { throw null; } }
- public static string TimeString { get { throw null; } set { } }
- public static System.DateTime Today { get { throw null; } set { } }
+ public static string TimeString { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
+ public static System.DateTime Today { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } }
public static System.DateTime DateAdd(Microsoft.VisualBasic.DateInterval Interval, double Number, System.DateTime DateValue) { throw null; }
public static System.DateTime DateAdd(string Interval, double Number, object? DateValue) { throw null; }
public static long DateDiff(Microsoft.VisualBasic.DateInterval Interval, System.DateTime Date1, System.DateTime Date2, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; }
{
internal FileSystem() { }
public static void ChDir(string Path) { }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void ChDrive(char Drive) { }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void ChDrive(string? Drive) { }
public static string CurDir() { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static string CurDir(char Drive) { throw null; }
public static string Dir() { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static string Dir(string PathName, Microsoft.VisualBasic.FileAttribute Attributes = Microsoft.VisualBasic.FileAttribute.Normal) { throw null; }
public static bool EOF(int FileNumber) { throw null; }
public static Microsoft.VisualBasic.OpenMode FileAttr(int FileNumber) { throw null; }
public static void MkDir(string Path) { }
public static void Print(int FileNumber, params object[] Output) { }
public static void PrintLine(int FileNumber, params object[] Output) { }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Rename(string OldPath, string NewPath) { }
public static void Reset() { }
public static void RmDir(string Path) { }
internal Interaction() { }
public static void AppActivate(int ProcessId) { }
public static void AppActivate(string Title) { }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Beep() { }
public static object? CallByName(object? ObjectRef, string ProcName, Microsoft.VisualBasic.CallType UseCallType, params object?[] Args) { throw null; }
public static object? Choose(double Index, params object?[] Choice) { throw null; }
public static string Command() { throw null; }
public static object CreateObject(string ProgId, string? ServerName = "") { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void DeleteSetting(string AppName, string? Section = null, string? Key = null) { }
public static string Environ(string? Expression) { throw null; }
public static string Environ(int Expression) { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static string[,]? GetAllSettings(string AppName, string Section) { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static object? GetObject(string? PathName = null, string? Class = null) { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static string? GetSetting(string AppName, string Section, string Key, string? Default = "") { throw null; }
public static object? IIf(bool Expression, object? TruePart, object? FalsePart) { throw null; }
public static string InputBox(string Prompt, string Title = "", string DefaultResponse = "", int XPos = -1, int YPos = -1) { throw null; }
public static MsgBoxResult MsgBox(object Prompt, MsgBoxStyle Buttons = MsgBoxStyle.ApplicationModal, object? Title = null) { throw null; }
public static string Partition(long Number, long Start, long Stop, long Interval) { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void SaveSetting(string AppName, string Section, string Key, string Setting) { }
public static int Shell(string PathName, AppWinStyle Style = AppWinStyle.MinimizedFocus, bool Wait = false, int Timeout = -1) { throw null; }
public static object? Switch(params object?[]? VarExpr) { throw null; }
public static string Space(int Number) { throw null; }
public static string[] Split(string? Expression, string? Delimiter = " ", int Limit = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; }
public static int StrComp(string? String1, string? String2, Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static string? StrConv(string? str, Microsoft.VisualBasic.VbStrConv Conversion, int LocaleID = 0) { throw null; }
public static string StrDup(int Number, char Character) { throw null; }
public static object StrDup(int Number, object Character) { throw null; }
Imports System
Imports System.Globalization
+Imports System.Runtime.Versioning
Imports Microsoft.VisualBasic.CompilerServices
Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils
Imports Microsoft.VisualBasic.CompilerServices.Utils
Get
Return DateTime.Today
End Get
+ <SupportedOSPlatform("windows")>
Set(ByVal Value As DateTime)
SetDate(Value)
End Set
'Truncate to the nearest second
Return New DateTime(Ticks - Ticks Mod TimeSpan.TicksPerSecond)
End Get
+ <SupportedOSPlatform("windows")>
Set(ByVal Value As DateTime)
SetTime(Value)
End Set
Get
Return (New DateTime(DateTime.Now.TimeOfDay.Ticks)).ToString("HH:mm:ss", GetInvariantCultureInfo())
End Get
+ <SupportedOSPlatform("windows")>
Set(ByVal Value As String)
Dim dt As Date
Return DateTime.Today.ToString("MM\-dd\-yyyy", GetInvariantCultureInfo())
End If
End Get
+ <SupportedOSPlatform("windows")>
Set(ByVal Value As String)
Dim NewDate As Date
End Sub
+ <SupportedOSPlatform("windows")>
Public Sub ChDrive(ByVal Drive As Char)
Drive = System.Char.ToUpperInvariant(Drive)
IO.Directory.SetCurrentDirectory(Drive & Path.VolumeSeparatorChar)
End Sub
+ <SupportedOSPlatform("windows")>
Public Sub ChDrive(ByVal Drive As String)
Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
"Methods in Microsoft.VisualBasic should not call FileSystem public method.")
Return Directory.GetCurrentDirectory()
End Function
+ <SupportedOSPlatform("windows")>
Public Function CurDir(ByVal Drive As Char) As String
Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
"Methods in Microsoft.VisualBasic should not call FileSystem public method.")
Return FindNextFile(System.Reflection.Assembly.GetCallingAssembly())
End Function
+ <SupportedOSPlatform("windows")>
<ResourceExposure(ResourceScope.None)>
<ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)>
Public Function Dir(ByVal PathName As String, Optional ByVal Attributes As FileAttribute = FileAttribute.Normal) As String
CloseAllFiles(System.Reflection.Assembly.GetCallingAssembly())
End Sub
+ <SupportedOSPlatform("windows")>
<ResourceExposure(ResourceScope.Machine)>
<ResourceConsumption(ResourceScope.Machine)>
Public Sub Rename(ByVal OldPath As String, ByVal NewPath As String)
Imports System.Reflection
Imports System.Text
Imports System.Runtime.InteropServices
+Imports System.Runtime.Versioning
Imports Microsoft.Win32
Imports Microsoft.VisualBasic.CompilerServices
' User interaction functions.
'============================================================================
+ <SupportedOSPlatform("windows")>
Public Sub Beep()
#If TARGET_WINDOWS Then
UnsafeNativeMethods.MessageBeep(0)
' Registry functions.
'============================================================================
+ <SupportedOSPlatform("windows")>
Public Sub DeleteSetting(ByVal AppName As String, Optional ByVal Section As String = Nothing, Optional ByVal Key As String = Nothing)
Dim AppSection As String
Dim UserKey As RegistryKey
End Try
End Sub
+ <SupportedOSPlatform("windows")>
Public Function GetAllSettings(ByVal AppName As String, ByVal Section As String) As String(,)
Dim rk As RegistryKey
Dim sAppSect As String
End Try
End Function
+ <SupportedOSPlatform("windows")>
Public Function GetSetting(ByVal AppName As String, ByVal Section As String, ByVal Key As String, Optional ByVal [Default] As String = "") As String
Dim rk As RegistryKey = Nothing
Dim sAppSect As String
End If
End Function
+ <SupportedOSPlatform("windows")>
Public Sub SaveSetting(ByVal AppName As String, ByVal Section As String, ByVal Key As String, ByVal Setting As String)
Dim rk As RegistryKey
Dim sIniSect As String
End Try
End Function
+ <SupportedOSPlatform("windows")>
Public Function GetObject(Optional ByVal PathName As String = Nothing, Optional ByVal [Class] As String = Nothing) As Object
'Only works for Com2 objects, not for COM+ objects.
End Try
End Function
+ <SupportedOSPlatform("windows")>
Public Function StrConv(ByVal [str] As String, ByVal Conversion As VbStrConv, Optional ByVal LocaleID As Integer = 0) As String
#If TARGET_WINDOWS Then
Try
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
public System.IO.FileInfo CopyTo(string destFileName, bool overwrite) { throw null; }
public System.IO.FileStream Create() { throw null; }
public System.IO.StreamWriter CreateText() { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void Decrypt() { }
public override void Delete() { }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void Encrypt() { }
public void MoveTo(string destFileName) { }
public void MoveTo(string destFileName, bool overwrite) { }
using System.Diagnostics;
using System.IO;
using System.Text;
+using System.Runtime.Versioning;
#if MS_IO_REDIST
namespace Microsoft.IO
return new FileInfo(destinationFileName);
}
+ [SupportedOSPlatform("windows")]
public void Decrypt() => File.Decrypt(FullPath);
+ [SupportedOSPlatform("windows")]
public void Encrypt() => File.Encrypt(FullPath);
}
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Runtime.Versioning;
+
namespace System.Runtime.InteropServices
{
+ [SupportedOSPlatform("windows")]
public static class ComEventsHelper
{
public static void Combine(object rcw, Guid iid, int dispid, Delegate d)
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
+using System.Runtime.Versioning;
namespace System.Runtime.InteropServices
{
UniqueInstance = 2,
}
+ [SupportedOSPlatform("windows")]
[CLSCompliant(false)]
public abstract class ComWrappers
{
namespace System.Runtime.InteropServices
{
// Wrapper that is converted to a variant with VT_DISPATCH
+ [SupportedOSPlatform("windows")]
public sealed class DispatchWrapper
{
public DispatchWrapper(object? obj)
}
}
- [SupportedOSPlatform("windows")]
public object? WrappedObject { get; }
}
}
public override System.Reflection.Module Module { get { throw null; } }
public override string Name { get { throw null; } }
public override System.Type? ReflectedType { get { throw null; } }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public override void AddEventHandler(object target, System.Delegate handler) { }
public override System.Reflection.MethodInfo? GetAddMethod(bool nonPublic) { throw null; }
public override object[] GetCustomAttributes(bool inherit) { throw null; }
public override System.Reflection.MethodInfo? GetRaiseMethod(bool nonPublic) { throw null; }
public override System.Reflection.MethodInfo? GetRemoveMethod(bool nonPublic) { throw null; }
public override bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public override void RemoveEventHandler(object target, System.Delegate handler) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public System.Type EventProvider { get { throw null; } }
public System.Type SourceInterface { get { throw null; } }
}
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static partial class ComEventsHelper
{
public DefaultParameterValueAttribute(object? value) { }
public object? Value { get { throw null; } }
}
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class DispatchWrapper
{
public DispatchWrapper(object? obj) { }
- [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public object? WrappedObject { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
TrackerObject = 1,
UniqueInstance = 2,
}
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
[System.CLSCompliantAttribute(false)]
public abstract class ComWrappers
{
using System.Collections.Generic;
using System.Reflection;
+using System.Runtime.Versioning;
// This type is obsolete, and is expected to be used in very specific ways or it may
// throw null reference exceptions.
_innerEventInfo = type.GetEvent(eventName)!;
}
+ [SupportedOSPlatform("windows")]
#pragma warning disable CS8765 // Nullability of parameters 'target' and 'handler' don't match overridden member
public override void AddEventHandler(object target, Delegate handler)
#pragma warning restore CS8765
}
}
+ [SupportedOSPlatform("windows")]
#pragma warning disable CS8765 // Nullability of parameters 'target' and 'handler' don't match overridden member
public override void RemoveEventHandler(object target, Delegate handler)
#pragma warning restore CS8765
public bool Removable { get { throw null; } }
public string UniqueKeyContainerName { get { throw null; } }
}
+ [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public sealed partial class CspParameters
{
public string? KeyContainerName;
using System;
using System.Diagnostics;
using System.Security.Cryptography;
+using System.Runtime.Versioning;
using Internal.NativeCrypto;
namespace System.Security.Cryptography
{
+ [SupportedOSPlatform("windows")]
public sealed class CspParameters
{
public int ProviderType;
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file