Exemple #1
0
        private void RefreshMembers()
        {
            Task.Run(async() =>
            {
                if (ListId == 0)
                {
                    var listDesc = await ListProxy.GetListDescription(_info).ConfigureAwait(false);
                    if (listDesc != null)
                    {
                        _listId = listDesc.Id;
                    }
                }
                // list data is not found
                if (ListId == 0)
                {
                    return;
                }

                var userIds = await ListProxy.GetListMembers(ListId).ConfigureAwait(false);
                // user data is not found
                if (userIds == null)
                {
                    return;
                }

                lock (Ids)
                {
                    Ids.Clear();
                    userIds.ForEach(id => Ids.Add(id));
                }
                OnListMemberUpdated.SafeInvoke();
            });
        }
 public ImportViewModel(IImportService import)
 {
     _import       = import;
     ClearCommand  = new RelayCommand(() => Ids.Clear(), () => Ids.Count > 0);
     ImportCommand = new AsyncCommand(async() =>
     {
         await Task.Run(() =>
                        _import.ImportAsync(Ids.ToList(), SelectedGroup, Rcf ? ProfileType.Rcf : ProfileType.Fide));
         //await _import.ImportAsync(Ids.ToList(), SelectedGroup, Rcf ? ProfileType.Rcf : ProfileType.Fide)
         //.ConfigureAwait(false);
         MessengerInstance.Send(Ri2Constants.Notifications.DbUpdated);
         MessengerInstance.Send(Ri2Constants.Notifications.ProfilesUpdated);
     });
     AddIdCommand = new RelayCommand(() =>
     {
         if (CurrentId != 0)
         {
             Ids.Add(CurrentId);
         }
         CurrentId = 0;
     });
     SelectFileCommand = new RelayCommand(SelectFile);
     DeleteIdCommand   = new RelayCommand <int>(i => Ids.Remove(i), Ids.Count > 0);
     MessengerInstance.Register <string>(this, msg =>
     {
         if (msg == Ri2Constants.Notifications.GroupsUpdated)
         {
             RaisePropertyChanged(nameof(Groups));
         }
     });
 }
Exemple #3
0
 public void Clear()
 {
     Data.Clear();
     Ids.Clear();
     LastModified.Clear();
     Count = 0;
 }
Exemple #4
0
 public void GetProduct()
 {
     DataGridProducts = ProductsModel.GetProducts();
     if (Ids != null)
     {
         Ids.Clear();
     }
     Ids = DataGridProducts.Select(x => x.Id).ToList();
 }
Exemple #5
0
 public void Clear()
 {
     if (Ids.Count != 0)
     {
         Initialize();
         Ids.Clear();
         IsModified = true;
     }
 }
Exemple #6
0
 public void GetSupplier()
 {
     DataGridSupplier = SupplierModel.GetSupplier();
     if (Ids != null)
     {
         Ids.Clear();
     }
     Ids = DataGridSupplier.Select(x => x.Id).ToList();
 }
Exemple #7
0
            /// <summary> Restore any previously saved values (Ids list) from the EditorPrefs </summary>
            public void RestoreFromEditorPrefs()
            {
                string ids = EditorPrefs.GetString(m_editorPrefsKey, "");    //get all the ids (the first entry is the parent graph asset path)

                if (string.IsNullOrEmpty(ids))
                {
                    return;                                                  //if nothing is there -> return
                }
                string[] idsArray = ids.Split(ScriptUtils.STRING_SEPARATOR); //split the ids
                Ids.Clear();                                                 //clear the current ids list
                GraphAssetPath = idsArray[0];                                //set the graph asset path -> this is the first entry in the string value and it is the parent graph of the copied nodes
                ArrayUtility.RemoveAt(ref idsArray, 0);                      //remove the parent graph as now we want the node ids
                Ids.AddRange(idsArray);                                      //add the saved node ids to the ids list
            }
 public void Clear()
 {
     Ids.Clear();
     Limit = 0;
 }
Exemple #9
0
 /// <summary> Clear the Ids list and also the EditorPrefs entry </summary>
 public void Clear()
 {
     Ids.Clear();                                 //clear the current ids list
     EditorPrefs.SetString(m_editorPrefsKey, ""); //clear the saved entry in editor prefs
 }
Exemple #10
0
            protected override void OnListChanging(ListChgEventArgs <Element> args)
            {
                var elem = args.Item;

                if (elem != null && (elem.Chart != null && elem.Chart != m_chart))
                {
                    throw new ArgumentException("element belongs to another chart");
                }

                switch (args.ChangeType)
                {
                case ListChg.Reset:
                {
                    // Remove all elements from the chart
                    foreach (var e in this)
                    {
                        e.SetChartInternal(m_chart, false);
                    }

                    // Repopulate the IDs collection
                    Ids.Clear();
                    foreach (var e in this)
                    {
                        Ids.Add(e.Id, e);
                    }

                    Debug.Assert(m_chart.CheckConsistency());
                    break;
                }

                case ListChg.ItemAdded:
                {
                    // Remove from any previous chart
                    if (elem == null)
                    {
                        throw new Exception("ItemAdded should provide the added element");
                    }
                    elem.SetChartInternal(m_chart, false);

                    // Track the ID
                    Ids.Add(elem.Id, elem);

                    Debug.Assert(m_chart.CheckConsistency());
                    break;
                }

                case ListChg.ItemPreRemove:
                {
                    // Remove from selected or hovered sets before removing form the collection
                    if (elem == null)
                    {
                        throw new Exception("ItemPreRemove should provide the element to be removed");
                    }
                    elem.Selected = false;
                    elem.Hovered  = false;

                    Debug.Assert(m_chart.CheckConsistency());
                    break;
                }

                case ListChg.ItemRemoved:
                {
                    // Remove from the chart
                    if (elem == null)
                    {
                        throw new Exception("ItemRemoved should provide the removed element");
                    }
                    elem.SetChartInternal(null, false);

                    // Forget the ID
                    Ids.Remove(elem.Id);

                    Debug.Assert(m_chart.CheckConsistency());
                    break;
                }
                }
                base.OnListChanging(args);
            }
 public void Clear()
 {
     Ids.Clear();
 }