本文整理汇总了C#中System.Windows.Forms.Control.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Control.Equals方法的具体用法?C# Control.Equals怎么用?C# Control.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Control
的用法示例。
在下文中一共展示了Control.Equals方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPropertyName
public string GetPropertyName(Control control)
{
foreach(BinderItem item in binders)
{
if (control.Equals(item.Control))
return item.PropertyName;
}
throw new InvalidOperationException("Could not find the Entity Type for this control");
}
示例2: GetEntityType
public Type GetEntityType(Control control)
{
foreach(BinderItem item in binders)
{
if (control.Equals(item.Control))
return item.Clazz;
}
throw new InvalidOperationException("Could not find the Entity Type for this control");
}
示例3: AddAllControlGlyphs
private void AddAllControlGlyphs(Control parent, ArrayList selComps, object primarySelection)
{
foreach (Control control in parent.Controls)
{
this.AddAllControlGlyphs(control, selComps, primarySelection);
}
GlyphSelectionType notSelected = GlyphSelectionType.NotSelected;
if (selComps.Contains(parent))
{
if (parent.Equals(primarySelection))
{
notSelected = GlyphSelectionType.SelectedPrimary;
}
else
{
notSelected = GlyphSelectionType.Selected;
}
}
this.AddControlGlyphs(parent, notSelected);
}
示例4: if
/// <summary>
/// 验证控件绑定非空
/// </summary>
/// <param name="con">控件</param>
bool I_DXErrorProvider.ValidateControl(Control con, Interface_Enum.ValidateEnum ve , string errorText)
{
//判断当前对象控件是否已经存在
var cet = this.l_NEcon.Where(c => con.Equals(c.con)).SingleOrDefault();
if (cet == null)
{
cet = new ConErrText
{
con = con,
ve = ve,
errText = errorText
};
con.Validating += con_Validating;
this.l_NEcon.Add(cet);
}
else
{
if (cet.ve != ve)
cet.ve = ve;
else if (cet.errText != errorText)
cet.errText = errorText;
}
return this.ValidateRun(cet);
}
示例5: CallObjectEquals
public static object CallObjectEquals(Control c, object[] obj)
{
return c.Equals(obj[0]);
}
示例6: CheckControl
private void CheckControl(Control control)
{
foreach (Control control2 in control.Controls)
{
this.CheckControl(control2);
}
if (!((control is TextBoxMaskBox) || control.Equals(this.textBoxMsg)))
{
control.KeyPress += new KeyPressEventHandler(this.control_KeyPress);
}
}
示例7: InsertField
private void InsertField(Control ctrl, Control holder, Type t)
{
bool isChild = !holder.Equals(InfoPane);
if (t == typeof(Label))
{
ctrl.Font = new Font("Segoe UI Light", 15);
ctrl.BackColor = Color.Transparent;
ctrl.Left = holder.Padding.Left;
ctrl.AutoSize = true;
ctrl.MaximumSize = new Size(FieldMaxWidth, 0);
}
else if (t == typeof(MetroCheckBox))
{
ctrl.Left = holder.Padding.Left + 6;
}
else if (t == typeof(MetroTextBox))
{
ctrl.AutoSize = false;
ctrl.Left = holder.Padding.Left + 6;
}
ctrl.Top = isChild ? OffsetYForSlidingPane : FieldsOffsetY;
holder.Controls.Add(ctrl);
if (isChild) OffsetYForSlidingPane += ctrl.Height + FieldsPadding;
else FieldsOffsetY += ctrl.Height + FieldsPadding;
}
示例8: InsertFieldHeader
private void InsertFieldHeader(string name, Control holder)
{
Label lbl = new Label();
lbl.BackColor = Color.Transparent;
lbl.AutoSize = true;
lbl.Font = new Font("Segoe UI Light", 12);
lbl.ForeColor = Color.FromArgb(204, 204, 204);
lbl.Text = name;
lbl.Left = holder.Padding.Left;
if (holder.Equals(InfoPane))
{
lbl.Top = FieldsOffsetY;
holder.Controls.Add(lbl);
FieldsOffsetY += lbl.Height + FieldHeaderPadding;
}
else
{
lbl.Top = OffsetYForSlidingPane;
holder.Controls.Add(lbl);
OffsetYForSlidingPane += lbl.Height + FieldHeaderPadding;
}
}
示例9: TryGetInteractor
/// <summary>
/// Gets the interactor associated with a given control, if there is one.
/// </summary>
/// <param name="control">The control.</param>
/// <param name="interactor">The interactor.</param>
/// <returns>True if an interactor exists.</returns>
public bool TryGetInteractor(Control control, out FormsInteractor interactor)
{
interactor = _interactors
.FirstOrDefault(x => control.Equals(x.Control));
return interactor != null;
}