зеркало из https://github.com/xamarin/mac-samples.git
[CustomFont] Update metadata + fix static analyzer issues
This commit is contained in:
Родитель
5dcfea1b82
Коммит
5e9aedcfc6
|
@ -1,21 +1,13 @@
|
|||
using System;
|
||||
|
||||
using Foundation;
|
||||
using AppKit;
|
||||
using AppKit;
|
||||
using CoreGraphics;
|
||||
using Foundation;
|
||||
|
||||
namespace TestFont
|
||||
{
|
||||
public partial class AppDelegate : NSApplicationDelegate
|
||||
{
|
||||
#region Private Variables
|
||||
private MainWindowController mainWindowController;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public AppDelegate ()
|
||||
{
|
||||
}
|
||||
MainWindowController mainWindowController;
|
||||
#endregion
|
||||
|
||||
#region Override Methods
|
||||
|
@ -26,12 +18,13 @@ namespace TestFont
|
|||
mainWindowController.Window.MakeKeyAndOrderFront (this);
|
||||
|
||||
// Create a text field with the custom font and add it to the main window
|
||||
var lab1 = new NSTextField(new CGRect(0,0, 300, 100));
|
||||
lab1.StringValue = "This is some sample text";
|
||||
lab1.Editable = false;
|
||||
lab1.Font = NSFont.FromFontName ("SF Hollywood Hills", 20f);
|
||||
mainWindowController.Window.ContentView.AddSubview (lab1);
|
||||
var lab1 = new NSTextField (new CGRect (0.0, 0.0, 300.0, 100.0)) {
|
||||
StringValue = "This is some sample text",
|
||||
Editable = false,
|
||||
Font = NSFont.FromFontName ("SF Hollywood Hills", 20f)
|
||||
};
|
||||
|
||||
mainWindowController.Window.ContentView.AddSubview (lab1);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -15,10 +15,5 @@ namespace TestFont
|
|||
public MainWindow (NSCoder coder) : base (coder)
|
||||
{
|
||||
}
|
||||
|
||||
public override void AwakeFromNib ()
|
||||
{
|
||||
base.AwakeFromNib ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,12 @@ namespace TestFont
|
|||
{
|
||||
public partial class MainWindowController : NSWindowController
|
||||
{
|
||||
public new MainWindow Window {
|
||||
get {
|
||||
return (MainWindow)base.Window;
|
||||
}
|
||||
}
|
||||
|
||||
public MainWindowController (IntPtr handle) : base (handle)
|
||||
{
|
||||
}
|
||||
|
@ -19,14 +25,5 @@ namespace TestFont
|
|||
public MainWindowController () : base ("MainWindow")
|
||||
{
|
||||
}
|
||||
|
||||
public override void AwakeFromNib ()
|
||||
{
|
||||
base.AwakeFromNib ();
|
||||
}
|
||||
|
||||
public new MainWindow Window {
|
||||
get { return (MainWindow)base.Window; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SampleMetadata>
|
||||
<ID>0063f646-f6c7-42fa-bceb-c95eb36b67b6</ID>
|
||||
<IsFullApplication>true</IsFullApplication>
|
||||
<IsFullApplication>false</IsFullApplication>
|
||||
<Level>Beginning</Level>
|
||||
<Tags>Getting Started, User Interface</Tags>
|
||||
<SupportedPlatforms>Mac</SupportedPlatforms>
|
||||
<Gallery>true</Gallery>
|
||||
<Brief>Demonstrates how to use Custom Fonts embedded in a Xamarin.Mac application.</Brief>
|
||||
</SampleMetadata>
|
||||
|
|
Загрузка…
Ссылка в новой задаче