Exemple #1
0
        public void Close()
        {
            IDisposable disposable = JitHelpers.UnsafeCast <IDisposable>(this);

            disposable.Dispose();
        }
        internal void Clear()
        {
            IBindableVector _this = JitHelpers.UnsafeCast <IBindableVector>(this);

            _this.Clear();
        }
        internal IBindableIterator First_Stub()
        {
            IEnumerable _this = JitHelpers.UnsafeCast <IEnumerable>(this);

            return(new EnumeratorToIteratorAdapter <object>(new NonGenericToGenericEnumerator(_this.GetEnumerator())));
        }
        internal void Add <T>(T item)
        {
            IVector <T> vector = JitHelpers.UnsafeCast <IVector <T> >(this);

            vector.Append(item);
        }
        // void Clear()
        internal void Clear <K, V>()
        {
            IDictionary <K, V> _this = JitHelpers.UnsafeCast <IDictionary <K, V> >(this);

            _this.Clear();
        }
Exemple #6
0
        // void Append(object value)
        internal void Append(object value)
        {
            IList _this = JitHelpers.UnsafeCast <IList>(this);

            _this.Add(value);
        }
Exemple #7
0
        // uint Size { get }
        internal uint Size()
        {
            IList _this = JitHelpers.UnsafeCast <IList>(this);

            return((uint)_this.Count);
        }
 internal IEnumerator <T> GetEnumerator <T>()
 {
     return(new SZGenericArrayEnumerator <T>(JitHelpers.UnsafeCast <T[]>(this)));
 }
 private int IndexOf <T>(T value)
 {
     return(Array.IndexOf <T>(JitHelpers.UnsafeCast <T[]>(this), value));
 }
 private bool Contains <T>(T value)
 {
     return(Array.IndexOf <T>(JitHelpers.UnsafeCast <T[]>(this), value) != -1);
 }
 internal int get_Count <T>()
 {
     return(JitHelpers.UnsafeCast <T[]>(this).Length);
 }
Exemple #12
0
        internal uint GetMany <T>(uint startIndex, T[] items)
        {
            IList <T> _this = JitHelpers.UnsafeCast <IList <T> >(this);

            return(GetManyHelper <T>(_this, startIndex, items));
        }
Exemple #13
0
        internal void Append <T>(T value)
        {
            IList <T> _this = JitHelpers.UnsafeCast <IList <T> >(this);

            _this.Add(value);
        }
 internal IEnumerator GetEnumerator_Stub()
 {
     return((IEnumerator) new IteratorToEnumeratorAdapter <object>((IIterator <object>) new BindableIterableToEnumerableAdapter.NonGenericToGenericIterator(JitHelpers.UnsafeCast <IBindableIterable>((object)this).First())));
 }
        // uint Size { get }
        internal uint Size <T>()
        {
            IReadOnlyList <T> _this = JitHelpers.UnsafeCast <IReadOnlyList <T> >(this);

            return((uint)_this.Count);
        }
Exemple #16
0
        internal void Clear()
        {
            IBindableVector bindableVector = JitHelpers.UnsafeCast <IBindableVector>(this);

            bindableVector.Clear();
        }
