本文整理汇总了C#中ILabel类的典型用法代码示例。如果您正苦于以下问题:C# ILabel类的具体用法?C# ILabel怎么用?C# ILabel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILabel类属于命名空间,在下文中一共展示了ILabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
/// <summary>
/// Start this instance.
/// <para xml:lang="es">
/// Inicia la instancia del objeto Calendar.
/// </para>
/// </summary>
public override void Start()
{
base.Start();
// Create an Stack
IStack stack = Platform.Current.Create<IStack>();
// Creates an Label with text and a specific size and adds it to the stack.
lblLabel = Platform.Current.Create<ILabel>();
lblLabel.Text = "Select 1 day";
lblLabel.Height = 30;
stack.Children.Add(lblLabel);
// Creates an Calendar with text specific and adds it to the stack.
calendar = Platform.Current.Create<ICalendar>();
calendar.Name = "calendar";
calendar.Bold = true;
stack.Children.Add(calendar);
// Creates the Button cmdChange with text specific, with the event also click and adds it to the stack.
IButton cmdChange = Platform.Current.Create<IButton>();
cmdChange.Text = "Change";
cmdChange.Click += CmdChange_Click;
stack.Children.Add(cmdChange);
// Creates the Button cmdClose with text specific, with the event also click and adds it to the stack.
IButton cmdClose = Platform.Current.Create<IButton>();
cmdClose.Text = "Close";
cmdClose.Click += CmdClose_Click;
stack.Children.Add(cmdClose);
// Establishes the content and title of the page
Platform.Current.Page.Title = "Test label";
Platform.Current.Page.Content = stack;
}
示例2: Start
public override void Start()
{
base.Start();
IStack stack = Platform.Current.Create<IStack>();
cmdShow = Platform.Current.Create<IButton>();
cmdShow.Text = "Show/Hide";
cmdShow.Click += CmdShow_Click;
cmdShow.BackgroundColor = new Color(1, 255, 0, 0);
cmdShow.FontColor = new Color(1, 255, 255, 255);
stack.Children.Add(cmdShow);
lbltext = Platform.Current.Create<ILabel>();
lbltext.Text = "I'm visible, i want an ice-cream";
lbltext.Visible = false;
stack.Children.Add(lbltext);
IButton cmdClose = Platform.Current.Create<IButton>();
cmdClose.Text = "Close";
cmdClose.Click += CmdClose_Click;
stack.Children.Add(cmdClose);
Platform.Current.Page.Title = "Test label";
Platform.Current.Page.Content = stack;
}
示例3: Start
/// <summary>
/// Start this instance.
/// <para xml:lang="es">
/// Inicia la instancia del objeto CheckBox.
/// </para>
/// </summary>
public override void Start()
{
base.Start();
// Create a Stack
IStack stack = Platform.Current.Create<IStack>();
// Creates an Label with text and a specific size and adds it to the stack.
lblLabel = Platform.Current.Create<ILabel>();
lblLabel.Text = "Click on the checkbox";
lblLabel.Height = 30;
stack.Children.Add(lblLabel);
// Creates an CheckBox selected with the event also click and adds it to the stack.
checkBox = Platform.Current.Create<ICheckBox>();
checkBox.Value = true;
checkBox.ValueChanged += checkBox_ValueChanged;
stack.Children.Add(checkBox);
// Creates the Button cmdClose with text specific, with the event also click and adds it to the stack.
IButton cmdClose = Platform.Current.Create<IButton>();
cmdClose.Text = "Close";
cmdClose.Click += CmdClose_Click;
stack.Children.Add(cmdClose);
// Establishes the content and title of the page
Platform.Current.Page.Title = "Test checkbox";
Platform.Current.Page.Content = stack;
}
示例4: UnnamedConcreteDependency
public UnnamedConcreteDependency(ILabel regent, int regentIndex, ILabel dependent, int dependentIndex) :
base(regent, dependent)
{
headIndex = regentIndex;
depIndex = dependentIndex;
}
示例5: Learn
/// <summary>
/// Learns from the given example.
/// </summary>
/// <param name="example">The example to learn.</param>
/// <param name="label">The optional label for this <paramref name="example"/>.</param>
/// <param name="index">The optional index of the example, the <paramref name="label"/> should be attributed to.</param>
public void Learn(object example, ILabel label = null, int? index = null)
{
using (var ex = GetOrCreateSerializer(example.GetType()).Serialize(example, label, index))
{
ex.Learn();
}
}
示例6: TaggedWord
/// <summary>
/// Create a new <code>TaggedWord</code>.
/// </summary>
/// <param name="oldLabel">
/// A Label. If it implements the HasWord and/or HasTag interface, then the corresponding value will be set
/// </param>
public TaggedWord(ILabel oldLabel) : base(oldLabel.Value())
{
if (oldLabel is IHasTag)
{
this.vTag = ((IHasTag) oldLabel).Tag();
}
}
示例7: Parse
/// <summary>
/// Parses the example.
/// </summary>
/// <param name="json">The example to parse.</param>
/// <param name="label">
/// Optional label, taking precedence over "_label" property found in <paramref name="json"/>.
/// If null, <paramref name="json"/> will be inspected and the "_label" property used as label.
/// </param>
/// <returns>The VowpalWabbit native example.</returns>
public VowpalWabbitExample Parse(string json, ILabel label = null)
{
using (var textReader = new JsonTextReader(new StringReader(json)))
{
return this.Parse(textReader, label);
}
}
示例8: Learn
/// <summary>
/// Learns from the given example.
/// </summary>
/// <param name="example">The example to learn.</param>
/// <param name="label">The label for this <paramref name="example"/>.</param>
public void Learn(object example, ILabel label)
{
using (var ex = GetOrCreateSerializer(example.GetType()).Serialize(example, label))
{
this.vw.Learn(ex);
}
}
示例9: Validate
public void Validate(string line, string json, IVowpalWabbitLabelComparator labelComparator = null, ILabel label = null)
{
using (var jsonSerializer = new VowpalWabbitJsonSerializer(this.vw))
using (var jsonExample = jsonSerializer.ParseAndCreate(json, label))
{
this.Validate(line, jsonExample, labelComparator, label);
}
}
示例10: HotspotLabel
public HotspotLabel(IGame game, ILabel label)
{
_label = label;
_events = game.Events;
_input = game.Input;
_state = game.State;
_game = game;
}
示例11: LabelState
public LabelState(ILabel label)
{
Point = label.Point; Position = label.Position; Size = label.Size;
IsVisible = label.IsVisible; IsMovable = label.IsMovable; PlotCenter = label.PlotCenter;
if (label is LabelState)
Energy = ((LabelState)label).Energy;
}
示例12: Intersect
internal static bool Intersect(ILabel label1, ILabel label2)
{
var rect1 = label1.RectFromLabel();
var rect2 = label2.RectFromLabel();
rect1.Intersect(rect2);
return (!rect1.IsEmpty);
}
示例13: LabelViewModel
public LabelViewModel(ILabel model, MainViewModel main)
: base(main)
{
if (model == null)
throw new ArgumentNullException("model");
this.model = model;
main.RegisterViewModel(model, this);
LoadViewModels();
}
示例14: StringLabel
/// <summary>
/// Create a new <code>StringLabel</code> with the
/// <code>value()</code> of another label as its label.
/// </summary>
/// <param name="label">The other label</param>
public StringLabel(ILabel label)
{
this.str = label.Value();
if (label is IHasOffset)
{
var ofs = (IHasOffset) label;
SetBeginPosition(ofs.BeginPosition());
SetEndPosition(ofs.EndPosition());
}
}
示例15: MainTitleIconControlWin
/// <summary>
/// Constructs a <see cref="MainTitleIconControlWin"/>
/// </summary>
public MainTitleIconControlWin(IControlFactory controlFactory)
{
if (controlFactory == null) throw new ArgumentNullException("controlFactory");
_controlFactory = controlFactory;
_panel = _controlFactory.CreatePanel();
((PanelWin)_panel).BackgroundImage = CollapsiblePanelResource.headergradient;
_panel.BackColor = Color.Transparent;
_panel.Dock = Habanero.Faces.Base.DockStyle.Top;
_panel.Height = 23;
_icon = _controlFactory.CreateLabel();
((LabelWin)_icon).BackgroundImage = CollapsiblePanelResource.headergradient;
_icon.BackColor = Color.Transparent;
((LabelWin)_icon).BackgroundImageLayout = ImageLayout.Center;
_icon.Dock = Habanero.Faces.Base.DockStyle.Left;
_icon.Size = new Size(20, 20);
_title = _controlFactory.CreateLabel();
_title.Dock = Habanero.Faces.Base.DockStyle.Fill;
_title.BackColor = Color.Transparent;
_title.TextAlign = ContentAlignment.MiddleLeft;
_title.ForeColor = Color.White;
_panel.Controls.Add(_title);
_panel.Controls.Add(_icon);
_panel.MaximumSize = new Size(2000, 23);
this.Dock = DockStyleWin.GetDockStyle(DockStyle.Top);
this.Controls.Add((PanelWin)_panel);
this.Height = 23;
}