Esempio n. 1
0
        public StorageValues GetValues()
        {
            if (Plugin == null)
            {
                throw new Exception("Свойство Plugin не может быть равен null");
            }

            var storageValues = new StorageValues(new Hashtable(), new List <Hashtable>());

            foreach (var filter in Plugin.Conditions)
            {
                var storage = filter.ColumnFilter.GetStorage();
                var text    = filter.Visible ? filter.ColumnFilter.GetTexts() : null;
                storageValues.AddStorage(storage, text);
            }
            if (Plugin.CircleFillConditions != null)
            {
                for (int i = 0; i < Plugin.CircleFillConditions.Count; i++)
                {
                    foreach (var filter in Plugin.CircleFillConditions[i])
                    {
                        var storage = filter.ColumnFilter.GetStorage();
                        var text    = filter.Visible ? filter.ColumnFilter.GetTexts() : null;
                        storageValues.AddListStorage(storage, i, text);
                    }
                }
            }
            return(storageValues);
        }
        private void SaveFiltersState()
        {
            StorageValues storageValues       = new StorageValues();
            bool          storageValuesNotSet = true;

            foreach (ColumnFilterStorage storage in ColumnFilterStorages)
            {
                storageValues.AddStorage(storage);
                if (storage.FilterType != ColumnFilterType.None)
                {
                    storageValuesNotSet = false;
                }
            }
            if (storageValuesNotSet)
            {
                storageValues = null;
            }

            var sid = GetSidBytes();

            StorageValues.SetStorageValues(string.Format("{0}_{1}", Page.AppRelativeVirtualPath, ClientID), sid, storageValues);
        }