Esempio n. 1
0
        private void RestoreList(string Name, IObservableList v, bool isLocalBackup = false)
        {
            try
            {
                v.Clear();
            }
            catch (Exception ex)
            {
                //This is Temporary fix- Inputvalues list throwing observable collection cannot be modified exception
                Reporter.ToLog(eLogLevel.DEBUG, "Clearing list values for restoring from back up", ex);
            }


            object Backuplist;
            bool   b;

            b = isLocalBackup ? mLocalBackupDic.TryGetValue(Name + "~List", out Backuplist) : mBackupDic.TryGetValue(Name + "~List", out Backuplist);

            if (b)
            {
                if (Backuplist != null)
                {
                    foreach (object o in ((IList)Backuplist))
                    {
                        v.Add(o);
                        RepositoryItemBase repoItem = o as RepositoryItemBase;
                        repoItem?.RestoreBackup(isLocalBackup);   // Drill down the restore
                    }

                    object item = null;
                    if (isLocalBackup)
                    {
                        mLocalBackupDic.TryRemove(Name + "~List", out item);
                    }
                    else
                    {
                        mBackupDic.TryRemove(Name + "~List", out item);
                    }
                }
                else
                {
                    v = null;
                }
            }
            else
            {
                // TODO: handle err
            }
        }
Esempio n. 2
0
        IEnumerator LoadData(int start)
        {
            if (start == 0)
            {
                data.Clear();
            }

            WWW www = new WWW("https://ilih.ru/steamspy/?start=" + start.ToString());

            yield return(www);

            var lines = www.text.Split('\n');

            data.BeginUpdate();

            lines.ForEach(ParseLine);

            data.EndUpdate();
        }
Esempio n. 3
0
        private void RestoreList(string Name, IObservableList v, bool isLocalBackup = false)
        {
            v.Clear();

            object Backuplist;
            bool   b;

            b = isLocalBackup ? mLocalBackupDic.TryGetValue(Name + "~List", out Backuplist) : mBackupDic.TryGetValue(Name + "~List", out Backuplist);

            if (b)
            {
                if (Backuplist != null)
                {
                    foreach (object o in ((IList)Backuplist))
                    {
                        v.Add(o);
                        RepositoryItemBase repoItem = o as RepositoryItemBase;
                        repoItem?.RestoreBackup(isLocalBackup);   // Drill down the restore
                    }

                    if (isLocalBackup)
                    {
                        mLocalBackupDic.Remove(Name + "~List");
                    }
                    else
                    {
                        mBackupDic.Remove(Name + "~List");
                    }
                }
                else
                {
                    v = null;
                }
            }
            else
            {
                // TODO: handle err
            }
        }
Esempio n. 4
0
        private void RestoreList(string Name, IObservableList v, bool isLocalBackup = false)
        {
            v.Clear();

            object Backuplist;
            bool   b;

            if (isLocalBackup)
            {
                b = mLocalBackupDic.TryGetValue(Name + "~List", out Backuplist);
            }
            else
            {
                b = mBackupDic.TryGetValue(Name + "~List", out Backuplist);
            }
            if (!b)
            {
                // TODO: handle err
            }


            foreach (object o in ((IList)Backuplist))
            {
                v.Add(o);

                if (o is RepositoryItemBase)
                {
                    ((RepositoryItemBase)o).RestoreBackup(isLocalBackup);   // Drill down the restore
                }
            }
            if (isLocalBackup)
            {
                mLocalBackupDic.Remove(Name + "~List");
            }
            else
            {
                mBackupDic.Remove(Name + "~List");
            }
        }
Esempio n. 5
0
        private void RestoreList(string Name, IObservableList v)
        {
            v.Clear();

            object Backuplist;
            bool   b = mBackupDic.TryGetValue(Name + "~List", out Backuplist);

            if (!b)
            {
                // TODO: handle err
            }

            foreach (object o in (List <dynamic>)Backuplist)
            {
                v.Add(o);

                if (o is RepositoryItemBase)
                {
                    ((RepositoryItemBase)o).RestoreBackup();   // Drill down the restore
                }
            }
            mBackupDic.Remove(Name + "~List");
        }
Esempio n. 6
0
 /// <summary>
 /// Clear items of this instance.
 /// </summary>
 public override void Clear()
 {
     nodes.Clear();
     SetScrollValue(0f);
 }
 public void Reset()
 {
     Axis.Reset();
     Points.Clear();
 }