Exemplo n.º 1
0
        /// <summary>
        /// 加载当前页面数据
        /// </summary>
        /// <param name="p_pageData">当前页面数据</param>
        public void LoadPageData(INotifyList p_pageData)
        {
            // 不满一页时认为无下一页,正好满页且无下页是特殊情况!未处理,使用中应该不在意!
            HasMorePages = (p_pageData != null && p_pageData.Count >= PageSize);

            // uno中数据变化调用UpdateLayout并未测量布局,因此状态在LvPanel.OnSizeChanged中重置!
            if (_pageNo == 0)
            {
                // 首页,可能为空行
                _owner.Data = p_pageData;
            }
            else if (p_pageData != null && p_pageData.Count > 0)
            {
                if (InsertTop)
                {
                    LastPageCount = p_pageData.Count;
                    _owner.Data.InsertRange(0, p_pageData);
                }
                else
                {
                    _owner.Data.AddRange(p_pageData);
                }
            }

            // 无数据时未触发LvPanel.SizeChanged,直接重置状态
            if (p_pageData == null || p_pageData.Count == 0)
            {
                State = PageDataState.Normal;
            }
        }
Exemplo n.º 2
0
 public LvDataView(Lv p_owner, INotifyList p_data)
 {
     _owner = p_owner;
     _data  = p_data;
     _data.CollectionChanged += OnCollectionChanged;
     Refresh();
 }
 protected override void Context()
 {
     base.Context();
     _richList    = A.Fake <INotifyList <IAnInterface> >();
     _list        = _richList;
     sut.Changed += () => { _notifyRegistered = true; };
     sut.BindToSource(_list);
 }
Exemplo n.º 4
0
        public DiagramEditorControl()
        {
            InitializeComponent();

            _layoutManager = new LayoutManager(DockingManager);

            DiagramEditor.IndicatorTypes.AddRange(StockSharp.Configuration.Extensions.GetIndicatorTypes());
            PaletteElements = ConfigManager.GetService <StrategiesRegistry>().DiagramElements;
        }
		public DiagramEditorControl()
		{
			InitializeComponent();

			_layoutManager = new LayoutManager(DockingManager);

			DiagramEditor.IndicatorTypes.AddRange(StockSharp.Configuration.Extensions.GetIndicatorTypes());
			PaletteElements = ConfigManager.GetService<StrategiesRegistry>().DiagramElements;
		}
Exemplo n.º 6
0
        public void StartImport()
        {
            var tables = importedDataTableFromFile();

            _quantityImporterDTO = ConvertTableToImportedQuantities(tables);

            _view.BindTo(_quantityImporterDTO);
            UpdateLog(_quantityImporterDTO.Log);

            _quantityDTOs = GetQuantitiesFromDTO(_quantityImporterDTO.DowncastTo <QuantityImporterDTO>());
        }
Exemplo n.º 7
0
 internal static async Task AddDevices(Environment environment, IEnvironmentService service,
     IEnumerable<Guid> deviceIds, INotifyList<IDevice, Guid> devices)
 {
     IEnumerable<IDevice> localDevices = null;
     await Task.Run(() =>
     {
         localDevices = deviceIds.
           AsParallel().AsOrdered().
           Select(did => Device.Create(did, environment, service).Result);
     });
     devices.Add(localDevices);
 }
Exemplo n.º 8
0
        /// <summary>
        /// Listakomponentti.
        /// Liitetään annettuun listaa, tälle tehdyt muutokset päivittyvät annetun listan komponenteille
        /// </summary>
        /// <param name="list"></param>
        public ListWidget(INotifyList <T> list)
            : base(new HorizontalLayout())
        {
            Add(Content = new ScrollableList <O> {
                Color = Color.Transparent
            });
            Add(CreateVerticalScrollPanel());

            Bind(list);

            AddedToGame += AddListeners;
        }
Exemplo n.º 9
0
        public void SetSource(INotifyList <DiagramElement> elements)
        {
            if (_source != null)
            {
                _source.Added   -= OnSourceAdded;
                _source.Removed -= OnSourceRemoved;
                _source.Cleared -= OnSourceCleared;
            }

            ChildItems.Clear();

            _source = elements;

            if (_source == null)
            {
                return;
            }

            _source.Added   += OnSourceAdded;
            _source.Removed += OnSourceRemoved;
            _source.Cleared += OnSourceCleared;

            _source.ForEach(OnSourceAdded);
        }
Exemplo n.º 10
0
        private void editFormula(TableFormula tableFormula)
        {
            _editedFormula = tableFormula ?? CreateTableFormula();
            if (_allPoints != null)
            {
                _allPoints.CollectionChanged -= notifyChange;
            }

            _allPoints = new NotifyList <ValuePointDTO>();
            _editedFormula.AllPoints().Each(p => _allPoints.Add(new ValuePointDTO(_tableParameter, _editedFormula, p)));

            string yName = string.IsNullOrEmpty(_editedFormula.YName) ? _tableParameter.Name : _editedFormula.YName;

            _view.XCaption = Constants.NameWithUnitFor(_editedFormula.XName, _editedFormula.XDisplayUnit);
            _view.YCaption = Constants.NameWithUnitFor(yName, _editedFormula.YDisplayUnit);

            _view.BindTo(_allPoints);

            _allPoints.CollectionChanged += notifyChange;
            if (tableFormula == null)
            {
                ViewChanged();
            }
        }
Exemplo n.º 11
0
 private void rebind()
 {
     _tagsDTO = _entity.Tags.MapAllUsing(_tagMapper).ToRichList();
     _view.BindTo(_tagsDTO);
 }
 protected override void Context()
 {
     base.Context();
     _richList = new NotifyList <IAnInterface>();
     sut.BindToSource(_richList);
 }
Exemplo n.º 13
0
 private void StrategiesPropertyChanged(INotifyList <DiagramElement> elements)
 {
     _strategiesItem.SetSource(elements);
 }
Exemplo n.º 14
0
 private void CompositionsPropertyChanged(INotifyList <DiagramElement> elements)
 {
     _compositionsItem.SetSource(elements);
 }
Exemplo n.º 15
0
 public void Edit(ISimulationSettings simulationSettings)
 {
     _outputSchema = simulationSettings.OutputSchema;
     _allIntervals = new NotifyList <OutputIntervalDTO>(_outputSchema.Intervals.MapAllUsing(_outputIntervalToOutputIntervalDTOMapper));
     _view.BindTo(_allIntervals);
 }
Exemplo n.º 16
0
 /// <summary>
 /// Sitoo olemassaolevan listan tähän näyttöön.
 /// Kun listaa muutetaan, näytetyt arvot päivittyvät automaattisesti.
 /// </summary>
 public void Bind(INotifyList <T> list)
 {
     this.List     = list;
     list.Changed += listChanged;
     Reset();
 }