base.GetObjectData (info, context);
}
-
+
private static string GetMessage(PrinterSettings settings)
{
if (settings.PrinterName == null || settings.PrinterName == String.Empty)
using System.IO;
using System.Drawing.Imaging;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.ComponentModel;
if (resource == null)
throw new ArgumentException ("resource");
- Stream s = type.Assembly.GetManifestResourceStream (type, resource);
+ // For compatibility with the .NET Framework
+ if (type == null)
+ throw new NullReferenceException();
+
+ Stream s = type.GetTypeInfo ().Assembly.GetManifestResourceStream (type, resource);
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resource);
throw new FileNotFoundException (msg);
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
using System.ComponentModel;
[Browsable(false)]
public bool IsSystemFont {
get {
- if (systemFontName == null)
- return false;
-
- return StringComparer.InvariantCulture.Compare (systemFontName, string.Empty) != 0;
+ return !string.IsNullOrEmpty (systemFontName);
}
}
}
Type st = logFont.GetType ();
- if (!st.IsLayoutSequential)
+ if (!st.GetTypeInfo ().IsLayoutSequential)
throw new ArgumentException ("logFont", Locale.GetText ("Layout must be sequential."));
// note: there is no exception if 'logFont' isn't big enough
using System.ComponentModel;
using System.Drawing.Imaging;
using System.IO;
+using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;
if (resource == null)
throw new ArgumentException ("resource");
- using (Stream s = type.Assembly.GetManifestResourceStream (type, resource)) {
+ // For compatibility with the .NET Framework
+ if (type == null)
+ throw new NullReferenceException();
+
+ using (Stream s = type.GetTypeInfo ().Assembly.GetManifestResourceStream (type, resource)) {
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resource);
throw new FileNotFoundException (msg);
internal Icon (string resourceName, bool undisposable)
{
- using (Stream s = typeof (Icon).Assembly.GetManifestResourceStream (resourceName)) {
+ using (Stream s = typeof (Icon).GetTypeInfo ().Assembly.GetManifestResourceStream (resourceName)) {
if (s == null) {
string msg = Locale.GetText ("Resource '{0}' was not found.", resourceName);
throw new FileNotFoundException (msg);
}
imageData [j] = iidata;
- bihReader.Close();
+ bihReader.Dispose ();
}
- reader.Close();
+ reader.Dispose ();
}
}
}
Status status = GDIPlus.GdipDisposeImage (nativeObject);
// dispose the stream (set under Win32 only if SD owns the stream) and ...
if (stream != null) {
- stream.Close ();
+ stream.Dispose ();
stream = null;
}
// ... set nativeObject to null before (possibly) throwing an exception
/// name of the editor.</para>
/// </devdoc>
public EditorAttribute(string typeName, string baseTypeName) {
- string temp = typeName.ToUpper(CultureInfo.InvariantCulture);
+ string temp = typeName.ToUpperInvariant ();
Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension");
this.typeName = typeName;
this.baseTypeName = baseTypeName;
/// <para>Initializes a new instance of the <see cref='System.ComponentModel.EditorAttribute'/> class.</para>
/// </devdoc>
public EditorAttribute(string typeName, Type baseType) {
- string temp = typeName.ToUpper(CultureInfo.InvariantCulture);
+ string temp = typeName.ToUpperInvariant ();
Debug.Assert(temp.IndexOf(".DLL") == -1, "Came across: " + typeName + " . Please remove the .dll extension");
this.typeName = typeName;
this.baseTypeName = baseType.AssemblyQualifiedName;