From 717df9e201cd81605077c224ec1da982538ca98a Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 31 Jul 2026 14:37:55 -0700 Subject: [PATCH 1/2] delete or upgrade 3 remaining .NET Fx projects --- .../Overview/customissuertokenresolver.cs | 70 --- .../Overview/properties/assemblyinfo.cs | 36 -- .../SecurityToken/Overview/simplewebtoken.cs | 201 ------- .../Overview/simplewebtoken.csproj | 62 -- .../Overview/simplewebtokenconstants.cs | 30 - .../Overview/simplewebtokenhandler.cs | 546 ------------------ .../simplewebtokenkeyidentifierclause.cs | 55 -- .../Overview/Configuration/AssemblyInfo.cs | 29 - .../Configuration/Resources.Designer.cs | 63 -- .../Overview/Configuration/Resources.resx | 117 ---- .../Overview/Configuration/Settings.cs | 42 -- .../Overview/Form1.Designer.cs | 245 -------- .../Overview/Form1.cs | 342 ----------- .../Overview/Form1.resx | 123 ---- .../Overview/HtmlWindowProjectCSharp.csproj | 79 --- .../Overview/Program.cs | 19 - .../Overview/app.config | 3 - .../Overview/snippets.5000.json | 3 - .../System/Decimal/Parse/Default.aspx.cs | 24 +- .../System/Decimal/Parse/parsemethod.csproj | 47 +- .../Overview/Form1.Designer.vb | 236 -------- .../Overview/Form1.resx | 117 ---- .../Overview/Form1.vb | 333 ----------- .../Overview/HtmlWindowProject.vbproj | 9 - .../Overview/My Project/MyEvents.vb | 15 - .../Overview/My Project/MyResources.resx | 117 ---- .../Overview/My Project/MyResources.vb | 61 -- .../Overview/My Project/MySettings.settings | 7 - .../Overview/My Project/MySettings.vb | 38 -- .../Overview/app.config | 25 - .../SecurityToken.xml | 46 -- .../HtmlElementErrorEventArgs.xml | 25 +- 32 files changed, 25 insertions(+), 3140 deletions(-) delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/customissuertokenresolver.cs delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/properties/assemblyinfo.cs delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.csproj delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenhandler.cs delete mode 100644 snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenkeyidentifierclause.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/AssemblyInfo.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.Designer.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.resx delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Settings.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProjectCSharp.csproj delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Program.cs delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config delete mode 100644 snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/snippets.5000.json delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.vb delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProject.vbproj delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyEvents.vb delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.resx delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.vb delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.settings delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.vb delete mode 100644 snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/customissuertokenresolver.cs b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/customissuertokenresolver.cs deleted file mode 100644 index 10616558129..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/customissuertokenresolver.cs +++ /dev/null @@ -1,70 +0,0 @@ -//----------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -//----------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.IdentityModel.Tokens; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml; - -namespace SimpleWebToken -{ - public class CustomIssuerTokenResolver : IssuerTokenResolver - { - private Dictionary _keys; - - public CustomIssuerTokenResolver() - { - _keys = new Dictionary(); - } - - public void AddAudienceKeyPair(string audience, string symmetricKey) - { - _keys.Add(audience, symmetricKey); - } - - public override void LoadCustomConfiguration(System.Xml.XmlNodeList nodelist) - { - foreach (XmlNode node in nodelist) - { - XmlDictionaryReader rdr = XmlDictionaryReader.CreateDictionaryReader(new XmlTextReader(new StringReader(node.OuterXml))); - rdr.MoveToContent(); - - string symmetricKey = rdr.GetAttribute("symmetricKey"); - string audience = rdr.GetAttribute("audience"); - - this.AddAudienceKeyPair(audience, symmetricKey); - } - } - - protected override bool TryResolveSecurityKeyCore(SecurityKeyIdentifierClause keyIdentifierClause, out SecurityKey key) - { - key = null; - SimpleWebTokenKeyIdentifierClause keyClause = keyIdentifierClause as SimpleWebTokenKeyIdentifierClause; - if (keyClause != null) - { - string base64Key = null; - _keys.TryGetValue(keyClause.Audience, out base64Key); - if (!string.IsNullOrEmpty(base64Key)) - { - key = new InMemorySymmetricSecurityKey(Encoding.UTF8.GetBytes(base64Key)); - return true; - } - } - - return false; - } - } -} diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/properties/assemblyinfo.cs b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/properties/assemblyinfo.cs deleted file mode 100644 index 1e8514c1a34..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/properties/assemblyinfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SimpleWebToken")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("SimpleWebToken")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("84f7a631-7291-4e81-8b37-cbd03eae1ae8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs deleted file mode 100644 index 340538d6c93..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs +++ /dev/null @@ -1,201 +0,0 @@ -//----------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -//----------------------------------------------------------------------------- -// -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.IdentityModel.Tokens; - -namespace SimpleWebToken -{ - /// - /// This class represents the token format for the SimpleWebToken. - /// - public class SimpleWebToken : SecurityToken - { - // - public static DateTime SwtBaseTime = new DateTime( 1970, 1, 1, 0, 0, 0, 0 ); // per SWT psec - - NameValueCollection _properties; - // - string _serializedToken; - - /// - /// Initializes a new instance of the class. - /// This is an internal constructor that is only called from the when reading a token received from the wire. - /// - /// The collection representing all the key value pairs in the token. - /// The serialized form of the token. - internal SimpleWebToken( NameValueCollection properties, string serializedToken ) - : this(properties) - { - _serializedToken = serializedToken; - } - - /// - /// Initializes a new instance of the class. - /// - /// The collection representing all the key value pairs in the token. - public SimpleWebToken( NameValueCollection properties ) - { - if ( properties == null ) - { - throw new ArgumentNullException( "properties" ); - } - - _properties = properties; - } - - // - /// - /// Gets the Id of the token. - /// - /// The Id of the token. - public override string Id - { - get - { - return _properties[SimpleWebTokenConstants.Id]; - } - } - // - - // - /// - /// Gets the keys associated with this token. - /// - /// The keys associated with this token. - public override ReadOnlyCollection SecurityKeys - { - get - { - return new ReadOnlyCollection( new List() ); - } - } - // - - // - /// - /// Gets the time from when the token is valid. - /// - /// The time from when the token is valid. - public override DateTime ValidFrom - { - get - { - string validFrom = _properties[SimpleWebTokenConstants.ValidFrom]; - return GetTimeAsDateTime( String.IsNullOrEmpty( validFrom ) ? "0" : validFrom ); - } - } - // - - // - /// - /// Gets the time when the token expires. - /// - /// The time up to which the token is valid. - public override DateTime ValidTo - { - get - { - string expiryTime = _properties[SimpleWebTokenConstants.ExpiresOn]; - return GetTimeAsDateTime( String.IsNullOrEmpty( expiryTime ) ? "0" : expiryTime ); - } - } - // - - /// - /// Gets the Audience for the token. - /// - /// The audience of the token. - public string Audience - { - get - { - return _properties[SimpleWebTokenConstants.Audience]; - } - } - - /// - /// Gets the Issuer for the token. - /// - /// The issuer for the token. - public string Issuer - { - get - { - return _properties[SimpleWebTokenConstants.Issuer]; - } - } - - /// - /// Gets the signature for the token. - /// - /// The signature for the token. - public string Signature - { - get - { - return _properties[SimpleWebTokenConstants.Signature]; - } - } - - /// - /// Gets the serialized form of the token if the token was created from its serialized form by the token handler. - /// - /// The serialized form of the token. - public string SerializedToken - { - get - { - return _serializedToken; - } - } - - /// - /// Creates a copy of all key value pairs of the token. - /// - /// A copy of all the key value pairs in the token. - public NameValueCollection GetAllProperties() - { - return new NameValueCollection( _properties ); - } - - // - /// - /// Converts the time in seconds to a object based on the base time - /// defined by the Simple Web Token. - /// - /// The time in seconds. - /// The time as a object. - protected virtual DateTime GetTimeAsDateTime( string expiryTime ) - { - long totalSeconds = 0; - if ( !long.TryParse( expiryTime, out totalSeconds ) ) - { - throw new SecurityTokenException("Invalid expiry time. Expected the time to be in seconds passed from 1 January 1970."); - } - - long maxSeconds = (long)( DateTime.MaxValue - SwtBaseTime ).TotalSeconds - 1; - if ( totalSeconds > maxSeconds ) - { - totalSeconds = maxSeconds; - } - - return SwtBaseTime.AddSeconds( totalSeconds ); - } - // - } -} - -// diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.csproj b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.csproj deleted file mode 100644 index e85fd32f9b2..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.csproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Debug - AnyCPU - {6F39A351-52CC-42DB-B67C-C88EDA7B6ED2} - Library - Properties - SimpleWebToken - SimpleWebToken - v4.8 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs deleted file mode 100644 index 3ba84bc105e..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs +++ /dev/null @@ -1,30 +0,0 @@ -//----------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -//----------------------------------------------------------------------------- - -namespace SimpleWebToken -{ - // - /// - /// Defines the set of constants for the Simple Web Token. - /// - public static class SimpleWebTokenConstants - { - public const string Audience = "Audience"; - public const string ExpiresOn = "ExpiresOn"; - public const string Id = "Id"; - public const string Issuer = "Issuer"; - public const string Signature = "HMACSHA256"; - public const string ValidFrom = "ValidFrom"; - public const string ValueTypeUri = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0"; - } - // -} diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenhandler.cs b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenhandler.cs deleted file mode 100644 index 4ac5a7f2e1c..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenhandler.cs +++ /dev/null @@ -1,546 +0,0 @@ -//----------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -//----------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Configuration; -using System.Globalization; -using System.IdentityModel.Selectors; -using System.IdentityModel.Tokens; -using System.Security.Claims; -using System.Security.Cryptography; -using System.Text; -using System.Web; -using System.Xml; - -namespace SimpleWebToken -{ - /// - /// This class can parse and validate a Simple Web Token received on the incoming request. - /// - public class SimpleWebTokenHandler : SecurityTokenHandler - { - public const string SimpleWebTokenTypeUri = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0"; - - const string Base64EncodingType = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"; - const string EncodingType = "EncodingType"; - const string DefaultNameClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"; - const string AcsNameClaimType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"; - const char ParameterSeparator = '&'; - const string BinarySecurityToken = "binarySecurityToken"; - const string ValueType = "valueType"; - - /// - /// Initializes a new instance of the class. - /// - public SimpleWebTokenHandler() - { - } - - /// - /// Gets the System.Type of the SecurityToken is supported by ththis handler. - /// - /// The System.Type of the SecurityToken is supported by ththis handler. - public override Type TokenType - { - get - { - return typeof( SimpleWebToken ); - } - } - - /// - /// Indicates whether the current XML element can be read as a token of the type handled by this instance. - /// - /// An XML reader positioned at a start element. The reader should not be advanced. - /// True if the ReadToken method can the element. - public override bool CanReadToken( XmlReader reader ) - { - bool canRead = false; - - if ( reader != null ) - { - if ( reader.IsStartElement( BinarySecurityToken) - && ( reader.GetAttribute( ValueType ) == SimpleWebTokenConstants.ValueTypeUri ) ) - { - canRead = true; - } - } - - return canRead; - } - - /// - /// Gets a value indicating whether this handler can validate tokens of type . - /// - /// True if this handler can validate the token of type . - public override bool CanValidateToken - { - get - { - return true; - } - } - - /// - /// Gets a value indicating whether the SecurityTokenHandler can Serialize Tokens. Return true by default. - /// - /// True is the handler can serialize tokens of type . - public override bool CanWriteToken - { - get - { - return true; - } - } - - public override SecurityToken CreateToken(SecurityTokenDescriptor tokenDescriptor) - { - if (tokenDescriptor == null) - { - throw new ArgumentNullException("tokenDescriptor"); - } - - NameValueCollection properties = new NameValueCollection(); - properties.Add(SimpleWebTokenConstants.Id, Guid.NewGuid().ToString()); - properties.Add(SimpleWebTokenConstants.Issuer, tokenDescriptor.TokenIssuerName); - properties.Add(SimpleWebTokenConstants.Audience, tokenDescriptor.AppliesToAddress); - properties.Add(SimpleWebTokenConstants.ExpiresOn, SecondsFromSwtBaseTime(tokenDescriptor.Lifetime.Expires)); - properties.Add(SimpleWebTokenConstants.ValidFrom, SecondsFromSwtBaseTime(tokenDescriptor.Lifetime.Created)); - - foreach (Claim claim in tokenDescriptor.Subject.Claims) - { - properties.Add(claim.Type, claim.Value); - } - - SimpleWebToken token = new SimpleWebToken(properties); - return token; - } - - private string SecondsFromSwtBaseTime(DateTime? time) - { - DateTime date = time ?? SimpleWebToken.SwtBaseTime; - TimeSpan t1 = date.Subtract(SimpleWebToken.SwtBaseTime); - string seconds = ((long)t1.TotalSeconds).ToString(); - - return seconds; - } - - public override SecurityKeyIdentifierClause CreateSecurityTokenReference(SecurityToken token, bool attached) - { - return token.CreateKeyIdentifierClause(); - } - - /// - /// Returns the simple web token's token type that is supported by this handler. - /// - /// A list of supported token type identifiers. - public override string[] GetTokenTypeIdentifiers() - { - return new string[] { SimpleWebTokenTypeUri }; - } - - /// - /// Reads a serialized token and converts it into a . - /// - /// An XML reader positioned at the token's start element. - /// The parsed form of the token. - public override SecurityToken ReadToken( XmlReader reader ) - { - if ( reader == null ) - { - throw new ArgumentNullException( "reader" ); - } - - XmlDictionaryReader dictionaryReader = XmlDictionaryReader.CreateDictionaryReader(reader); - - byte[] binaryData; - string encoding = dictionaryReader.GetAttribute( EncodingType ); - if ( encoding == null || encoding == Base64EncodingType ) - { - dictionaryReader.Read(); - binaryData = dictionaryReader.ReadContentAsBase64(); - } - else - { - throw new SecurityTokenException( - "Cannot read SecurityToken as its encoding is" + encoding + ". Expected a BinarySecurityToken with base64 encoding."); - } - - string serializedToken = Encoding.UTF8.GetString(binaryData); - - return ReadSecurityTokenFromString(serializedToken); - } - - /// - /// Parse the string token and generates a . - /// - /// The serialized form of the token received. - /// The parsed form of the token. - protected SecurityToken ReadSecurityTokenFromString( string serializedToken ) - { - if (String.IsNullOrEmpty(serializedToken)) - { - throw new ArgumentException("The parameter 'serializedToken' cannot be null or empty string."); - } - - // Create a collection of SWT name value pairs - NameValueCollection properties = ParseToken( serializedToken ); - SimpleWebToken swt = new SimpleWebToken( properties, serializedToken ); - - return swt; - } - - /// - /// This methos validates the Simple Web Token. - /// - /// A simple web token. - /// A Claims Collection which contains all the claims from the token. - public override ReadOnlyCollection ValidateToken(SecurityToken token) - { - if ( token == null ) - { - throw new ArgumentNullException( "token" ); - } - - SimpleWebToken simpleWebToken = token as SimpleWebToken; - if ( simpleWebToken == null ) - { - throw new ArgumentException("The token provided must be of type SimpleWebToken."); - } - - if ( DateTime.Compare( simpleWebToken.ValidTo.Add( Configuration.MaxClockSkew ), DateTime.UtcNow ) <= 0 ) - { - throw new SecurityTokenExpiredException("The incoming token has expired. Get a new access token from the Authorization Server."); - } - - ValidateSignature( simpleWebToken ); - - ValidateAudience( simpleWebToken.Audience ); - - ClaimsIdentity claimsIdentity = CreateClaims( simpleWebToken ); - - if (this.Configuration.SaveBootstrapContext) - { - claimsIdentity.BootstrapContext = new BootstrapContext(simpleWebToken.SerializedToken); - } - - List claimCollection = new List(new ClaimsIdentity[] { claimsIdentity }); - return claimCollection.AsReadOnly(); - } - - /// - /// Serializes the given SecurityToken to the XmlWriter. - /// - /// XmlWriter into which the token is serialized. - /// SecurityToken to be serialized. - public override void WriteToken( XmlWriter writer, SecurityToken token ) - { - SimpleWebToken simpleWebToken = token as SimpleWebToken; - if ( simpleWebToken == null ) - { - throw new SecurityTokenException("The given token is not of the expected type 'SimpleWebToken'."); - } - - string signedToken = null; - - if ( String.IsNullOrEmpty( simpleWebToken.SerializedToken ) ) - { - StringBuilder strBuilder = new StringBuilder(); - - bool skipDelimiter = true; - NameValueCollection tokenProperties = simpleWebToken.GetAllProperties(); - - // remove the signature if present - if ( String.IsNullOrEmpty( tokenProperties[SimpleWebTokenConstants.Signature] ) ) - { - tokenProperties.Remove( SimpleWebTokenConstants.Signature ); - } - - foreach ( string key in tokenProperties.Keys ) - { - if ( tokenProperties[key] != null ) - { - if ( !skipDelimiter ) - { - strBuilder.Append( ParameterSeparator ); - } - - strBuilder.Append( String.Format( - CultureInfo.InvariantCulture, - "{0}={1}", - HttpUtility.UrlEncode( key ), - HttpUtility.UrlEncode( tokenProperties[key] ) ) ); - - skipDelimiter = false; - } - } - - string serializedToken = strBuilder.ToString(); - - SimpleWebTokenKeyIdentifierClause clause = new SimpleWebTokenKeyIdentifierClause(simpleWebToken.Audience); - InMemorySymmetricSecurityKey securityKey = null; - try - { - securityKey = (InMemorySymmetricSecurityKey)this.Configuration.IssuerTokenResolver.ResolveSecurityKey(clause); - } - catch (InvalidOperationException) - { - throw new SecurityTokenValidationException("A Symmetric key was not found for the given key identifier clause."); - } - - // append the signature - string signature = GenerateSignature( serializedToken, securityKey.GetSymmetricKey() ); - strBuilder.Append( String.Format( - CultureInfo.InvariantCulture, - "{0}{1}={2}", - ParameterSeparator, - HttpUtility.UrlEncode( SimpleWebTokenConstants.Signature ), - HttpUtility.UrlEncode( signature ) ) ); - - signedToken = strBuilder.ToString(); - } - else - { - // reuse the stored serialized token if present - signedToken = simpleWebToken.SerializedToken; - } - - string encodedToken = Convert.ToBase64String( Encoding.UTF8.GetBytes( signedToken ) ); - writer.WriteStartElement(BinarySecurityToken); - writer.WriteAttributeString("Id", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", token.Id); - writer.WriteAttributeString( ValueType, SimpleWebTokenConstants.ValueTypeUri ); - writer.WriteAttributeString( EncodingType, Base64EncodingType ); - writer.WriteString( encodedToken ); - writer.WriteEndElement(); - } - - /// - /// Generates an HMACSHA256 signature for a given string and key. - /// - /// The token to be signed. - /// The key used to generate the signature. - /// The generated signature. - protected static string GenerateSignature(string unsignedToken, byte[] signingKey) - { - using (HMACSHA256 hmac = new HMACSHA256(signingKey)) - { - byte[] signatureBytes = hmac.ComputeHash(Encoding.ASCII.GetBytes(unsignedToken)); - string signature = HttpUtility.UrlEncode(Convert.ToBase64String(signatureBytes)); - - return signature; - } - } - - /// - /// Validates the signature on the incoming token. - /// - /// The incoming . - protected virtual void ValidateSignature( SimpleWebToken simpleWebToken ) - { - if ( simpleWebToken == null ) - { - throw new ArgumentNullException( "simpleWebToken" ); - } - - if ( String.IsNullOrEmpty( simpleWebToken.SerializedToken ) || String.IsNullOrEmpty( simpleWebToken.Signature ) ) - { - throw new SecurityTokenValidationException( "The token does not have a signature to verify" ); - } - - string serializedToken = simpleWebToken.SerializedToken; - string unsignedToken = null; - - // Find the last parameter. The signature must be last per SWT specification. - int lastSeparator = serializedToken.LastIndexOf( ParameterSeparator ); - - // Check whether the last parameter is an hmac. - if ( lastSeparator > 0 ) - { - string lastParamStart = ParameterSeparator + SimpleWebTokenConstants.Signature + "="; - string lastParam = serializedToken.Substring( lastSeparator ); - - // Strip the trailing hmac to obtain the original unsigned string for later hmac verification. - if ( lastParam.StartsWith( lastParamStart, StringComparison.Ordinal ) ) - { - unsignedToken = serializedToken.Substring( 0, lastSeparator ); - } - } - - SimpleWebTokenKeyIdentifierClause clause = new SimpleWebTokenKeyIdentifierClause(simpleWebToken.Audience); - InMemorySymmetricSecurityKey securityKey = null; - try - { - securityKey = (InMemorySymmetricSecurityKey)this.Configuration.IssuerTokenResolver.ResolveSecurityKey(clause); - } - catch (InvalidOperationException) - { - throw new SecurityTokenValidationException( "A Symmetric key was not found for the given key identifier clause."); - } - - string generatedSignature = GenerateSignature( unsignedToken, securityKey.GetSymmetricKey() ); - - if ( string.CompareOrdinal( generatedSignature, simpleWebToken.Signature ) != 0 ) - { - throw new SecurityTokenValidationException( "The signature on the incoming token is invalid.") ; - } - } - - /// - /// Validates the audience of the incoming token with those specified in configuration. - /// - /// The audience of the incoming token. - protected virtual void ValidateAudience( string tokenAudience ) - { - if ( Configuration.AudienceRestriction.AudienceMode != AudienceUriMode.Never ) - { - if ( String.IsNullOrEmpty( tokenAudience ) ) - { - throw new SecurityTokenValidationException("The incoming token does not have a valid audience Uri and the Audience Restriction is not set to 'None'."); - } - - if ( Configuration.AudienceRestriction.AllowedAudienceUris.Count == 0 ) - { - throw new InvalidOperationException( " Audience Restriction is not set to 'None' but no valid audience URI's are configured." ); - } - - IList allowedAudienceUris = Configuration.AudienceRestriction.AllowedAudienceUris; - - Uri audienceUri = null; - - Uri.TryCreate(tokenAudience, UriKind.RelativeOrAbsolute, out audienceUri); - - // Strip off any query string or fragment. - Uri audienceLeftPart; - - if ( audienceUri.IsAbsoluteUri ) - { - audienceLeftPart = new Uri( audienceUri.GetLeftPart( UriPartial.Path ) ); - } - else - { - Uri baseUri = new Uri( "http://www.example.com" ); - Uri resolved = new Uri( baseUri, tokenAudience ); - audienceLeftPart = baseUri.MakeRelativeUri( new Uri( resolved.GetLeftPart( UriPartial.Path ) ) ); - } - - if ( !allowedAudienceUris.Contains( audienceLeftPart ) ) - { - throw new AudienceUriValidationFailedException( - "The Audience Uri of the incoming token is not present in the list of permitted Audience Uri's."); - } - } - } - - /// - /// Parses the token into a collection. - /// - /// The serialized token. - /// A colleciton of all name-value pairs from the token. - NameValueCollection ParseToken( string encodedToken ) - { - if ( String.IsNullOrEmpty( encodedToken ) ) - { - throw new ArgumentException( "The parameter 'encodedToken' cannot be null or empty string."); - } - - NameValueCollection keyValuePairs = new NameValueCollection(); - foreach ( string nameValue in encodedToken.Split( ParameterSeparator ) ) - { - string[] keyValueArray = nameValue.Split( '=' ); - - if ( ( keyValueArray.Length < 2 ) || String.IsNullOrEmpty( keyValueArray[0] ) ) - { - throw new SecurityTokenException("The incoming token was not in an expected format."); - } - - // Names must be decoded for the claim type case - string key = HttpUtility.UrlDecode( keyValueArray[0].Trim() ); - - // remove any unwanted " - string value = HttpUtility.UrlDecode( keyValueArray[1].Trim().Trim( '"' ) ); - keyValuePairs.Add( key, value ); - } - - return keyValuePairs; - } - - /// Creates 's from the incoming token. - /// - /// The incoming . - /// A created from the token. - protected virtual ClaimsIdentity CreateClaims( SimpleWebToken simpleWebToken ) - { - if ( simpleWebToken == null ) - { - throw new ArgumentNullException( "simpleWebToken" ); - } - - NameValueCollection tokenProperties = simpleWebToken.GetAllProperties(); - if ( tokenProperties == null ) - { - throw new SecurityTokenValidationException( "No claims can be created from this Simple Web Token." ); - } - - if ( Configuration.IssuerNameRegistry == null ) - { - throw new InvalidOperationException( "The Configuration.IssuerNameRegistry property of this SecurityTokenHandler is set to null. Tokens cannot be validated in this state." ); - } - - string normalizedIssuer = Configuration.IssuerNameRegistry.GetIssuerName( simpleWebToken ); - - ClaimsIdentity identity = new ClaimsIdentity(AuthenticationTypes.Federation); - - foreach ( string key in tokenProperties.Keys ) - { - if ( ! IsReservedKeyName(key) && !string.IsNullOrEmpty( tokenProperties[key] ) ) - { - identity.AddClaim( new Claim( key, tokenProperties[key], ClaimValueTypes.String, normalizedIssuer ) ); - if ( key == AcsNameClaimType ) - { - // add a default name claim from the Name identifier claim. - identity.AddClaim( new Claim( DefaultNameClaimType, tokenProperties[key], ClaimValueTypes.String, normalizedIssuer ) ); - } - } - } - - return identity; - } - - /// - /// Used to determine whether the parameter claim type is one of the reserved - /// SimpleWebToken claim types: Audience, HMACSHA256, ExpiresOn or Issuer. - /// - /// The key name to be compared. - /// True if the key is a reserved key name. - protected virtual bool IsReservedKeyName( string keyName ) - { - if ( String.IsNullOrEmpty( keyName ) ) - { - throw new ArgumentNullException( "keyName" ); - } - - switch ( keyName ) - { - case SimpleWebTokenConstants.Audience: - case SimpleWebTokenConstants.ExpiresOn: - case SimpleWebTokenConstants.Id: - case SimpleWebTokenConstants.Issuer: - case SimpleWebTokenConstants.ValidFrom: - case SimpleWebTokenConstants.Signature: return true; - default: return false; - } - } - } -} diff --git a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenkeyidentifierclause.cs b/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenkeyidentifierclause.cs deleted file mode 100644 index 6ba170b5d18..00000000000 --- a/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenkeyidentifierclause.cs +++ /dev/null @@ -1,55 +0,0 @@ -//----------------------------------------------------------------------------- -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF -// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO -// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A -// PARTICULAR PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -//----------------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.IdentityModel.Tokens; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SimpleWebToken -{ - public class SimpleWebTokenKeyIdentifierClause : SecurityKeyIdentifierClause - { - const string localId="SimpleWebToken"; - private string _audience; - - public SimpleWebTokenKeyIdentifierClause(string audience ) - :base (localId) - { - if (audience == null) - { - throw new ArgumentNullException("audience"); - } - _audience = audience; - } - - public string Audience - { - get - { - return _audience; - } - } - - public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) - { - if (keyIdentifierClause is SimpleWebTokenKeyIdentifierClause) - { - return true; - } - - return false; - } - } -} diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/AssemblyInfo.cs b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/AssemblyInfo.cs deleted file mode 100644 index 84aa55ed67a..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HtmlWindowProjectCSharp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MS")] -[assembly: AssemblyProduct("HtmlWindowProjectCSharp")] -[assembly: AssemblyCopyright("Copyright @ MS 2004")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -/// Setting ComVisible to false makes the types in this assembly not visible -/// to COM componenets. If you need to access a type in this assembly from -/// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.Designer.cs b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.Designer.cs deleted file mode 100644 index f41ebafa5aa..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace HtmlWindowProjectCSharp.Configuration { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HtmlWindowProjectCSharp.Configuration.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.resx b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.resx deleted file mode 100644 index 3e18af958a2..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Settings.cs b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Settings.cs deleted file mode 100644 index 36898c4e614..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Configuration/Settings.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.40930.0 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace HtmlWindowProjectCSharp.Configuration -{ - public partial class Settings : System.Configuration.ApplicationSettingsBase - { - private static Settings m_Value; - - private static object m_SyncObject = new object(); - - public static Settings Value - { - get - { - if ((Settings.m_Value == null)) - { - System.Threading.Monitor.Enter(Settings.m_SyncObject); - if ((Settings.m_Value == null)) - { - try - { - Settings.m_Value = new Settings(); - } - finally - { - System.Threading.Monitor.Exit(Settings.m_SyncObject); - } - } - } - return Settings.m_Value; - } - } - } -} diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.cs b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.cs deleted file mode 100644 index d6d6e946704..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.cs +++ /dev/null @@ -1,245 +0,0 @@ -using System; - -namespace HtmlWindowProjectCSharp -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.getLinksFromFramesButton = new System.Windows.Forms.Button(); - this.ShowModalDialogButton = new System.Windows.Forms.Button(); - this.OpenNewWindowOverBrowserButton = new System.Windows.Forms.Button(); - this.SetWindowStatusButton = new System.Windows.Forms.Button(); - this.resetFramesButton = new System.Windows.Forms.Button(); - this.balanceWindowButton = new System.Windows.Forms.Button(); - this.LoadOrderFormButton = new System.Windows.Forms.Button(); - this.OpenThreeWindowsButton = new System.Windows.Forms.Button(); - this.displayFirstUrlButton = new System.Windows.Forms.Button(); - this.displaySecondUrlButton = new System.Windows.Forms.Button(); - this.enableClickScrollButton = new System.Windows.Forms.Button(); - this.ResizeWindowButton = new System.Windows.Forms.Button(); - this.suppressScriptErrorButton = new System.Windows.Forms.Button(); - this.webBrowser1 = new System.Windows.Forms.WebBrowser(); - this.windowTimeout = new System.Windows.Forms.Timer(this.components); - this.button1 = new System.Windows.Forms.Button(); - this.flowLayoutPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.Controls.Add(this.getLinksFromFramesButton); - this.flowLayoutPanel1.Controls.Add(this.ShowModalDialogButton); - this.flowLayoutPanel1.Controls.Add(this.OpenNewWindowOverBrowserButton); - this.flowLayoutPanel1.Controls.Add(this.SetWindowStatusButton); - this.flowLayoutPanel1.Controls.Add(this.resetFramesButton); - this.flowLayoutPanel1.Controls.Add(this.balanceWindowButton); - this.flowLayoutPanel1.Controls.Add(this.LoadOrderFormButton); - this.flowLayoutPanel1.Controls.Add(this.OpenThreeWindowsButton); - this.flowLayoutPanel1.Controls.Add(this.displayFirstUrlButton); - this.flowLayoutPanel1.Controls.Add(this.displaySecondUrlButton); - this.flowLayoutPanel1.Controls.Add(this.enableClickScrollButton); - this.flowLayoutPanel1.Controls.Add(this.ResizeWindowButton); - this.flowLayoutPanel1.Controls.Add(this.suppressScriptErrorButton); - this.flowLayoutPanel1.Controls.Add(this.button1); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; - this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(896, 182); - this.flowLayoutPanel1.TabIndex = 0; - // - // getLinksFromFramesButton - // - this.getLinksFromFramesButton.Location = new System.Drawing.Point(3, 3); - this.getLinksFromFramesButton.Name = "getLinksFromFramesButton"; - this.getLinksFromFramesButton.Size = new System.Drawing.Size(166, 23); - this.getLinksFromFramesButton.TabIndex = 0; - this.getLinksFromFramesButton.Text = "Get Links From Frames"; - this.getLinksFromFramesButton.Click += new System.EventHandler(this.getLinksFromFramesButton_Click); - // - // ShowModalDialogButton - // - this.ShowModalDialogButton.Location = new System.Drawing.Point(175, 3); - this.ShowModalDialogButton.Name = "ShowModalDialogButton"; - this.ShowModalDialogButton.Size = new System.Drawing.Size(193, 23); - this.ShowModalDialogButton.TabIndex = 1; - this.ShowModalDialogButton.Text = "Show Modal Dialog"; - this.ShowModalDialogButton.Click += new System.EventHandler(this.ShowModalDialogButton_Click); - // - // OpenNewWindowOverBrowserButton - // - this.OpenNewWindowOverBrowserButton.Location = new System.Drawing.Point(374, 3); - this.OpenNewWindowOverBrowserButton.Name = "OpenNewWindowOverBrowserButton"; - this.OpenNewWindowOverBrowserButton.Size = new System.Drawing.Size(229, 23); - this.OpenNewWindowOverBrowserButton.TabIndex = 2; - this.OpenNewWindowOverBrowserButton.Text = "Open New Window Over Browser"; - this.OpenNewWindowOverBrowserButton.Click += new System.EventHandler(this.OpenNewWindowOverBrowserButton_Click); - // - // SetWindowStatusButton - // - this.SetWindowStatusButton.Location = new System.Drawing.Point(609, 3); - this.SetWindowStatusButton.Name = "SetWindowStatusButton"; - this.SetWindowStatusButton.Size = new System.Drawing.Size(164, 23); - this.SetWindowStatusButton.TabIndex = 3; - this.SetWindowStatusButton.Text = "Set Window Status"; - this.SetWindowStatusButton.Click += new System.EventHandler(this.SetWindowStatusButton_Click); - // - // resetFramesButton - // - this.resetFramesButton.Location = new System.Drawing.Point(3, 32); - this.resetFramesButton.Name = "resetFramesButton"; - this.resetFramesButton.Size = new System.Drawing.Size(142, 23); - this.resetFramesButton.TabIndex = 4; - this.resetFramesButton.Text = "Reset Frames"; - this.resetFramesButton.Click += new System.EventHandler(this.resetFramesButton_Click); - // - // balanceWindowButton - // - this.balanceWindowButton.Location = new System.Drawing.Point(151, 32); - this.balanceWindowButton.Name = "balanceWindowButton"; - this.balanceWindowButton.Size = new System.Drawing.Size(190, 23); - this.balanceWindowButton.TabIndex = 5; - this.balanceWindowButton.Text = "Balance Window"; - this.balanceWindowButton.Click += new System.EventHandler(this.balanceWindowButton_Click); - // - // LoadOrderFormButton - // - this.LoadOrderFormButton.Location = new System.Drawing.Point(347, 32); - this.LoadOrderFormButton.Name = "LoadOrderFormButton"; - this.LoadOrderFormButton.Size = new System.Drawing.Size(175, 23); - this.LoadOrderFormButton.TabIndex = 6; - this.LoadOrderFormButton.Text = "Load Order Form"; - this.LoadOrderFormButton.Click += new System.EventHandler(this.LoadOrderFormButton_Click); - // - // OpenThreeWindowsButton - // - this.OpenThreeWindowsButton.Location = new System.Drawing.Point(528, 32); - this.OpenThreeWindowsButton.Name = "OpenThreeWindowsButton"; - this.OpenThreeWindowsButton.Size = new System.Drawing.Size(168, 23); - this.OpenThreeWindowsButton.TabIndex = 7; - this.OpenThreeWindowsButton.Text = "Open Three Windows"; - this.OpenThreeWindowsButton.Click += new System.EventHandler(this.OpenThreeWindowsButton_Click); - // - // displayFirstUrlButton - // - this.displayFirstUrlButton.Location = new System.Drawing.Point(702, 32); - this.displayFirstUrlButton.Name = "displayFirstUrlButton"; - this.displayFirstUrlButton.Size = new System.Drawing.Size(141, 23); - this.displayFirstUrlButton.TabIndex = 8; - this.displayFirstUrlButton.Text = "Display First URL"; - this.displayFirstUrlButton.Click += new System.EventHandler(this.displayFirstUrlButton_Click); - // - // displaySecondUrlButton - // - this.displaySecondUrlButton.Location = new System.Drawing.Point(3, 61); - this.displaySecondUrlButton.Name = "displaySecondUrlButton"; - this.displaySecondUrlButton.Size = new System.Drawing.Size(166, 23); - this.displaySecondUrlButton.TabIndex = 9; - this.displaySecondUrlButton.Text = "Display Second URL"; - this.displaySecondUrlButton.Click += new System.EventHandler(this.displaySecondUrlButton_Click); - // - // enableClickScrollButton - // - this.enableClickScrollButton.Location = new System.Drawing.Point(175, 61); - this.enableClickScrollButton.Name = "enableClickScrollButton"; - this.enableClickScrollButton.Size = new System.Drawing.Size(166, 23); - this.enableClickScrollButton.TabIndex = 10; - this.enableClickScrollButton.Text = "Enable Click Scroll"; - this.enableClickScrollButton.Click += new System.EventHandler(this.enableClickScrollButton_Click); - // - // ResizeWindowButton - // - this.ResizeWindowButton.Location = new System.Drawing.Point(347, 61); - this.ResizeWindowButton.Name = "ResizeWindowButton"; - this.ResizeWindowButton.Size = new System.Drawing.Size(152, 23); - this.ResizeWindowButton.TabIndex = 11; - this.ResizeWindowButton.Text = "Resize Window"; - this.ResizeWindowButton.Click += new System.EventHandler(this.ResizeWindowButton_Click); - // - // suppressScriptErrorButton - // - this.suppressScriptErrorButton.Location = new System.Drawing.Point(505, 61); - this.suppressScriptErrorButton.Name = "suppressScriptErrorButton"; - this.suppressScriptErrorButton.Size = new System.Drawing.Size(191, 23); - this.suppressScriptErrorButton.TabIndex = 12; - this.suppressScriptErrorButton.Text = "Suppress Script Error"; - this.suppressScriptErrorButton.Click += new System.EventHandler(this.suppressScriptErrorButton_Click); - // - // webBrowser1 - // - this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; - this.webBrowser1.Location = new System.Drawing.Point(0, 182); - this.webBrowser1.Name = "webBrowser1"; - this.webBrowser1.Size = new System.Drawing.Size(896, 361); - this.webBrowser1.TabIndex = 1; - this.webBrowser1.Url = new System.Uri("file://C:\\\\testStatusBarText.htm", System.UriKind.Absolute); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(702, 61); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(141, 23); - this.button1.TabIndex = 13; - this.button1.Text = "Surf to error"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // Form1 - // - this.ClientSize = new System.Drawing.Size(896, 543); - this.Controls.Add(this.webBrowser1); - this.Controls.Add(this.flowLayoutPanel1); - this.Name = "Form1"; - this.Text = "Form1"; - this.flowLayoutPanel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.Button getLinksFromFramesButton; - private System.Windows.Forms.WebBrowser webBrowser1; - private System.Windows.Forms.Button ShowModalDialogButton; - private System.Windows.Forms.Button OpenNewWindowOverBrowserButton; - private System.Windows.Forms.Button SetWindowStatusButton; - private System.Windows.Forms.Button resetFramesButton; - private System.Windows.Forms.Button balanceWindowButton; - private System.Windows.Forms.Timer windowTimeout; - private System.Windows.Forms.Button LoadOrderFormButton; - private System.Windows.Forms.Button OpenThreeWindowsButton; - private System.Windows.Forms.Button displayFirstUrlButton; - private System.Windows.Forms.Button displaySecondUrlButton; - private System.Windows.Forms.Button enableClickScrollButton; - private System.Windows.Forms.Button ResizeWindowButton; - private System.Windows.Forms.Button suppressScriptErrorButton; - private System.Windows.Forms.Button button1; - } -} - diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs deleted file mode 100644 index 9583814b652..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs +++ /dev/null @@ -1,342 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Windows.Forms; -using System.Collections; - -namespace HtmlWindowProjectCSharp -{ - partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - - private void getLinksFromFramesButton_Click(object sender, EventArgs e) - { - GetLinksFromFrames(); - } - - // - private void GetLinksFromFrames() - { - Hashtable linksTable = new Hashtable(); - string frameUrl; - - if (!(webBrowser1.Document == null)) - { - HtmlWindow currentWindow = webBrowser1.Document.Window; - if (currentWindow.Frames.Count > 0) - { - foreach (HtmlWindow frame in currentWindow.Frames) - { - frameUrl = frame.Url.ToString(); - Hashtable frameLinksHash = new Hashtable(); - - linksTable.Add(frameUrl, frameLinksHash); - foreach (HtmlElement hrefElement in frame.Document.Links) - { - frameLinksHash.Add(hrefElement.GetAttribute("HREF"), "Url"); - } - } - } - else - { - Hashtable docLinksHash = new Hashtable(); - linksTable.Add(webBrowser1.Document.Url.ToString(), docLinksHash); - - foreach (HtmlElement hrefElement in webBrowser1.Document.Links) - { - docLinksHash.Add(hrefElement.GetAttribute("HREF"), "Url"); - } - } - } - } - // - - private void ShowModalDialogButton_Click(object sender, EventArgs e) - { - ShowModalDialog(); - } - - // - private void ShowModalDialog() - { - if (!(webBrowser1.Document == null)) - { - HtmlWindow frame = webBrowser1.Document.Window; - - String dialogArguments = "dialogHeight: 250px; dialogWidth: 300px; dialogTop: 300px;" + - "dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; resizable: No; status: No;"; - - // Show the dialog. - mshtml.IHTMLWindow2 rawWindow = (mshtml.IHTMLWindow2)frame.DomWindow; - Object o = new Object(); - Object args = (Object)dialogArguments; - rawWindow.showModalDialog("http://www.adatum.com/dialogWindow.htm", ref o, ref args); - } - } - // - - private void OpenNewWindowOverBrowserButton_Click(object sender, EventArgs e) - { - OpenNewWindowOverBrowser(); - } - - // - private void OpenNewWindowOverBrowser() - { - if (webBrowser1.Document != null) - { - HtmlWindow docWindow = webBrowser1.Document.Window; - HtmlWindow newWindow = docWindow.OpenNew(new Uri("http://www.adatum.com/popup.htm"), "left=" + docWindow.Position.X + ",top=" + docWindow.Position.Y + ",width=" + webBrowser1.Width + ",height=" + webBrowser1.Height); - } - } - // - - private void SetWindowStatusButton_Click(object sender, EventArgs e) - { - SetWindowStatus(); - } - - // - HtmlWindow popWindow = null; - - private void SetWindowStatus() - { - if (webBrowser1.Document != null) - { - HtmlWindow docWindow = webBrowser1.Document.Window; - popWindow = docWindow.OpenNew(new Uri("file://C:\\testStatusBarText.htm"), ""); - popWindow.Load += new HtmlElementEventHandler(popWindow_Load); - } - } - - void popWindow_Load(object sender, HtmlElementEventArgs e) - { - MessageBox.Show("Loaded!"); - } - // - - private void resetFramesButton_Click(object sender, EventArgs e) - { - } - - // - private void ResetFrames() - { - if (!(webBrowser1.Document == null)) - { - HtmlElement frameElement = null; - HtmlWindow docWindow = webBrowser1.Document.Window; - - foreach (HtmlWindow frameWindow in docWindow.Frames) - { - frameElement = frameWindow.WindowFrameElement; - String originalUrl = frameElement.GetAttribute("SRC"); - - if (!originalUrl.Equals(frameWindow.Url.ToString())) - { - frameWindow.Navigate(new Uri(originalUrl)); - } - } - } - } - // - - // - HtmlWindow balanceWindow; - - private void balanceWindowButton_Click(object sender, EventArgs e) - { - if (!(webBrowser1.Document == null)) - { - balanceWindow = webBrowser1.Document.Window.OpenNew(new Uri("http://www.adatum.com/viewBalances.aspx"), "dialogHeight: 250px; dialogWidth: 300px; " + - " dialogTop: 300px; dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; " + - "resizable: No; status: No;"); - - //Listen for activity on the document. - webBrowser1.Document.Click += new HtmlElementEventHandler(Document_Click); - - windowTimeout.Interval = 300000; - windowTimeout.Start(); - } - } - - private void Document_Click(object sender, HtmlElementEventArgs e) - { - windowTimeout.Stop(); - windowTimeout.Start(); - } - - private void windowTimeout_Tick(object sender, EventArgs e) - { - if (!balanceWindow.IsClosed) - { - balanceWindow.Close(); - windowTimeout.Stop(); - } - } - // - - private void LoadOrderFormButton_Click(object sender, EventArgs e) - { - LoadOrderForm(); - } - - // - HtmlWindow orderWindow; - HtmlElement formElement; - - private void LoadOrderForm() - { - if (!(webBrowser1.Document == null)) - { - HtmlDocument doc = webBrowser1.Document; - orderWindow = doc.Window.OpenNew(new Uri("file://C:\\orderForm.htm"), ""); - - //!TODO: Perform this in the load event handler! - // Get order form. - HtmlElementCollection elemCollection = doc.All.GetElementsByName("NewOrderForm"); - if (elemCollection.Count == 1) - { - formElement = elemCollection[0]; - //!TODO: Awaiting DCR - //formElement.AttachEventHandler("onsubmit", new HtmlElementEventHandler(Form_Submit)); - } - } - } - - private void Form_Submit(object sender, HtmlElementEventArgs e) - { - bool doOrder = orderWindow.Confirm("Once you transmit this order, you cannot cancel it. Submit?"); - if (!doOrder) - { - //Cancel the submit. - e.ReturnValue = false; - orderWindow.Alert("Submit cancelled."); - } - } - // - - private void OpenThreeWindowsButton_Click(object sender, EventArgs e) - { - } - - // - private void DisplayFirstUrl() - { - if (webBrowser1.Document != null) - { - //If this is called first, the window will only have a status bar. - webBrowser1.Document.Window.Open(new Uri("http://www.microsoft.com/"), "displayWindow", "status=yes,width=200,height=400", false); - } - } - - private void DisplaySecondUrl() - { - if (webBrowser1.Document != null) - { - // If this is called first, the window will only have an Address bar. - webBrowser1.Document.Window.Open(new Uri("http://msdn.microsoft.com/"), "displayWindow", "width=400,height=200,location=yes", false); - } - } - // - - private void displayFirstUrlButton_Click(object sender, EventArgs e) - { - DisplayFirstUrl(); - } - - private void displaySecondUrlButton_Click(object sender, EventArgs e) - { - DisplaySecondUrl(); - } - - private void enableClickScrollButton_Click(object sender, EventArgs e) - { - EnableClickScroll(); - } - - // - private void EnableClickScroll() - { - if (webBrowser1.Document != null) - { - webBrowser1.Document.Click += new HtmlElementEventHandler(Doc_Click); - } - } - - private void Doc_Click(object sender, HtmlElementEventArgs e) - { - HtmlWindow docWindow = webBrowser1.Document.Window; - docWindow.ScrollTo(e.MousePosition.X, e.MousePosition.Y); - } - // - - private void ResizeWindowButton_Click(object sender, EventArgs e) - { - ResizeWindow(); - } - - // - HtmlWindow resizableWindow = null; - - private void ResizeWindow() - { - if (webBrowser1.Document != null) - { - resizableWindow = webBrowser1.Document.Window.OpenNew(new Uri("http://www.microsoft.com/"), ""); - resizableWindow.ResizeTo(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height); - } - } - // - - private void suppressScriptErrorButton_Click(object sender, EventArgs e) - { - SuppressScriptErrors(); - } - - // - private void SuppressScriptErrors() - { - if (webBrowser1.Document != null) - { - webBrowser1.Document.Window.Error += new HtmlElementErrorEventHandler(scriptWindow_Error); - } - } - - private void scriptWindow_Error(object sender, HtmlElementErrorEventArgs e) - { - MessageBox.Show("Suppressed error!"); - e.Handled = true; - } - // - - // - HtmlWindow restrictedWindow; - - private void OpenRestrictedWindow() - { - if (webBrowser1.Document != null) - { - restrictedWindow = webBrowser1.Document.Window.OpenNew(new Uri("http://www.adatum.com/"), "width=300,height=300,resizable=yes"); - // restrictedWindow.ResizeStart += new HtmlElementEventHandler(restrictedWindow_ResizeStart); - } - } - - private void restrictedWindow_ResizeStart(object sender, HtmlElementEventArgs e) - { - e.ReturnValue = true; - } - - private void button1_Click(object sender, EventArgs e) - { - webBrowser1.Document.Window.Navigate(new Uri("file://C:\\testError.htm")); - } - // - } -} diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx deleted file mode 100644 index 29aa8d8e609..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProjectCSharp.csproj b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProjectCSharp.csproj deleted file mode 100644 index c1f242d0dcc..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProjectCSharp.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - Debug - AnyCPU - 8.0.41129 - 2.0 - {CD35278B-CFFA-4756-A63C-43333D49493A} - WinExe - HtmlWindowProjectCSharp - HtmlWindowProjectCSharp - 4 - - - - - 2.0 - v4.8 - - - - true - full - false - .\bin\Debug\ - DEBUG;TRACE - false - - - pdbonly - true - .\bin\Release\ - TRACE - false - - - - - - - - - - - - - True - True - Resources.resx - - - Form - - - Form1.cs - - - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - Form1.cs - Designer - - - - SettingsSingleFileGenerator - Settings.cs - - - True - Settings.settings - True - - - - \ No newline at end of file diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Program.cs b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Program.cs deleted file mode 100644 index c8c19dcee6c..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Windows.Forms; - -namespace HtmlWindowProjectCSharp -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.Run(new Form1()); - } - } -} \ No newline at end of file diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config deleted file mode 100644 index 3e0e37cfc8c..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/snippets.5000.json b/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/snippets.5000.json deleted file mode 100644 index da9ebf8da2f..00000000000 --- a/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/snippets.5000.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "host": "visualstudio" -} diff --git a/snippets/csharp/System/Decimal/Parse/Default.aspx.cs b/snippets/csharp/System/Decimal/Parse/Default.aspx.cs index 77846da8358..8cc7d6ecd98 100644 --- a/snippets/csharp/System/Decimal/Parse/Default.aspx.cs +++ b/snippets/csharp/System/Decimal/Parse/Default.aspx.cs @@ -1,12 +1,26 @@ using System; using System.Globalization; -using System.Web.UI.WebControls; -public partial class Default2 : System.Web.UI.Page +public partial class Default2 { - // controls on web form - TextBox inputNumber; - Label outputNumber; + private sealed class TextBox + { + public string Text { get; set; } = String.Empty; + } + + private sealed class Label + { + public string Text { get; set; } = String.Empty; + } + + private sealed class RequestContext + { + public string[] UserLanguages { get; } = [CultureInfo.CurrentCulture.Name]; + } + + private readonly TextBox inputNumber = new(); + private readonly Label outputNumber = new(); + private RequestContext Request { get; } = new(); // protected void OkToSingle_Click(object sender, EventArgs e) diff --git a/snippets/csharp/System/Decimal/Parse/parsemethod.csproj b/snippets/csharp/System/Decimal/Parse/parsemethod.csproj index 705285b7338..1eddf5e00ac 100644 --- a/snippets/csharp/System/Decimal/Parse/parsemethod.csproj +++ b/snippets/csharp/System/Decimal/Parse/parsemethod.csproj @@ -1,47 +1,6 @@ - - + - Release - AnyCPU - 9.0.30729 - 2.0 - {E775BC68-D15B-4888-9246-42A0F2541934} Library - CSClassLibrary - CSClassLibrary - v4.8 - 512 - - - - - 3.5 - + net10.0 - - none - false - . - prompt - 4 - false - - - - - - - - - ASPXCodeBehind - - - - - \ No newline at end of file + diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.vb b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.vb deleted file mode 100644 index 076afa8087c..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.Designer.vb +++ /dev/null @@ -1,236 +0,0 @@ -Partial Public Class Form1 - Inherits System.Windows.Forms.Form - - _ - Public Sub New() - MyBase.New() - - 'This call is required by the Windows Form Designer. - InitializeComponent() - - End Sub - - 'Form overrides dispose to clean up the component list. - _ - Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - MyBase.Dispose(disposing) - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.components = New System.ComponentModel.Container - Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel - Me.GetLinksFromFramesButton = New System.Windows.Forms.Button - Me.ShowModalDialogButton = New System.Windows.Forms.Button - Me.OpenNewWindowOverBrowserButton = New System.Windows.Forms.Button - Me.SetWindowStatusButton = New System.Windows.Forms.Button - Me.ResetFramesButton = New System.Windows.Forms.Button - Me.BalanceWindowButton = New System.Windows.Forms.Button - Me.NewOrderButton = New System.Windows.Forms.Button - Me.OpenThreeWindowsButton = New System.Windows.Forms.Button - Me.WindowOpenOnExeButton = New System.Windows.Forms.Button - Me.DisplayWindow1Button = New System.Windows.Forms.Button - Me.DisplayWindow2Button = New System.Windows.Forms.Button - Me.EnableClickScrollButton = New System.Windows.Forms.Button - Me.WebBrowser1 = New System.Windows.Forms.WebBrowser - Me.WindowTimeout = New System.Windows.Forms.Timer(Me.components) - Me.ResizeWindowButton = New System.Windows.Forms.Button - Me.SuppressScriptErrorsButton = New System.Windows.Forms.Button - Me.OpenRestrictedWindowButton = New System.Windows.Forms.Button - Me.FlowLayoutPanel1.SuspendLayout() - Me.SuspendLayout() - ' - 'FlowLayoutPanel1 - ' - Me.FlowLayoutPanel1.Controls.Add(Me.GetLinksFromFramesButton) - Me.FlowLayoutPanel1.Controls.Add(Me.ShowModalDialogButton) - Me.FlowLayoutPanel1.Controls.Add(Me.OpenNewWindowOverBrowserButton) - Me.FlowLayoutPanel1.Controls.Add(Me.SetWindowStatusButton) - Me.FlowLayoutPanel1.Controls.Add(Me.ResetFramesButton) - Me.FlowLayoutPanel1.Controls.Add(Me.BalanceWindowButton) - Me.FlowLayoutPanel1.Controls.Add(Me.NewOrderButton) - Me.FlowLayoutPanel1.Controls.Add(Me.OpenThreeWindowsButton) - Me.FlowLayoutPanel1.Controls.Add(Me.WindowOpenOnExeButton) - Me.FlowLayoutPanel1.Controls.Add(Me.DisplayWindow1Button) - Me.FlowLayoutPanel1.Controls.Add(Me.DisplayWindow2Button) - Me.FlowLayoutPanel1.Controls.Add(Me.EnableClickScrollButton) - Me.FlowLayoutPanel1.Controls.Add(Me.ResizeWindowButton) - Me.FlowLayoutPanel1.Controls.Add(Me.SuppressScriptErrorsButton) - Me.FlowLayoutPanel1.Controls.Add(Me.OpenRestrictedWindowButton) - Me.FlowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top - Me.FlowLayoutPanel1.Location = New System.Drawing.Point(0, 0) - Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1" - Me.FlowLayoutPanel1.Size = New System.Drawing.Size(919, 133) - Me.FlowLayoutPanel1.TabIndex = 0 - ' - 'GetLinksFromFramesButton - ' - Me.GetLinksFromFramesButton.Location = New System.Drawing.Point(3, 3) - Me.GetLinksFromFramesButton.Name = "GetLinksFromFramesButton" - Me.GetLinksFromFramesButton.Size = New System.Drawing.Size(202, 23) - Me.GetLinksFromFramesButton.TabIndex = 0 - Me.GetLinksFromFramesButton.Text = "Get Links From Frames" - ' - 'ShowModalDialogButton - ' - Me.ShowModalDialogButton.Location = New System.Drawing.Point(211, 3) - Me.ShowModalDialogButton.Name = "ShowModalDialogButton" - Me.ShowModalDialogButton.Size = New System.Drawing.Size(170, 23) - Me.ShowModalDialogButton.TabIndex = 1 - Me.ShowModalDialogButton.Text = "Show Modal Dialog" - ' - 'OpenNewWindowOverBrowserButton - ' - Me.OpenNewWindowOverBrowserButton.Location = New System.Drawing.Point(387, 3) - Me.OpenNewWindowOverBrowserButton.Name = "OpenNewWindowOverBrowserButton" - Me.OpenNewWindowOverBrowserButton.Size = New System.Drawing.Size(207, 23) - Me.OpenNewWindowOverBrowserButton.TabIndex = 2 - Me.OpenNewWindowOverBrowserButton.Text = "Open New Window Over Browser" - ' - 'SetWindowStatusButton - ' - Me.SetWindowStatusButton.Location = New System.Drawing.Point(600, 3) - Me.SetWindowStatusButton.Name = "SetWindowStatusButton" - Me.SetWindowStatusButton.Size = New System.Drawing.Size(170, 23) - Me.SetWindowStatusButton.TabIndex = 3 - Me.SetWindowStatusButton.Text = "Set Window Status" - ' - 'ResetFramesButton - ' - Me.ResetFramesButton.Location = New System.Drawing.Point(3, 32) - Me.ResetFramesButton.Name = "ResetFramesButton" - Me.ResetFramesButton.Size = New System.Drawing.Size(165, 23) - Me.ResetFramesButton.TabIndex = 4 - Me.ResetFramesButton.Text = "Reset Frames" - ' - 'BalanceWindowButton - ' - Me.BalanceWindowButton.Location = New System.Drawing.Point(174, 32) - Me.BalanceWindowButton.Name = "BalanceWindowButton" - Me.BalanceWindowButton.Size = New System.Drawing.Size(152, 23) - Me.BalanceWindowButton.TabIndex = 5 - Me.BalanceWindowButton.Text = "Balance Window" - ' - 'NewOrderButton - ' - Me.NewOrderButton.Location = New System.Drawing.Point(332, 32) - Me.NewOrderButton.Name = "NewOrderButton" - Me.NewOrderButton.Size = New System.Drawing.Size(188, 23) - Me.NewOrderButton.TabIndex = 6 - Me.NewOrderButton.Text = "New Order" - ' - 'OpenThreeWindowsButton - ' - Me.OpenThreeWindowsButton.Location = New System.Drawing.Point(526, 32) - Me.OpenThreeWindowsButton.Name = "OpenThreeWindowsButton" - Me.OpenThreeWindowsButton.Size = New System.Drawing.Size(190, 23) - Me.OpenThreeWindowsButton.TabIndex = 7 - Me.OpenThreeWindowsButton.Text = "Open Three Windows" - ' - 'WindowOpenOnExeButton - ' - Me.WindowOpenOnExeButton.Location = New System.Drawing.Point(722, 32) - Me.WindowOpenOnExeButton.Name = "WindowOpenOnExeButton" - Me.WindowOpenOnExeButton.Size = New System.Drawing.Size(185, 23) - Me.WindowOpenOnExeButton.TabIndex = 8 - Me.WindowOpenOnExeButton.Text = "Window Open on EXE" - ' - 'DisplayWindow1Button - ' - Me.DisplayWindow1Button.Location = New System.Drawing.Point(3, 61) - Me.DisplayWindow1Button.Name = "DisplayWindow1Button" - Me.DisplayWindow1Button.Size = New System.Drawing.Size(125, 23) - Me.DisplayWindow1Button.TabIndex = 9 - Me.DisplayWindow1Button.Text = "Display Window 1" - ' - 'DisplayWindow2Button - ' - Me.DisplayWindow2Button.Location = New System.Drawing.Point(134, 61) - Me.DisplayWindow2Button.Name = "DisplayWindow2Button" - Me.DisplayWindow2Button.Size = New System.Drawing.Size(141, 23) - Me.DisplayWindow2Button.TabIndex = 10 - Me.DisplayWindow2Button.Text = "Display Window 2" - ' - 'EnableClickScrollButton - ' - Me.EnableClickScrollButton.Location = New System.Drawing.Point(281, 61) - Me.EnableClickScrollButton.Name = "EnableClickScrollButton" - Me.EnableClickScrollButton.Size = New System.Drawing.Size(150, 23) - Me.EnableClickScrollButton.TabIndex = 11 - Me.EnableClickScrollButton.Text = "Enable Click Scroll" - ' - 'WebBrowser1 - ' - Me.WebBrowser1.Dock = System.Windows.Forms.DockStyle.Fill - Me.WebBrowser1.Location = New System.Drawing.Point(0, 133) - Me.WebBrowser1.Name = "WebBrowser1" - Me.WebBrowser1.Size = New System.Drawing.Size(919, 421) - Me.WebBrowser1.TabIndex = 1 - ' - 'WindowTimeout - ' - ' - 'ResizeWindowButton - ' - Me.ResizeWindowButton.Location = New System.Drawing.Point(437, 61) - Me.ResizeWindowButton.Name = "ResizeWindowButton" - Me.ResizeWindowButton.Size = New System.Drawing.Size(174, 23) - Me.ResizeWindowButton.TabIndex = 12 - Me.ResizeWindowButton.Text = "Resize Window" - ' - 'SuppressScriptErrorsButton - ' - Me.SuppressScriptErrorsButton.Location = New System.Drawing.Point(617, 61) - Me.SuppressScriptErrorsButton.Name = "SuppressScriptErrorsButton" - Me.SuppressScriptErrorsButton.Size = New System.Drawing.Size(193, 23) - Me.SuppressScriptErrorsButton.TabIndex = 13 - Me.SuppressScriptErrorsButton.Text = "Suppress Script Errors" - ' - 'OpenRestrictedWindowButton - ' - Me.OpenRestrictedWindowButton.Location = New System.Drawing.Point(3, 90) - Me.OpenRestrictedWindowButton.Name = "OpenRestrictedWindowButton" - Me.OpenRestrictedWindowButton.Size = New System.Drawing.Size(198, 23) - Me.OpenRestrictedWindowButton.TabIndex = 14 - Me.OpenRestrictedWindowButton.Text = "Open Restricted Window" - ' - 'Form1 - ' - Me.ClientSize = New System.Drawing.Size(919, 554) - Me.Controls.Add(Me.WebBrowser1) - Me.Controls.Add(Me.FlowLayoutPanel1) - Me.Name = "Form1" - Me.Text = "Form1" - Me.FlowLayoutPanel1.ResumeLayout(False) - Me.ResumeLayout(False) - - End Sub - Friend WithEvents FlowLayoutPanel1 As System.Windows.Forms.FlowLayoutPanel - Friend WithEvents GetLinksFromFramesButton As System.Windows.Forms.Button - Friend WithEvents WebBrowser1 As System.Windows.Forms.WebBrowser - Friend WithEvents ShowModalDialogButton As System.Windows.Forms.Button - Friend WithEvents OpenNewWindowOverBrowserButton As System.Windows.Forms.Button - Friend WithEvents SetWindowStatusButton As System.Windows.Forms.Button - Friend WithEvents ResetFramesButton As System.Windows.Forms.Button - Friend WithEvents BalanceWindowButton As System.Windows.Forms.Button - Friend WithEvents WindowTimeout As System.Windows.Forms.Timer - Friend WithEvents NewOrderButton As System.Windows.Forms.Button - Friend WithEvents OpenThreeWindowsButton As System.Windows.Forms.Button - Friend WithEvents WindowOpenOnExeButton As System.Windows.Forms.Button - Friend WithEvents DisplayWindow1Button As System.Windows.Forms.Button - Friend WithEvents DisplayWindow2Button As System.Windows.Forms.Button - Friend WithEvents EnableClickScrollButton As System.Windows.Forms.Button - Friend WithEvents ResizeWindowButton As System.Windows.Forms.Button - Friend WithEvents SuppressScriptErrorsButton As System.Windows.Forms.Button - Friend WithEvents OpenRestrictedWindowButton As System.Windows.Forms.Button - -End Class diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx deleted file mode 100644 index 25c2f26478d..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb deleted file mode 100644 index 54037eff4f0..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb +++ /dev/null @@ -1,333 +0,0 @@ -Imports System.Windows.Forms - -Public Class Form1 - Public Shared Sub Main() - End Sub - - Private Sub GetLinksFromFramesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetLinksFromFramesButton.Click - Me.GetLinksFromFrames() - End Sub - - ' - Dim LinksTable As Hashtable - - Private Sub GetLinksFromFrames() - LinksTable = New Hashtable() - Dim FrameUrl As String - - If (WebBrowser1.Document IsNot Nothing) Then - With WebBrowser1.Document - Dim CurrentWindow As HtmlWindow = .Window - If (CurrentWindow.Frames.Count > 0) Then - For Each Frame As HtmlWindow In CurrentWindow.Frames - FrameUrl = Frame.Url.ToString() - Dim FrameLinksHash As New Hashtable() - LinksTable.Add(FrameUrl, FrameLinksHash) - - For Each HrefElement As HtmlElement In Frame.Document.Links - FrameLinksHash.Add(HrefElement.GetAttribute("HREF"), "Url") - Next - Next - Else - Dim DocLinksHash As New Hashtable() - LinksTable.Add(.Url.ToString(), DocLinksHash) - - For Each HrefElement As HtmlElement In .Links - DocLinksHash.Add(HrefElement.GetAttribute("HREF"), "Url") - Next - End If - End With - End If - End Sub - ' - - Private Sub ShowModalDialogButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShowModalDialogButton.Click - Me.ShowModalDialog() - End Sub - - ' - Private Sub ShowModalDialog() - If (WebBrowser1.Document IsNot Nothing) Then - Dim Frame As HtmlWindow = WebBrowser1.Document.Window - - Dim DialogArguments As String = "dialogHeight: 250px; dialogWidth: 300px; dialogTop: 300px;" & _ - "dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; resizable: No; status: No;" - - ' Show the dialog. - Dim RawWindow = Frame.DomWindow - RawWindow.showModalDialog("http://www.adatum.com/dialogWindow.htm", Nothing, CObj(DialogArguments)) - End If - End Sub - ' - - - Private Sub OpenNewWindowOverBrowserButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenNewWindowOverBrowserButton.Click - Me.OpenNewWindowOverBrowser() - End Sub - - ' - 'Private Sub TestCookies() - ' If (WebBrowser1.Document IsNot Nothing) Then - ' Dim Capabilities As System.Windows.Forms.HtmlNavigator = WebBrowser1.Document.Window.Navigator - ' If (Not Capabilities.CookieEnabled) Then - ' MessageBox.Show("You have disabled cookies in Internet Explorer. The current " & _ - ' " application will not work properly without them. See your system " & _ - ' "administrator for more details.") - ' End If - ' End If - 'End Sub - ' - - ' - Private Sub OpenNewWindowOverBrowser() - If (WebBrowser1.Document IsNot Nothing) Then - Dim DocWindow As HtmlWindow = WebBrowser1.Document.Window - - Dim NewWindow As HtmlWindow = DocWindow.OpenNew(New Uri("http://www.adatum.com/popup.htm"), "left=" & DocWindow.Position.X & ",top=" & DocWindow.Position.Y & ",width=" & WebBrowser1.Width & ",height=" & WebBrowser1.Height) - End If - End Sub - ' - - - Private Sub SetWindowStatusButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetWindowStatusButton.Click - Me.SetWindowStatus() - End Sub - - ' - Dim WithEvents PopWindow As HtmlWindow - - Private Sub SetWindowStatus() - If (WebBrowser1.Document IsNot Nothing) Then - Dim DocWindow As HtmlWindow = WebBrowser1.Document.Window - PopWindow = DocWindow.OpenNew(New Uri("file://C:\\testStatusBarText.htm"), "") - End If - End Sub - - Private Sub PopWindow_Load(ByVal sender As Object, ByVal e As HtmlElementEventArgs) Handles PopWindow.Load - MessageBox.Show("Loaded!") - End Sub - ' - - Private Sub ResetFramesButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResetFramesButton.Click - Me.ResetFrames() - End Sub - - ' - Private Sub ResetFrames() - If (WebBrowser1.Document IsNot Nothing) Then - Dim FrameElement As HtmlElement - Dim DocWindow As HtmlWindow = WebBrowser1.Document.Window - - For Each FrameWindow As HtmlWindow In DocWindow.Frames - FrameElement = FrameWindow.WindowFrameElement - Dim OriginalUrl As String = FrameElement.GetAttribute("SRC") - - If (Not OriginalUrl.Equals(FrameWindow.Url.ToString())) Then - FrameWindow.Navigate(New Uri(OriginalUrl)) - End If - Next - End If - End Sub - ' - - - ' - Dim BalanceWindow As HtmlWindow - - Private Sub BalanceWindowButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BalanceWindowButton.Click - If (WebBrowser1.Document IsNot Nothing) Then - With WebBrowser1.Document - BalanceWindow = .Window.OpenNew(New Uri("http://www.adatum.com/viewBalances.aspx"), "dialogHeight: 250px; dialogWidth: 300px; " & _ - " dialogTop: 300px; dialogLeft: 300px; edge: Sunken; center: Yes; help: Yes; " & _ - "resizable: No; status: No;") - - ' Listen for activity on the document. - - - WindowTimeout.Interval = 300000 - WindowTimeout.Start() - End With - End If - End Sub - - Private Sub Document_Click(ByVal sender As Object, ByVal e As System.EventArgs) - WindowTimeout.Stop() - WindowTimeout.Start() - End Sub - - Private Sub WindowTimeout_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WindowTimeout.Tick - If (Not BalanceWindow.IsClosed) Then - BalanceWindow.Close() - WindowTimeout.Stop() - End If - End Sub - ' - - ' - Dim OrderWindow As HtmlWindow - Dim FormElement As HtmlElement - - Private Sub NewOrderButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewOrderButton.Click - LoadOrderForm() - End Sub - - Private Sub LoadOrderForm() - If (WebBrowser1.Document IsNot Nothing) Then - With WebBrowser1.Document - OrderWindow = .Window.OpenNew(New Uri("file://C:\\orderForm.htm"), "") - - ' !TODO: Perform this in the load event handler! - ' Get order form. - Dim ElemCollection As System.Windows.Forms.HtmlElementCollection = .All.GetElementsByName("NewOrderForm") - If (ElemCollection.Count = 1) Then - FormElement = ElemCollection(0) - ' TODO: Resolve this. - 'FormElement.AttachEventHandler("onsubmit", New HtmlElementEventHandler(AddressOf Form_Submit)) - End If - End With - - End If - End Sub - - Private Sub Form_Submit(ByVal sender As Object, ByVal e As HtmlElementEventArgs) - Dim DoOrder As Boolean = OrderWindow.Confirm("Once you transmit this order, you cannot cancel it. Submit?") - If (Not DoOrder) Then - ' Cancel the submit. - e.ReturnValue = False - OrderWindow.Alert("Submit cancelled.") - End If - End Sub - ' - - - Private Sub OpenThreeWindowsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenThreeWindowsButton.Click - ' Me.OpenThreeWindows() - End Sub - - ' NOTE: HtmlScreen will be ripped from build soon. - 'Private Sub OpenThreeWindows() - ' If (WebBrowser1.Document IsNot Nothing) Then - ' With WebBrowser1.Document - ' Dim WindowWidth As Integer = (ScreenObj.AvailableArea.Width / 3) - 10 - - ' ' Open first window. - ' Dim FirstWindow As HtmlWindow = .Window.OpenNew("http://www.microsoft.com/", "width=" & WindowWidth & ",height=200px,top=0,left=0") - ' .Window.OpenNew("http://www.microsoft.com/", "width=" & WindowWidth & ",height=200px,top=0,left=" & WindowWidth + 10) - ' .Window.OpenNew("http://www.microsoft.com/", "width=" & WindowWidth & ",height=200px,top=0,left=" & ((WindowWidth * 2) + 20)) - ' End With - ' End If - 'End Sub - - Private Sub WindowOpenOnExeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WindowOpenOnExeButton.Click - If (WebBrowser1.Document IsNot Nothing) Then - With WebBrowser1.Document - .Window.Open(New Uri("http://kamikaze/printTest.exe"), "_blank", "", False) - End With - End If - End Sub - - Private Sub DisplayWindow1Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisplayWindow1Button.Click - DisplayFirstUrl() - End Sub - - Private Sub DisplayWindow2Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DisplayWindow2Button.Click - DisplaySecondUrl() - End Sub - - ' - Private Sub DisplayFirstUrl() - If (WebBrowser1.Document IsNot Nothing) Then - With WebBrowser1.Document - ' If this is called first, the window will only have a status bar. - .Window.Open(New Uri("http://www.microsoft.com/"), "displayWindow", "status=yes,width=200,height=400", False) - End With - End If - End Sub - - Private Sub DisplaySecondUrl() - If (WebBrowser1.Document IsNot Nothing) Then - With WebBrowser1.Document - ' If this is called first, the window will only have an Address bar. - .Window.Open(New Uri("http://msdn.microsoft.com/"), "displayWindow", "width=400,height=200,location=yes", False) - End With - End If - End Sub - ' - - - Private Sub EnableClickScrollButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnableClickScrollButton.Click - Me.EnableClickScroll() - End Sub - - - ' - Dim WithEvents Doc As HtmlDocument - - Private Sub EnableClickScroll() - If (WebBrowser1.Document IsNot Nothing) Then - Doc = WebBrowser1.Document - End If - End Sub - - Private Sub TopWindow_Click(ByVal sender As Object, ByVal e As HtmlElementEventArgs) Handles Doc.Click - Dim DocWindow As HtmlWindow = WebBrowser1.Document.Window - DocWindow.ScrollTo(e.MousePosition.X, e.MousePosition.Y) - End Sub - ' - - - - ' - Dim ResizableWindow As HtmlWindow - - Private Sub ResizeWindow() - If (WebBrowser1.Document IsNot Nothing) Then - ResizableWindow = WebBrowser1.Document.Window.OpenNew(New Uri("http://www.microsoft.com/"), "") - ResizableWindow.ResizeTo(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height) - End If - End Sub - ' - - Private Sub ResizeWindowButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResizeWindowButton.Click - Me.ResizeWindow() - End Sub - - - Private Sub SuppressScriptErrorsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SuppressScriptErrorsButton.Click - Me.SuppressScriptErrors() - End Sub - - ' - Dim WithEvents ScriptWindow As HtmlWindow - - Private Sub SuppressScriptErrors() - If (WebBrowser1.Document IsNot Nothing) Then - ScriptWindow = WebBrowser1.Document.Window - End If - End Sub - - Private Sub ScriptWindow_Error(ByVal sender As Object, ByVal e As HtmlElementErrorEventArgs) Handles ScriptWindow.Error - MessageBox.Show("Suppressed error!") - e.Handled = True - End Sub - ' - - - Private Sub OpenRestrictedWindowButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenRestrictedWindowButton.Click - ' Me.OpenRestrictedWindow() - End Sub - - ' - 'Dim WithEvents RestrictedWindow As HtmlWindow - - 'Private Sub OpenRestrictedWindow() - ' If (WebBrowser1.Document IsNot Nothing) Then - ' RestrictedWindow = WebBrowser1.Document.Window.OpenNew("http://www.adatum.com/", "width=300,height=300,resizable=yes") - ' End If - 'End Sub - - 'Private Sub RestrictedWindow_ResizeStart(ByVal sender As Object, ByVal e As HtmlElementEventArgs) Handles RestrictedWindow.ResizeStart - ' e.ReturnValue = True - 'End Sub - ' -End Class diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProject.vbproj b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProject.vbproj deleted file mode 100644 index 0b25e60e109..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/HtmlWindowProject.vbproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - Exe - net9.0-windows - true - - - diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyEvents.vb b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyEvents.vb deleted file mode 100644 index b6dfb0a6eb5..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyEvents.vb +++ /dev/null @@ -1,15 +0,0 @@ -Namespace My - - 'Use the editor window dropdowns in the Application pane of the Project Designer to handle MyApplication Events - ' - 'Startup: Raised when the application starts, before the startup form is created. - 'Shutdown: Raised after all application forms are closed. This event is not raised if the application is terminating abnormally. - 'UnhandledException: Raised if the application encounters an unhandled exception. - 'StartupNextInstance: Raised when launching a single-instance application and the application is already active. - 'NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. - - Partial Friend Class MyApplication - - End Class - -End Namespace diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.resx b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.resx deleted file mode 100644 index 3e18af958a2..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.vb b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.vb deleted file mode 100644 index 8fe17ca352d..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MyResources.vb +++ /dev/null @@ -1,61 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict Off -Option Explicit On - -Imports System.IO -Imports System.Resources - -Namespace My.Resources - - ' - ' A strongly-typed resource class, for looking up localized strings, etc. - ' - 'This class was auto-generated by the Strongly Typed Resource Builder - 'class via a tool like ResGen or Visual Studio.NET. - 'To add or remove a member, edit your .ResX file then rerun ResGen - 'with the /str option, or rebuild your VS project. - _ - Module MyResources - - Private _resMgr As System.Resources.ResourceManager - - Private _resCulture As System.Globalization.CultureInfo - - ' - ' Returns the cached ResourceManager instance used by this class. - ' - _ - Public ReadOnly Property ResourceManager() As System.Resources.ResourceManager - Get - If (_resMgr Is Nothing) Then - Dim temp As System.Resources.ResourceManager = New System.Resources.ResourceManager("HtmlWindowProject.MyResources", GetType(MyResources).Assembly) - System.Threading.Thread.MemoryBarrier - _resMgr = temp - End If - Return _resMgr - End Get - End Property - - ' - ' Overrides the current thread's CurrentUICulture property for all - ' resource lookups using this strongly typed resource class. - ' - _ - Public Property Culture() As System.Globalization.CultureInfo - Get - Return _resCulture - End Get - Set - _resCulture = value - End Set - End Property - End Module -End Namespace diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.settings b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.settings deleted file mode 100644 index 0bcb11da337..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.vb b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.vb deleted file mode 100644 index 3d12c6fb5fa..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/My Project/MySettings.vb +++ /dev/null @@ -1,38 +0,0 @@ -'------------------------------------------------------------------------------ -' -' This code was generated by a tool. -' -' Changes to this file may cause incorrect behavior and will be lost if -' the code is regenerated. -' -'------------------------------------------------------------------------------ - -Option Strict Off -Option Explicit On - - - -Partial Friend NotInheritable Class MySettings - Inherits System.Configuration.ApplicationSettingsBase - - Private Shared m_Value As MySettings - - Private Shared m_SyncObject As Object = New Object - - _ - Public Shared ReadOnly Property Value() As MySettings - Get - If (MySettings.m_Value Is Nothing) Then - System.Threading.Monitor.Enter(MySettings.m_SyncObject) - If (MySettings.m_Value Is Nothing) Then - Try - MySettings.m_Value = New MySettings - Finally - System.Threading.Monitor.Exit(MySettings.m_SyncObject) - End Try - End If - End If - Return MySettings.m_Value - End Get - End Property -End Class diff --git a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config b/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config deleted file mode 100644 index f6369234512..00000000000 --- a/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/app.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/xml/System.IdentityModel.Tokens/SecurityToken.xml b/xml/System.IdentityModel.Tokens/SecurityToken.xml index bb7ac870dd7..57d923c6b74 100644 --- a/xml/System.IdentityModel.Tokens/SecurityToken.xml +++ b/xml/System.IdentityModel.Tokens/SecurityToken.xml @@ -82,14 +82,6 @@ To add functionality to existing token types you can derive from the specific type and its associated token handler to support any new elements that you add to the token. To add support for new token types, you can derive directly from the class. When you do this, you will also need to create a token handler class by deriving from the class. Depending on how your token is to be used, you may also need to create a custom token resolver by deriving from the class as well as one or more custom key identifier clause types by deriving from the class. - - -## Examples - The code examples that are used in the topics are taken from the `Custom Token` sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). It includes an implementation of a `SimpleWebToken` class and a `SimpleWebTokenHandler` class, as well as other classes that support SWT tokens. For information about this sample and other samples available for WIF and about where to download them, see [WIF Code Sample Index](/previous-versions/dotnet/framework/windows-identity-foundation/wif-code-sample-index). The following code shows the implementation of the `SimpleWebToken` class. This class extends . - - :::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs" id="Snippet1"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet2"::: - ]]> @@ -256,15 +248,6 @@ ## Remarks Typically, when a security token is serialized into XML, the `Id` attribute for the security token is set to the value of the property. - - -## Examples - The code examples that are used in the topics are taken from the `Custom Token` sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). It includes an implementation of a `SimpleWebToken` class and a `SimpleWebTokenHandler` class, as well as other classes that support SWT tokens. For information about this sample and other samples available for WIF and about where to download them, see [WIF Code Sample Index](/previous-versions/dotnet/framework/windows-identity-foundation/wif-code-sample-index). The following code shows the override of the property. - - :::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs" id="Snippet1"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet3"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet4"::: - ]]> @@ -394,15 +377,6 @@ ## Remarks Use the property to set the cryptographic keys for this security token to protect tokens or a SOAP message. The keys can be used, among other things, to digitally sign or encrypt either tokens or SOAP messages. - - -## Examples - The code examples that are used in the topics are taken from the `Custom Token` sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). It includes an implementation of a `SimpleWebToken` class and a `SimpleWebTokenHandler` class, as well as other classes that support SWT tokens. For information about this sample and other samples available for WIF and about where to download them, see [WIF Code Sample Index](/previous-versions/dotnet/framework/windows-identity-foundation/wif-code-sample-index). The following code shows the override of the property. - - :::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs" id="Snippet1"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet3"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet5"::: - ]]> @@ -443,16 +417,6 @@ ## Remarks Use the and properties to determine the time period in which a token is valid. The and properties represent the first and last instants in time in which the security token is valid, respectively. - - -## Examples - The code examples that are used in the topics are taken from the `Custom Token` sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). It includes an implementation of a `SimpleWebToken` class and a `SimpleWebTokenHandler` class, as well as other classes that support SWT tokens. For information about this sample and other samples available for WIF and about where to download them, see [WIF Code Sample Index](/previous-versions/dotnet/framework/windows-identity-foundation/wif-code-sample-index). The following code shows the override of the property. - - :::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs" id="Snippet1"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet3"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet6"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet8"::: - ]]> @@ -493,16 +457,6 @@ ## Remarks Use the and properties to determine the time period in which a token is valid. The and properties represent the first and last instants in time in which the security token is valid, respectively. - - -## Examples - The code examples that are used in the topics are taken from the `Custom Token` sample. This sample provides custom classes that enable processing of Simple Web Tokens (SWT). It includes an implementation of a `SimpleWebToken` class and a `SimpleWebTokenHandler` class, as well as other classes that support SWT tokens. For information about this sample and other samples available for WIF and about where to download them, see [WIF Code Sample Index](/previous-versions/dotnet/framework/windows-identity-foundation/wif-code-sample-index). The following code shows the override of the property. - - :::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtokenconstants.cs" id="Snippet1"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet3"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet7"::: -:::code language="csharp" source="~/snippets/csharp/System.IdentityModel.Tokens/SecurityToken/Overview/simplewebtoken.cs" id="Snippet8"::: - ]]> diff --git a/xml/System.Windows.Forms/HtmlElementErrorEventArgs.xml b/xml/System.Windows.Forms/HtmlElementErrorEventArgs.xml index 5586a558648..a47f69e27ed 100644 --- a/xml/System.Windows.Forms/HtmlElementErrorEventArgs.xml +++ b/xml/System.Windows.Forms/HtmlElementErrorEventArgs.xml @@ -29,17 +29,7 @@ Provides data for the event. - - control named `webBrowser1`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet16"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet16"::: - - ]]> - + To be added. @@ -106,22 +96,13 @@ System.Boolean - Gets or sets whether this error has been handled by the application hosting the document. + Gets or sets a value that indicates whether this error has been handled by the application hosting the document. if the event has been handled; otherwise, . The default is . control named `webBrowser1`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet16"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet16"::: +If you want to display your own custom error message to the user or suppress the error entirely, set this property to `true`. ]]> From d5533a13a434bbb74f07d65263110d0ebd1667ff Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 31 Jul 2026 16:11:28 -0700 Subject: [PATCH 2/2] delete refs to deleted snippets --- xml/System.Windows.Forms/HtmlWindow.xml | 128 +----------------- .../HtmlWindowCollection.xml | 8 -- 2 files changed, 1 insertion(+), 135 deletions(-) diff --git a/xml/System.Windows.Forms/HtmlWindow.xml b/xml/System.Windows.Forms/HtmlWindow.xml index ea214117569..9510502f477 100644 --- a/xml/System.Windows.Forms/HtmlWindow.xml +++ b/xml/System.Windows.Forms/HtmlWindow.xml @@ -41,14 +41,6 @@ You can use to open new windows containing new documents. loads the specified URL into the named window, creating it if it does not already exist, while always opens its URL in a newly created window. - - -## Examples - The following code example contains two methods. The first opens a URL in a window named `displayWindow`, which it creates with a status bar displayed. The second opens another URL in the same window, but specifies that only the location bar should be displayed. Notice that the dimensions of the window and the controls that are displayed depends on which URL is opened first. The code example requires that your form contains a control named `WebBrowser1`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet13"::: - ]]> @@ -166,12 +158,6 @@ When you create new windows using or , causes the HTML Document Object Model to open a new instance of Internet Explorer. If you don't call on all of the windows you have created, this instance of Internet Explorer will remain running even after your application closes. -## Examples - The following code example opens a window, and closes it if the user has not used it in the past five minutes. The code example was written under the assumption that your form has a control named `WebBrowser1`, a named `Button1`, and a class named `Timer1`. To run this example successfully, change the first argument supplied to to a valid URL. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet9"::: - ]]> close Method @@ -213,35 +199,6 @@ ## Remarks displays a modal dialog box; the user will not be able to access the underlying HTML page without first closing this dialog box. -## Examples - -Copy the following HTML and save it into a form called orderForm.htm: - -```html - - -
-Select Part Type: -
-Quantity:
-Building/Desk: - / -

