本文整理汇总了C#中IControl.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IControl.GetType方法的具体用法?C# IControl.GetType怎么用?C# IControl.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IControl
的用法示例。
在下文中一共展示了IControl.GetType方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apply
/// <summary>
/// Applies the corresponding styles to a recently created control
/// <para xml:lang="es">
/// Aplica los estilos correspondientes a un control creado recientemente.
/// </para>
/// </summary>
public static void Apply(IControl e)
{
string selector = "." + e.GetType().Name;
//select the correct styles using the selector, and apply
foreach (ICssStyleDeclaration style in ParsedStyleRules.Where(s => s.SelectorText == selector))
{
Apply(style, e);
}
}
示例2: OnValueChanged
private void OnValueChanged(IControl next)
{
if (next == null || _ancestorType.IsAssignableFrom(next.GetType().GetTypeInfo()))
_subject.OnNext(next);
else
{
_child?.Dispose();
_child = new FinderNode(next, _ancestorType);
_child.Observable.Subscribe(OnChildValueChanged);
_child.Init();
}
}
示例3: GetKey
private String GetKey (IControl<UIView> control)
{
String s = "";
if (control.Parent != null)
s = GetKey ((IControl<UIView>)control.Parent);
String cssClass = null;
if (control is IStyledObject) {
cssClass = control.CssClass;
if (!String.IsNullOrEmpty (cssClass))
cssClass = cssClass.ToLower ();
}
if (!String.IsNullOrEmpty (s))
s = s + " ";
if (!String.IsNullOrEmpty (cssClass)) {
s = s + String.Format ("({0}|{1})", control.GetType ().Name.ToLower (), cssClass);
} else
s = s + control.GetType ().Name.ToLower ();
return s;
}
示例4: AddControl
public bool AddControl(IControl control)
{
if (_controlLayers.Count > 0)
_controlLayers.First.Value.IsActive = false;
if (!_controlLayers.TryAddFirst(control)) {
Console.Error.WriteLine("Failed to acquire control lock. {0} control not added.", control.GetType().Name);
return false;
}
if (_isLoaded)
control.LoadContent(this);
control.IsActive = true;
control.OnClosed += _closedControlHandler;
_alignControl(control);
return true;
}
示例5: CanCreate
public bool CanCreate( IControl control )
{
return control != null && control.GetType() == typeof( CarsRemoverBuildMode );
}
示例6: GetAction
private IEnumerable<BuilderAction> GetAction( IControl control )
{
var builder = this._builders.FirstOrDefault( b => b.CanCreate( control ) );
if ( builder == null ) throw new ArgumentException( "Controls not supported: " + control.GetType().Name );
return builder.Create( control );
}
示例7: CanCreate
public bool CanCreate( IControl control )
{
return control != null && control.GetType() == typeof( BuildJunctionEdge );
}
示例8: RemoveControl
public virtual bool RemoveControl(IControl control)
{
if (control.Parent != this) {
Console.Error.WriteLine("Tried to remove control [{0}] that is not a child of parent [{1}].", control.GetType().Name, this.GetType().Name);
return false;
}
if (!_lockControlList())
throw new SynchronizationLockException("Could not acquire control lock, control not removed.");
try {
_controls.Remove(control);
} finally {
_unlockControlList(true);
}
control.SetParent(null);
control.OnResized -= this._handleResizeEvent;
control.OnClosed -= this._handleClosedEvent;
return true;
}
示例9: CanCreate
public bool CanCreate( IControl control )
{
return control != null && control.GetType() == typeof( RoadLaneBlock );
}
示例10: CanCreate
public bool CanCreate( IControl control )
{
return control != null && control.GetType() == typeof( RoadConnection );
}
示例11: CreateControlDocumentFragment
public ControlDocumentFragment CreateControlDocumentFragment(IContainer container, IControl control) {
control.Id = Guid.NewGuid().ToString().Replace("-", "");
container.ApplyToScriptManager(this);
return new ControlDocumentFragment(GetAllRequiredIncludes().ToArray(), ConfigObject, control.GetType().FullName, control.Html, control.ConfigObject);
}