Exemple #1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public HashSet(IEnumerable <T> source)
 {
     hset = new Java.Util.HashSet <T>();
     foreach (var item in source)
     {
         hset.Add(item);
     }
 }
Exemple #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public HashSet(IEnumerable <T> source, IEqualityComparer <T> comparer)
 {
     hset = new Java.Util.HashSet <T>();
     foreach (var item in source)
     {
         hset.Add(item);
     }
 }
Exemple #3
0
        /// <summary>
        /// Default ctor
        /// </summary>
        public HashSet(IEqualityComparer <T> comparer)
        {
            if (comparer != null && comparer != EqualityComparer <T> .Default)
            {
                throw new NotImplementedException("comparer not supported");
            }

            hset = new Java.Util.HashSet <T>();
        }
        public CustomMultiSelectListPreferenceDialogFragment(string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentNullException(nameof(key));
            }

            var bundle = new Bundle(1);

            bundle.PutString(ArgKey, key);
            Arguments = bundle;

            _newValues = new Java.Util.HashSet();
        }
Exemple #5
0
            public virtual bool OnSelection(MaterialDialog dialog, int[] which, string[] text)
            {
                preference.OnClick(null, (int)DialogButtonType.Positive);
                dialog.Dismiss();
                var values = new Java.Util.HashSet();

                foreach (string s in text)
                {
                    values.Add((string)s);
                }
                if (preference.CallChangeListener(values))
                {
                    preference.Values = text.ToList();
                }
                return(true);
            }
Exemple #6
0
        public void IntersectWith(IEnumerable <T> other)
        {
            var wrap = other as IJavaCollectionWrapper <T>;

            if (wrap != null)
            {
                hset.RetainAll((Java.Util.ICollection <object>)wrap.Collection);
            }
            else
            {
                var remove = new Java.Util.HashSet <T>(hset);
                foreach (var e in other)
                {
                    remove.Remove(e);
                }
                hset.RemoveAll((Java.Util.ICollection <object>)remove);
            }
        }
Exemple #7
0
        ///// <summary>
        ///// Default ctor
        ///// </summary>
        public HashSet(IEnumerable <T> source, IEqualityComparer <T> comparer)
        {
            if (comparer != null && comparer != EqualityComparer <T> .Default)
            {
                throw new NotImplementedException("comparer not supported");
            }

            var wrap = source as IJavaCollectionWrapper <T>;

            if (wrap != null)
            {
                hset = new Java.Util.HashSet <T>(wrap.Collection);
            }
            else
            {
                hset = new Java.Util.HashSet <T>();
                foreach (var item in source)
                {
                    hset.Add(item);
                }
            }
        }
Exemple #8
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public HashSet()
 {
     hset = new Java.Util.HashSet <T>();
 }
Exemple #9
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public HashSet(IEqualityComparer <T> comparer)
 {
     hset = new Java.Util.HashSet <T>();
 }