- -

- - -``` - -The following example displays a dialog box when the user submits `NewOrderForm`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet10"::: - ]]> confirm Method @@ -313,14 +270,6 @@ The following example displays a ## Remarks Typically, you will access the through the property of the control. Use this property when you need to access a document within a `FRAME` using the collection. - - -## Examples - The following code example inspects each document within a page containing frames and creates a table of all of the outgoing hyperlinks from each page for future inspection. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet2"::: - ]]> @@ -364,14 +313,6 @@ The following example displays a You must add a referenced to the unmanaged MSHTML.dll in order to use . For more information, see [Importing a Type Library as an Assembly](/dotnet/framework/interop/importing-a-type-library-as-an-assembly). - - -## Examples - The following code example obtains an `IHTMLWindow2` pointer from a document's window and displays a new document in a modal window. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet3"::: - ]]> IHTMLWindow2 Interface @@ -446,12 +387,6 @@ The following example displays a You can set the property of to `true` in order to prevent the native error dialog box in Internet Explorer from displaying. -## Examples - The following code example traps the error that results when a script on an HTML page attempts to access an object that is not defined in the document. The page must be fully loaded before the event handler is attached, otherwise the example will not work. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet16"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet16"::: - ]]> onerror Event @@ -529,14 +464,6 @@ The following example displays a Frames will contain one instance of for each `FRAME` or `IFRAME` defined within a Web page. - - -## Examples - The following code example inspects each document within a page containing frames and creates a table of all of the outgoing hyperlinks from each page for future inspection. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet2"::: - ]]> frames Collection @@ -693,14 +620,6 @@ The following example displays a ## Remarks If the has been closed by the user or by way of a call to the method, attempting to navigate to a new URL or access the window's document will result in an error. Use this property to determine whether it is safe to call properties and methods on the current window object. - - -## Examples - The following code example opens a window, and closes it if the user has not used it in the past five minutes. The code example requires that your form has a control named `WebBrowser1`, a named `Button1`, and a class named `Timer1`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet8"::: - ]]> closed Property @@ -1276,17 +1195,6 @@ The following example displays a If you use to load a URL in an existing window, `windowOptions` will be ignored; the window will retain the dimensions, appearance, and screen location first given it by the initial call to . -## Examples - The following code example contains two methods: - -- The first opens a URL in a window named `displayWindow`, which it creates with a status bar displayed. -- The second opens another URL in the same window, but specifies that only the location bar should be displayed. - - Notice that the dimensions of the window and the controls that are displayed depends on which URL is opened first. The code example requires that your form contains a control named `WebBrowser1`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet13"::: - ]]> open Method @@ -1499,14 +1407,6 @@ The following example displays a ## Remarks The property of the control will return the position of the control relative to the upper-left corner of the form. By contrast, will return the location of the document's display area relative to the top-left corner of the user's monitor. - - -## Examples - The following code example opens a new window directly over the control on the form. The code example requires that your form contains an instance of the control named `WebBrowser1`. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet5"::: - ]]> Windows Forms Coordinates @@ -1673,17 +1573,7 @@ The following example displays a A describing the desired width and height of the window, in pixels. Must be 100 pixels or more in both dimensions. Changes the size of the window to the specified dimensions. - - - + To be added. The window you are trying to resize is in a different domain than its parent window. This restriction is part of cross-frame scripting security. resizeTo Method @@ -1802,14 +1692,6 @@ The following example displays a ## Remarks will cause the document to scroll so that the specified coordinate on the document is located in the upper-left corner of the document's window. If the document is not long or wide enough for this to happen, will scroll through the document as far as possible in the specified direction. - - -## Examples - The following code example scrolls through the document to the coordinate position clicked by the user. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet15"::: - ]]> scrollTo Method @@ -2034,14 +1916,6 @@ The following example displays a ## Remarks When you retrieve a `FRAME` element from the collection, it returns an . Call on this object if you need to access attributes of the underlying `FRAME` element, such as the `SRC` attribute. - - -## Examples - The following code example compares the `SRC` attribute of frames in a `FRAMESET` to the current location. If they are different, the frames are reset to their original URLs. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet8"::: - ]]> frameElement Property diff --git a/xml/System.Windows.Forms/HtmlWindowCollection.xml b/xml/System.Windows.Forms/HtmlWindowCollection.xml index bfd56359a80..ff610050c6c 100644 --- a/xml/System.Windows.Forms/HtmlWindowCollection.xml +++ b/xml/System.Windows.Forms/HtmlWindowCollection.xml @@ -48,14 +48,6 @@ For more information on frames, see the documentation for the property. - - -## Examples - The following code example inspects each document within a page containing frames and creates a table of all of the outgoing hyperlinks from each page for future inspection. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/System.Windows.Forms/HtmlElementErrorEventArgs/Overview/Form1.vb" id="Snippet2"::: - ]]>