Exemplo n.º 1
0
 public void Init(TEnum type, TTarget target, Objectiver <TEnum, TUnit, TTarget> objectiver)
 {
     Objectiver = objectiver;
     Target     = target;
     Type       = type;
     EnumIndex  = Enum <TEnum> .Int(type);
 }
Exemplo n.º 2
0
            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);
            }
Exemplo n.º 3
0
        private void btn_DeleteTarget_Click(object sender, RoutedEventArgs e)
        {
            TTarget drv = dg_tt.SelectedItem as TTarget;

            if (null == drv)
            {
                return;
            }
            this.memberData.Remove(drv);
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 public bool Remove(TTarget item)
 {
     if (_inner.Contains(From(item)))
     {
         _inner.Remove(From(item));
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
        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();
            }
        }
Exemplo n.º 9
0
 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");
     }
 }
Exemplo n.º 10
0
        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;
 }
Exemplo n.º 12
0
 public void Insert(int index, TTarget item) => _inner.Insert(index, From(item));
Exemplo n.º 13
0
 public Item(TTarget target, int scale)
 {
     Target = target;
     Scale  = scale;
 }
Exemplo n.º 14
0
 if (!TryConvert(valueConverter, sourceValue, out TTarget targetValue, formatProvider))
 {
     return(false, default);
Exemplo n.º 15
0
 public int Compare(TTarget x, TSecond y)
 {
     return(baseCompare(toSource(x), y));
 }
Exemplo n.º 16
0
 protected void EmitNext(TTarget value) => this.Child?.OnNext(value);
Exemplo n.º 17
0
 public bool Contains(TTarget item) => _inner.Contains(From(item));
Exemplo n.º 18
0
 public int IndexOf(TTarget item) => _inner.IndexOf(From(item));
Exemplo n.º 19
0
            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);
                }
            }
Exemplo n.º 20
0
 public Context(T context, TTarget source)
     : base(context)
 {
     _context = context;
     Target   = source;
 }
Exemplo n.º 21
0
 /// <summary>
 /// 执行映射
 /// </summary>
 /// <param name="source">源</param>
 /// <param name="target">目标</param>
 public void Invoke(TSource source, TTarget target)
 {
     this.action.Invoke(source, target);
 }
Exemplo n.º 22
0
        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");
        }
Exemplo n.º 23
0
 public bool IsHave(int index, TTarget target)
 {
     return(Targets[index].Contains(target));
 }
Exemplo n.º 24
0
 public EmbeddedPointerIndirectionWithSymbolAndOnMarkedCallbackNode(ArrayOfEmbeddedPointersNode <TTarget> futureParent, TTarget target, int id, OnMarkedDelegate onMarkedCallback)
     : base(futureParent, target, id)
 {
     _onMarkedCallback = onMarkedCallback;
 }
Exemplo n.º 25
0
        /// <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>());
        }
Exemplo n.º 26
0
            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));
                    }
                }
            }
Exemplo n.º 27
0
 public int Compare(TTarget x, TSecond y) => baseCompare(ToSource(x), y);
Exemplo n.º 28
0
            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)));
                }
            }
Exemplo n.º 29
0
 public void FireNext(TTarget e)
 {
     observer.OnNext(e);
 }
Exemplo n.º 30
0
 public EmbeddedPointerIndirectionWithSymbolNode(ArrayOfEmbeddedPointersNode <TTarget> futureParent, TTarget target, int id)
     : base(futureParent, target)
 {
     _id = id;
 }
Exemplo n.º 31
0
        /// <inheritdoc/>
        public T Target <TTarget>() where TTarget : class, new()
        {
            var target = new TTarget();

            return(Target(target));
        }