Exemple #17
0
        // equals returns true IIF the delegate is not null and has the
        //    same target, method and invocation list as this object
        public override sealed bool Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (!InternalEqualTypes(this, obj))
            {
                return(false);
            }

            // Since this is a MulticastDelegate and we know
            // the types are the same, obj should also be a
            // MulticastDelegate
            Debug.Assert(obj is MulticastDelegate, "Shouldn't have failed here since we already checked the types are the same!");
            var d = JitHelpers.UnsafeCast <MulticastDelegate>(obj);

            if (_invocationCount != (IntPtr)0)
            {
                // there are 4 kind of delegate kinds that fall into this bucket
                // 1- Multicast (_invocationList is Object[])
                // 2- Secure/Wrapper (_invocationList is Delegate)
                // 3- Unmanaged FntPtr (_invocationList == null)
                // 4- Open virtual (_invocationCount == MethodDesc of target, _invocationList == null, LoaderAllocator, or DynamicResolver)

                if (InvocationListLogicallyNull())
                {
                    if (IsUnmanagedFunctionPtr())
                    {
                        if (!d.IsUnmanagedFunctionPtr())
                        {
                            return(false);
                        }

                        return(CompareUnmanagedFunctionPtrs(this, d));
                    }

                    // now we know 'this' is not a special one, so we can work out what the other is
                    if ((d._invocationList as Delegate) != null)
                    {
                        // this is a secure/wrapper delegate so we need to unwrap and check the inner one
                        return(Equals(d._invocationList));
                    }

                    return(base.Equals(obj));
                }
                else
                {
                    if ((_invocationList as Delegate) != null)
                    {
                        // this is a secure/wrapper delegate so we need to unwrap and check the inner one
                        return(_invocationList.Equals(obj));
                    }
                    else
                    {
                        Debug.Assert((_invocationList as Object[]) != null, "empty invocation list on multicast delegate");
                        return(InvocationListEquals(d));
                    }
                }
            }
            else
            {
                // among the several kind of delegates falling into this bucket one has got a non
                // empty _invocationList (open static with special sig)
                // to be equals we need to check that _invocationList matches (both null is fine)
                // and call the base.Equals()
                if (!InvocationListLogicallyNull())
                {
                    if (!_invocationList.Equals(d._invocationList))
                    {
                        return(false);
                    }
                    return(base.Equals(d));
                }

                // now we know 'this' is not a special one, so we can work out what the other is
                if ((d._invocationList as Delegate) != null)
                {
                    // this is a secure/wrapper delegate so we need to unwrap and check the inner one
                    return(Equals(d._invocationList));
                }

                // now we can call on the base
                return(base.Equals(d));
            }
        }
Exemple #18
0
        internal void Clear <T>()
        {
            IVector <T> _this = JitHelpers.UnsafeCast <IVector <T> >(this);

            _this.Clear();
        }
Exemple #19
0
        // void Clear()
        internal void Clear()
        {
            IList _this = JitHelpers.UnsafeCast <IList>(this);

            _this.Clear();
        }
Exemple #20
0
 public void Close()
 {
     JitHelpers.UnsafeCast <IDisposable>((object)this).Dispose();
 }
Exemple #21
0
        // IBindableVectorView GetView()
        internal IBindableVectorView GetView()
        {
            IList _this = JitHelpers.UnsafeCast <IList>(this);

            return(new ListToBindableVectorViewAdapter(_this));
        }
Exemple #22
0
        public void Close()
        {
            IDisposable _this = JitHelpers.UnsafeCast <IDisposable>(this);

            _this.Dispose();
        }
        internal void Clear <T>()
        {
            IVector <T> vector = JitHelpers.UnsafeCast <IVector <T> >(this);

            vector.Clear();
        }
Exemple #24
0
        private void Dispose()
        {
            IClosable _this = JitHelpers.UnsafeCast <IClosable>(this);

            _this.Close();
        }
        // bool HasKey(K key)
        internal bool HasKey <K, V>(K key)
        {
            IDictionary <K, V> _this = JitHelpers.UnsafeCast <IDictionary <K, V> >(this);

            return(_this.ContainsKey(key));
        }
        internal IEnumerator GetEnumerator_Stub()
        {
            IBindableIterable _this = JitHelpers.UnsafeCast <IBindableIterable>(this);

            return(new IteratorToEnumeratorAdapter <object>(new NonGenericToGenericIterator(_this.First())));
        }
        internal IIterator <T> First_Stub <T>()
        {
            IEnumerable <T> _this = JitHelpers.UnsafeCast <IEnumerable <T> >(this);

            return(new EnumeratorToIteratorAdapter <T>(_this.GetEnumerator()));
        }
        internal IEnumerator <T> GetEnumerator_Stub <T>()
        {
            IIterable <T> _this = JitHelpers.UnsafeCast <IIterable <T> >(this);

            return(new IteratorToEnumeratorAdapter <T>(_this.First()));
        }
        // uint Size { get }
        internal uint Size <K, V>()
        {
            IReadOnlyDictionary <K, V> _this = JitHelpers.UnsafeCast <IReadOnlyDictionary <K, V> >(this);

            return((uint)_this.Count);
        }
Exemple #30
0
        private void Execute(object parameter)
        {
            ICommand _this = JitHelpers.UnsafeCast <ICommand>(this);

            _this.Execute(parameter);
        }