Пример #1
0
        public override void RemoveItemAt(int index)
        {
            var provider = GetDataproviderAt(index);

            if (provider == null)
            {
                return;
            }

            DataProviders.Remove(provider);

            //TODO: Introduce better optimalized method
            //currently it uses SetData method as its needed to do most of stuff done there(mainly remapping item mediators etc)
            SetData(DataProviders);
        }
Пример #2
0
        public void UnregisterDataProvider(DataProvider provider)
        {
            if (!DataProviders.Contains(provider))
            {
                return;
            }
            for (int i = 0; i < sheet.RowCount; i++)
            {
                for (int j = 0; j < sheet.ColumnCount; j++)
                {
                    Cell cell = sheet.GetCell(i, j);
                    if (cell == null)
                    {
                        continue;
                    }
                    if (cell.DataProvider == provider)
                    {
                        cell.DataProvider = null;
                    }
                }
            }
            if (provider.Trigger.TryGetTarget(out var tigger) && tigger != null)
            {
                tigger.Visibility = System.Windows.Visibility.Collapsed;
                if (sheet.workbook.ControlInstance.Children.Contains(tigger))
                {
                    sheet.workbook.ControlInstance.Children.Remove(tigger);
                }
            }
            if (provider.Selector.TryGetTarget(out var selector) && selector != null)
            {
                if (sheet.workbook.ControlInstance.Children.Contains(selector))
                {
                    sheet.workbook.ControlInstance.Children.Remove(selector);
                }
            }

            DataProviders.Remove(provider);
        }
Пример #3
0
 public GetHEREWqx()
 {
     DataProviders.Remove(DataSourceParameterType.SourceDatabaseDataSource.ToString());
 }