public void Init(TEnum type, TTarget target, Objectiver <TEnum, TUnit, TTarget> objectiver) { Objectiver = objectiver; Target = target; Type = type; EnumIndex = Enum <TEnum> .Int(type); }
public override bool Test(IActor a, TTarget target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!sTest.Test(a, target, mHit, ref greyedOutTooltipCallback)) { return(false); } return(!isAutonomous); }
private void btn_DeleteTarget_Click(object sender, RoutedEventArgs e) { TTarget drv = dg_tt.SelectedItem as TTarget; if (null == drv) { return; } this.memberData.Remove(drv); }
public _EveryValueChanged(TTarget target, Func <TTarget, TProperty> propertySelector, IEqualityComparer <TProperty> equalityComparer, PlayerLoopTiming monitorTiming, CancellationToken cancellationToken) { this.target = target; this.targetAsUnityObject = target as UnityEngine.Object; this.propertySelector = propertySelector; this.equalityComparer = equalityComparer; this.cancellationToken = cancellationToken; this.first = true; TaskTracker.TrackActiveTask(this, 2); PlayerLoopHelper.AddAction(monitorTiming, this); }
public bool Remove(TTarget item) { if (_inner.Contains(From(item))) { _inner.Remove(From(item)); return(true); } else { return(false); } }
public static void NormalizeBond(TTarget target, RawAsset raw) { NormalizationElements normalizationElements = new NormalizationElements(raw); target.SecSubType = GetBondSecSubType(raw); target.SecComplementType = GetSecComplementType(raw); target.SecCurrency = normalizationElements.SecCurrency(() => target.SecCurrency); ... many more target.FlatIndicator = GetFlatIndicator(raw.Hxds); }
private void OrderTarget() { List <TTarget> tempTTarget = new List <TTarget>(); while (0 < memberData.Count) { TTarget target = memberData.First(fm => fm.Order.Equals(memberData.Min(m => m.Order))); tempTTarget.Add(target); memberData.Remove(target); } memberData.Clear(); foreach (TTarget item in tempTTarget) { memberData.Add(item); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (null != TargetDetail) { this.txtName.Text = TargetDetail.Name; this.txtTarget.Text = TargetDetail.Target; this.txtHttpMethod.Text = TargetDetail.HttpMethod; this.txtParam.Text = TargetDetail.Param; this.txtOrder.Text = TargetDetail.Order.ToString(); } else { TargetDetail = new TTarget(); } }
public override string GetInteractionName(IActor actor, TTarget target, InteractionObjectPair iop) { try { if (mOption == null) { return(sTest.GetInteractionName(actor, target, mHit)); } else { return(mOption.ToString()); } } catch (Exception e) { Common.Exception(actor, target, e); return("Exception"); } }
private void ttData_MouseDoubleClick(object sender, MouseButtonEventArgs e) { TTarget drv = dg_tt.SelectedItem as TTarget; if (null == drv) { return; } TTargetDetail t = new TTargetDetail(); t.TargetDetail = drv; t.ShowDialog(); if (t.GetModifyFlag()) { //drv = t.TargetDetail; //this.memberData.Remove(drv); //this.memberData.Add(t.TargetDetail); OrderTarget(); } }
internal AssociationSourceCollection(AssociationProperty <TSource, TTarget> property, TTarget target) { this.property = property; this.target = target; }
public void Insert(int index, TTarget item) => _inner.Insert(index, From(item));
public Item(TTarget target, int scale) { Target = target; Scale = scale; }
if (!TryConvert(valueConverter, sourceValue, out TTarget targetValue, formatProvider)) { return(false, default);
public int Compare(TTarget x, TSecond y) { return(baseCompare(toSource(x), y)); }
protected void EmitNext(TTarget value) => this.Child?.OnNext(value);
public bool Contains(TTarget item) => _inner.Contains(From(item));
public int IndexOf(TTarget item) => _inner.IndexOf(From(item));
public override void AddInteractions(InteractionObjectPair iop, IActor actor, TTarget target, List <InteractionObjectPair> results) { try { string[] defPath = mPath; if ((defPath == null) || (defPath.Length == 0)) { if (mAddRoot) { defPath = new string[] { "NRaas", sTest.GetInteractionName(actor, target, mHit) }; } else { defPath = new string[] { "NRaas" }; } } if ((mPopup) || ((VersionStamp.sPopupMenuStyle)) && (iop == null)) { List <string> path = null; if (mPopup) { path = new List <string>(defPath); } else { path = new List <string>(); } if (sPopupOptions == null) { sPopupOptions = new List <IInteractionOptionItem <IActor, TTarget, GameHitParameters <TTarget> > >(); foreach (TOption option in CommonOptionList <TOption> .AllOptions()) { sPopupOptions.Add(option.Clone() as TOption); } } ListOptions(null, sPopupOptions, actor, target, mHit, mPopup, path, results); } else { mPath = defPath; base.AddInteractions(iop, actor, target, results); } } catch (Exception e) { Common.Exception(actor, target, e); } }
public Context(T context, TTarget source) : base(context) { _context = context; Target = source; }
/// <summary> /// 执行映射 /// </summary> /// <param name="source">源</param> /// <param name="target">目标</param> public void Invoke(TSource source, TTarget target) { this.action.Invoke(source, target); }
public void ConvertTest() { void Test <TTarget>(object source, TTarget expectedResult) { TTarget actualResult = source.Convert <TTarget>(); AssertDeepEquals(expectedResult, actualResult); } // IConvertible Test("1", 1); Test(1, "1"); Test(1.0, 1); Test("1", true); // Parse Test(100.12, 'd'); // double -> long -> char Test(13.45m, ConsoleColor.Magenta); // decimal -> long -> enum // Registered conversions Throws <ArgumentException>(() => Test(1L, new IntPtr(1))); Throws <ArgumentException>(() => Test(1, new IntPtr(1))); typeof(long).RegisterConversion(typeof(IntPtr), (obj, type, culture) => new IntPtr((long)obj)); Test(1L, new IntPtr(1)); Test(1, new IntPtr(1)); // int -> long -> IntPtr // to array Test(new int[] { 1, 2, 3 }, new long[] { 1, 2, 3 }); // between arrays Test(new int[, ] { { 1, 2 }, { 3, 4 } }, new long[, ] { { 1, 2 }, { 3, 4 } }); // multidimensional array Test(new List <int> { 1, 2, 3 }, new long[] { 1, 2, 3 }); // from known length to array Test(new List <int> { 1, 2, 3 }.Where(_ => true), new long[] { 1, 2, 3 }); // from unknown length to array // to collection Test(new int[] { 1, 2, 3 }, new List <string> { "1", "2", "3" }); // populatable Test(new int[] { 1, 2, 3 }, new ReadOnlyCollection <string>(new List <string> { "1", "2", "3" })); // by ctor, accepts list #if !NET35 Test(new int[] { 1, 2, 3 }, new ArraySegment <string>(new[] { "1", "2", "3" })); // by ctor, accepts array #endif Test(new List <int> { 1, 2, 3 }, new ArrayList { 1, 2, 3 }); // gen -> non-gen Test(new ArrayList { 1, 2, 3 }, new List <int> { 1, 2, 3 }); // non-gen -> gen Test(new Dictionary <int, string> { { 1, "2" }, { 3, "4" } }, new Dictionary <string, int> { { "1", 2 }, { "3", 4 } }); // dictionary, populatable #if !(NET35 || NET40) Test(new Dictionary <int, string> { { 1, "2" }, { 3, "4" } }, new ReadOnlyDictionary <string, int>(new Dictionary <string, int> { { "1", 2 }, { "3", 4 } })); // dictionary, by another dictionary #endif Test(new Dictionary <int, string> { { 1, "2" }, { 3, "4" } }, new Hashtable { { 1, "2" }, { 3, "4" } }); // gen -> non-gen Test(new SortedList { { 1, "2" }, { 3, "4" } }, new SortedList <int, string> { { 1, "2" }, { 3, "4" } }); // non-gen -> gen // enumerable to string Test(new List <char> { 'a', 'b', 'c' }, "abc"); }
public bool IsHave(int index, TTarget target) { return(Targets[index].Contains(target)); }
public EmbeddedPointerIndirectionWithSymbolAndOnMarkedCallbackNode(ArrayOfEmbeddedPointersNode <TTarget> futureParent, TTarget target, int id, OnMarkedDelegate onMarkedCallback) : base(futureParent, target, id) { _onMarkedCallback = onMarkedCallback; }
/// <summary> /// Returns element with specific type. Eventually it will be an empty element /// </summary> /// <typeparam name="TTarget"></typeparam> /// <returns></returns> public virtual TTarget As <TTarget>() where TTarget : class, TContent { TTarget thisAsTarget = this as TTarget; return(thisAsTarget ?? Next.As <TTarget>()); }
private static void ListOptions(IInteractionProxy <IActor, TTarget, GameHitParameters <TTarget> > proxy, IEnumerable <IInteractionOptionItem <IActor, TTarget, GameHitParameters <TTarget> > > options, IActor actor, TTarget target, GameObjectHit hit, bool popup, List <string> path, List <InteractionObjectPair> results) { GameHitParameters <TTarget> parameters = new GameHitParameters <TTarget>(actor, target, hit); foreach (IInteractionOptionItem <IActor, TTarget, GameHitParameters <TTarget> > option in options) { if (!option.Test(parameters)) { continue; } IInteractionOptionList <TTarget> list = option as IInteractionOptionList <TTarget>; if (list != null) { List <string> newPath = new List <string>(path); newPath.Add(option.Name); ListOptions(list, list.IOptions(), actor, target, hit, popup, newPath, results); } else { results.Add(new InteractionObjectPair(new CommonDefinition <INTERACTION>(proxy, option, popup, path.ToArray()), target)); } } }
public int Compare(TTarget x, TSecond y) => baseCompare(ToSource(x), y);
public OptionResult Perform(CommonInteraction <TOption, TTarget> interaction, IActor actor, TTarget target, GameObjectHit hit) { if (mOption == null) { if ((mPopup) || (VersionStamp.sPopupMenuStyle)) { List <InteractionObjectPair> interactions = new List <InteractionObjectPair>(); AddInteractions(null, actor, target, interactions); Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(actor, new UIMouseEventArgsEx(), hit, interactions, InteractionMenuTypes.Normal); return(OptionResult.SuccessClose); } else { return(interaction.Perform(actor, target, hit)); } } else if (mProxy != null) { return(mProxy.Perform(mOption, new GameHitParameters <TTarget>(actor, target, hit))); } else { return(mOption.Perform(new GameHitParameters <TTarget>(actor, target, hit))); } }
public void FireNext(TTarget e) { observer.OnNext(e); }
public EmbeddedPointerIndirectionWithSymbolNode(ArrayOfEmbeddedPointersNode <TTarget> futureParent, TTarget target, int id) : base(futureParent, target) { _id = id; }
/// <inheritdoc/> public T Target <TTarget>() where TTarget : class, new() { var target = new TTarget(); return(Target(target)); }