Exemple #1
0
        public int OverWriteValueMembers(string values)
        {
            int valueDifference = Value.Length - values.Length;

            Value = values;
            ValueList.Clear();
            ValueList.AddRange(values);
            ValueSet.Clear();
            ValueSet.UnionWith(values);

            return(valueDifference);
        }
Exemple #2
0
        public void OnTimeChange()
        {
            int days      = DateTime.DaysInMonth(condition.Time.Year, condition.Time.Month);
            int Selectday = int.Parse(ValueListView.GetItemAtPosition(ValueListView.FirstVisiblePosition + 1).ToString());

            ValueList.Clear();
            for (int day = 1; day < days + 1; day++)
            {
                ValueList.Add(day.ToString());
            }
            ValueAdapter.NotifyDataSetChanged();
            Selectday = (Selectday > ValueList.Count) ? ValueList.Count : Selectday;
            ValueListView.SetSelection(((int.MaxValue / 2) - ((int.MaxValue / 2) % ValueList.Count)) + Selectday - 1 - ValueListView.mVisibleItemCount / 2);
            Value = Selectday.ToString();
        }
Exemple #3
0
 public void LoadData(Dictionary <string, List <DataPoint> > distributeList, List <DistributeValue> trendList)
 {
     DistributeDictionary = distributeList;
     if (DistributeDictionary != null && DistributeDictionary.Count > 0)
     {
         CurrentTarget = DistributeDictionary.FirstOrDefault().Key;
         CurrentValue  = CurrentValueList.LastOrDefault();
         LendList.Clear();
         foreach (var k in DistributeDictionary.Keys)
         {
             LendList.Add(k);
         }
     }
     ValueList.Clear();
     trendList.ForEach(v => ValueList.Add(v));
 }
Exemple #4
0
        public int OverWriteValueMembers(List <char> values)
        {
            int valueDifference = ValueList.Count - values.Count;

            StringBuilder sb = new StringBuilder();

            foreach (var c in values)
            {
                sb.Append(c.ToString());
            }

            Value = sb.ToString();
            ValueList.Clear();
            ValueList.AddRange(values);
            ValueSet.Clear();
            ValueSet.UnionWith(values);

            return(valueDifference);
        }
Exemple #5
0
        public static void ClearTest()
        {
            var valueList = new ValueList <int>(new int[] { 1, 2, 3 });

            valueList.Clear();

            Assert.That(() => valueList,
                        Has.Property("Capacity").EqualTo(3)
                        .And.Count.EqualTo(0)
                        );

            valueList = new ValueList <int>();
            valueList.Clear();

            Assert.That(() => valueList,
                        Has.Property("Capacity").EqualTo(0)
                        .And.Count.EqualTo(0)
                        );
        }
        ///--------------------------------------------------------------------------------
        /// <summary>This method disposes of resources in the model.</summary>
        ///--------------------------------------------------------------------------------
        protected override void OnDispose()
        {
            if (ReverseInstance != null)
            {
                ReverseInstance.Dispose();
                ReverseInstance = null;
            }
            if (ForwardInstance != null)
            {
                ForwardInstance.Dispose();
                ForwardInstance = null;
            }
            Model    = null;
            Solution = null;
            if (_definedByModelPropertyList != null)
            {
                foreach (ModelProperty item in DefinedByModelPropertyList)
                {
                    item.Dispose();
                }
                DefinedByModelPropertyList.Clear();
                DefinedByModelPropertyList = null;
            }
            if (_valueList != null)
            {
                foreach (Value item in ValueList)
                {
                    item.Dispose();
                }
                ValueList.Clear();
                ValueList = null;
            }

            #region protected
            #endregion protected

            base.OnDispose();
        }
Exemple #7
0
        public void Afficher_Graphique(SNAP_DATABASE Ctx_database_SNAP, AreaSeries chartratio, AreaSeries chartpoint, string joueur)
        {
            //initialiser la liste:
            ValueList.Clear();
            ValueList_point.Clear();
            //Récupération des données du joueur selectionné
            //récupération de la liste des joueurs ayant le facteur de risque le plus haut
            var liste_partie_joueur = Ctx_database_SNAP.Database.SqlQuery <string>("SELECT Partie_ID FROM Entity_Occurence WHERE Joueurs_ID= '" + joueur + "'").ToList();
            var Liste_point_joueur  = Ctx_database_SNAP.Database.SqlQuery <int>("SELECT Nombre_point FROM Entity_Occurence WHERE Joueurs_ID= '" + joueur + "'").ToList();
            var Liste_ratio_joueur  = Ctx_database_SNAP.Database.SqlQuery <float>("SELECT ratio FROM Entity_Occurence WHERE Joueurs_ID= '" + joueur + "'").ToList();

            //enrichier la liste avec les données des joueurs.
            for (int i = 0; i < liste_partie_joueur.Count; i++)
            {
                string datepartie = Ctx_database_SNAP.Database.SqlQuery <string>("SELECT Date FROM Entity_partie WHERE Nom = '" + liste_partie_joueur.ElementAt(i) + "'").ToList().ElementAt(0);
                KeyValuePair <string, float> data = new KeyValuePair <string, float>(datepartie, Liste_ratio_joueur.ElementAt(i));
                this.Add(data);
                KeyValuePair <string, int> datapoint = new KeyValuePair <string, int>(datepartie, Liste_point_joueur.ElementAt(i));
                this.Addpoint(datapoint);
            }
            //conctruction du graphique:
            chartratio.ItemsSource = this.ValueList;
            chartpoint.ItemsSource = this.ValueList_point;
        }
Exemple #8
0
 /// <summary>Removes all items from the pool.</summary>
 public void Clear()
 {
     _items.Clear();
     _availableItems.Clear();
 }