本文整理汇总了C#中Target类的典型用法代码示例。如果您正苦于以下问题:C# Target类的具体用法?C# Target怎么用?C# Target使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Target类属于命名空间,在下文中一共展示了Target类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: attr
/// <summary>Assigns all needed attributes to the tag</summary>
/// <returns>This instance downcasted to base class</returns>
public virtual IndexedTag attr(
Shape? shape = null,
Length[] coords = null,
string href = null,
NoHref? nohref = null,
Target target = null,
string alt = null,
string id = null,
string @class = null,
string style = null,
string title = null,
LangCode lang = null,
string xmllang = null,
Dir? dir = null,
string onclick = null,
string ondblclick = null,
string onmousedown = null,
string onmouseup = null,
string onmouseover = null,
string onmousemove = null,
string onmouseout = null,
string onkeypress = null,
string onkeydown = null,
string onkeyup = null,
char? accesskey = null,
int? tabindex = null,
string onfocus = null,
string onblur = null
)
{
Shape = shape;
Coords = coords;
Href = href;
NoHref = nohref;
Target = target;
Alt = alt;
Id = id;
Class = @class;
Style = style;
Title = title;
Lang = lang;
XmlLang = xmllang;
Dir = dir;
OnClick = onclick;
OnDblClick = ondblclick;
OnMouseDown = onmousedown;
OnMouseUp = onmouseup;
OnMouseOver = onmouseover;
OnMouseMove = onmousemove;
OnMouseOut = onmouseout;
OnKeyPress = onkeypress;
OnKeyDown = onkeydown;
OnKeyUp = onkeyup;
AccessKey = accesskey;
TabIndex = tabindex;
OnFocus = onfocus;
OnBlur = onblur;
return this;
}
示例2: GetShowReference
/// <summary>
/// 获取显示确认对话框的客户端脚本
/// </summary>
/// <param name="message">对话框消息</param>
/// <param name="title">对话框标题</param>
/// <param name="icon">对话框图标</param>
/// <param name="okScriptstring">点击确定按钮执行的客户端脚本</param>
/// <param name="cancelScript">点击取消按钮执行的客户端脚本</param>
/// <param name="target">弹出对话框的目标页面</param>
/// <returns>客户端脚本</returns>
public static string GetShowReference(string message, string title, MessageBoxIcon icon, string okScriptstring, string cancelScript, Target target)
{
//string msgBoxScript = "var msgBox=Ext.MessageBox;";
//msgBoxScript += "if(parent!=window){msgBox=parent.window.Ext.MessageBox;}";
if (String.IsNullOrEmpty(title))
{
title = "X.util.confirmTitle";
}
else
{
title = JsHelper.GetJsString(title.Replace("\r\n", "\n").Replace("\n", "<br/>"));
}
message = message.Replace("\r\n", "\n").Replace("\n", "<br/>");
JsObjectBuilder ob = new JsObjectBuilder();
ob.AddProperty("title", title, true);
ob.AddProperty("msg", JsHelper.GetJsStringWithScriptTag(message), true);
ob.AddProperty("buttons", "Ext.MessageBox.OKCANCEL", true);
ob.AddProperty("icon", String.Format("{0}", MessageBoxIconHelper.GetName(icon)), true);
ob.AddProperty("fn", String.Format("function(btn){{if(btn=='cancel'){{{0}}}else{{{1}}}}}", cancelScript, okScriptstring), true);
string targetName = "window";
if (target != Target.Self)
{
targetName = TargetHelper.GetScriptName(target);
}
return String.Format("{0}.Ext.MessageBox.show({1});", targetName, ob.ToString());
}
示例3: BufferingTargetWrapper
/// <summary>
/// Initializes a new instance of the <see cref="BufferingTargetWrapper" /> class.
/// </summary>
/// <param name="wrappedTarget">The wrapped target.</param>
/// <param name="bufferSize">Size of the buffer.</param>
/// <param name="flushTimeout">The flush timeout.</param>
public BufferingTargetWrapper(Target wrappedTarget, int bufferSize, int flushTimeout)
{
this.WrappedTarget = wrappedTarget;
this.BufferSize = bufferSize;
this.FlushTimeout = flushTimeout;
this.SlidingTimeout = true;
}
示例4: OnHit
private void OnHit(HitEffectList effects, Target target, Collider other)
{
if (this.isDead) return;
if (other != null)
Debug.Log(this.name + " was hit by collider on " + other.name);
foreach (HitEffect effect in effects)
{
if (effect.name == "Damage")
{
this.life -= (int)effect.value;
}
}
if (this.life <= 0)
{
this.isDead = true;
Instantiate
(
this.explosion.gameObject,
this.transform.position,
this.transform.rotation
);
this.gameObject.SetActive(false);
}
}
示例5: BufferingTargetWrapper
/// <summary>
/// Initializes a new instance of the <see cref="BufferingTargetWrapper" /> class.
/// </summary>
/// <param name="wrappedTarget">The wrapped target.</param>
/// <param name="bufferSize">Size of the buffer.</param>
/// <param name="flushTimeout">The flush timeout.</param>
public BufferingTargetWrapper(Target wrappedTarget, int bufferSize, int flushTimeout)
{
WrappedTarget = wrappedTarget;
BufferSize = bufferSize;
FlushTimeout = flushTimeout;
SlidingTimeout = true;
}
示例6: PlayerValid
protected bool PlayerValid(Player localPlayer, Player enemy, Target target)
{
if (enemy == null)
return false;
if (enemy.Address == localPlayer.Address)
return false;
if (enemy.Index == localPlayer.Index)
return false;
if (!enemy.IsValid())
return false;
if (target == Target.Allies && enemy.InTeam != localPlayer.InTeam)
return false;
if (target == Target.Enemies && enemy.InTeam == localPlayer.InTeam)
return false;
//if (!Geometry.PointSeesPoint(localPlayer.Vector2, enemy.Vector2, Player.FOV_DEGREE, localPlayer.Yaw))
// return false;
//if (!enemy.IsVisible())
// return false;
CSGOImplementation csgo = (CSGOImplementation)Program.GameImplementation;
//if (!csgo.CurrentMap.IsVisible(localPlayer.Vector3 + Vector3.UnitZ * (enemy.Skeleton.Head.Z - enemy.Skeleton.LeftFoot.Z), enemy.Skeleton.Head))
// return false;
//if(!enemy.IsSpotted)
// return false;
return true;
}
示例7: GetNextTargetPluralExpression
public string GetNextTargetPluralExpression(Target target)
{
var text = string.Empty;
switch (target)
{
case Target.MeasureGroups:
text = "measures";
break;
case Target.Dimensions:
text = "hierarchies";
break;
case Target.Hierarchies:
text = "levels";
break;
case Target.Levels:
text = "properties";
break;
case Target.Tables:
text = "columns";
break;
default:
break;
}
return text;
}
示例8: JoinVoiceMessage
public JoinVoiceMessage(Target target)
{
if (target == null)
throw new ArgumentNullException ("target");
Target = target;
}
示例9: SetNLogTarget
public static void SetNLogTarget(Target target, LogLevel minLevel = null)
{
if (target != null)
{
SimpleConfigurator.ConfigureForTargetLogging(target, minLevel ?? LogLevel.Info);
}
}
示例10: TestCompletionCore
private static void TestCompletionCore( bool expectedIsCompletedSynchronously, Action<AsyncResult> test, Action<AsyncResult> assertion )
{
using ( var waitHandle = new ManualResetEventSlim() )
{
object owner = new object();
var target =
new Target(
owner,
null,
null
);
using ( var task =
Task.Factory.StartNew( () =>
{
test( target );
}
) )
{
target.WaitForCompletion();
Assert.That( target.IsCompleted, Is.True );
Assert.That( target.IsFinished, Is.False );
Assert.That( ( target as IAsyncResult ).CompletedSynchronously, Is.EqualTo( expectedIsCompletedSynchronously ) );
// NOTE: Invocation of AsyncCallback is derived class responsibility.
if ( assertion != null )
{
assertion( target );
}
task.Wait( 10 );
}
}
}
示例11: OnUnitDestroyedHandler
protected override void OnUnitDestroyedHandler(Target obj)
{
PlayerHealth.Instance.RemoveOneHealth();
(SoldierGeneral as PlayerGeneral).ResurrectPlayer();
base.OnUnitDestroyedHandler(obj);
}
示例12: OnHit
protected void OnHit(EventInfoList infoList, Target target)
{
if (this.isDead) return;
foreach (EventInfo info in infoList)
{
switch (info.name)
{
case "Damage":
this.life -= (int)info.value;
break;
}
}
if (this.life <= 0)
{
this.isDead = true;
Instantiate
(
this.explosion.gameObject,
this.transform.position,
this.transform.rotation
);
this.gameObject.SetActive(false);
}
}
示例13: ManualMapGeneralTest
public void ManualMapGeneralTest()
{
ManualMap<Source, Target> map = ManualMap<Source, Target>.New
.AddMap(a => a.Source1, b => b.Target1)
.AddMap(a => a.Source2, b => b.Target2)
.AddMap(a => a.Source3, b => b.Target3)
.AddMap(a => a.Source4, b => b.Target4)
.AddMap(a => a.Source5, b => b.Target5);
Guid guid = Guid.NewGuid();
Source source = new Source(1, "as", null, guid, 2);
Target target = new Target();
Assert.That(target.Target1, Is.EqualTo(default(int)));
Assert.That(target.Target2, Is.EqualTo(default(string)));
Assert.That(target.Target3, Is.EqualTo(default(object)));
Assert.That(target.Target4, Is.EqualTo(default(Guid)));
Assert.That(target.Target5, Is.EqualTo(default(int)));
target = source.Map(map);
Assert.That(target.Target1, Is.EqualTo(source.Source1));
Assert.That(target.Target2, Is.EqualTo(source.Source2));
Assert.That(target.Target3, Is.EqualTo(source.Source3));
Assert.That(target.Target4, Is.EqualTo(source.Source4));
Assert.That(target.Target5, Is.EqualTo(source.Source5));
}
示例14: use_is_empty
public void use_is_empty()
{
var doc1 = Target.Random(false);
var doc2 = Target.Random(true);
var doc3 = Target.Random(false);
var doc4 = Target.Random(true);
var empties = new Target[] {doc1, doc3}.OrderBy(x => x.Id).Select(x => x.Id).ToArray();
using (var session = theStore.OpenSession())
{
session.Store(doc1, doc2, doc3, doc4);
session.SaveChanges();
}
using (var query = theStore.QuerySession())
{
query.Query<Target>().Where(x => x.Children.IsEmpty())
.OrderBy(x => x.Id).Select(x => x.Id)
.ToList()
.ShouldHaveTheSameElementsAs(empties);
}
}
示例15: SetUp
public static void SetUp(TestContext context)
{
_unitOfWork = new UnitOfWork();
_memberFactory = new MemberFactory();
_gomeeFactory = new GomeeFactory();
_targetFactory = new TargetFactory();
_targetDecorator = new TargetDecorator(_targetFactory, _unitOfWork.TargetRepository);
_member = _memberFactory.CreateMember(Guid.NewGuid().ToString());
_gomee = _gomeeFactory.CreateGomee(_member);
_target = _targetFactory.CreateGomeeTarget(_member, _gomee);
using (var uow = new UnitOfWork())
{
uow.MemberRepository.Add(_member);
uow.GomeeRepository.Add(_gomee);
uow.TargetRepository.Add(_target);
uow.PersistAll();
_oldCount = uow.TargetRepository.Count();
}
_targetDecorator.Remove(_unitOfWork.TargetRepository.Get(_target.Id));
_unitOfWork.PersistAll();
_newCount = _unitOfWork.TargetRepository.Count();
try
{
_loadedTarget = _unitOfWork.TargetRepository.Get(_target.Id);
}
catch (ArgumentException)
{
_loadedTarget = null;
}
}