private void OnCapitalChanged(FinanceStatisticGroup <CapitalModel> capitals, bool isSortedByMonth) { ChartVis = Visibility.Visible; Labels.Clear(); ColumnColletcion.Clear(); Summary.ClearSummary(); FillLabels(capitals.GroupDetais, isSortedByMonth); Summary.CreateSummaries(capitals.GroupDetais.Keys.ToArray(), isSortedByMonth); LineSeries line = new LineSeries { Title = capitals.GroupName, DataLabels = true, Stroke = new SolidColorBrush(GlobalVariables.MainColor), LineSmoothness = 0, LabelPoint = point => point.Y.ToString("#0.00"), FontSize = 16, Fill = new SolidColorBrush(Colors.Transparent), Values = new ChartValues <decimal>() }; foreach (decimal amount in capitals.GroupDetais.Values) { line.Values.Add(amount); } ColumnColletcion.Add(line); Summary.AddSummary(capitals.GroupDetais, GlobalVariables.MainColor, capitals.GroupName, capitals.StatisticType); }
private void DebugTimedAdd() { if (!_debugStarted) { _debugLabels = new List <Label>(); foreach (Label l in Labels) { _debugLabels.Add(l); } Labels.Clear(); _debugStarted = true; } int time = (int)debugWatch.ElapsedMilliseconds / 1000; if (time != _debugAddShifter) { _debugAlreadyAdded = false; } if (time % 2 == 0 && !_debugAlreadyAdded) { _debugAlreadyAdded = true; _debugAddShifter = time; var layout1 = TextFont.GetTextLayout("" + time); TextFont.DrawText(layout1, hudWidth * 0.2f - (layout1.Metrics.Width * 0.5f), hudHeight * .15f); Labels.Add(_debugLabels[0]); _debugLabels.RemoveAt(0); } if (_debugLabels.Count == 0) { _debugDone = true; } }
protected override void OnModelPropertyChanged(string propertyName) { if (propertyName == "Presentation") { if (Presentation == Model.Presentation) { return; } Presentation = Model.Presentation; Labels.Clear(); var converter = new GenericLabelConverter(ConversionSteps); var captionModule = Presentation.GetPropertySetFor <Caption>(); foreach (var node in Presentation.Graph.Nodes) { var label = new LabelViewModel(captionModule.Get(node.Id).Label); label.Commited = converter.Convert(label.Original); Labels.Add(label); } RaisePropertyChanged(nameof(Labels)); } }
internal void Reset(FunctionDefinition forFunction = null) { Errors.Clear(); Labels.Clear(); _stack.Clear(); // Global variables are at module level. No reset required here. _currentFunction = forFunction; BuiltinLanguageType[] locals = _currentFunction.Locals; if (null != _currentFunction) { // TODO : Optimize this. This is way to much slow. List <BuiltinLanguageType> types = new List <BuiltinLanguageType>(); foreach (BuiltinLanguageType type in _currentFunction.Signature.EnumerateParameters()) { types.Add(type); } if (null != locals) { types.AddRange(locals); } _localTypes = types.ToArray(); } else { _localTypes = _currentFunction.Locals ?? EmptyBuiltinLanguageType; } }
private void ReadInstructions() { Labels.Clear(); _instructions.Clear(); using (var memory = new MemoryStream(_msilBytes)) using (var reader = new BinaryReader(memory)) while (memory.Length > memory.Position) { var opcodeOffset = (int)memory.Position; var instructionValue = (short)memory.ReadByte(); if (Prefixes.Contains(instructionValue)) { instructionValue = (short)((instructionValue << 8) | memory.ReadByte()); } if (!OpCodeLookup.TryGetValue(instructionValue, out OpCode opcode)) { var msg = $"Unknown opcode {instructionValue:X}"; _log.Error(msg); Debug.Assert(false, msg); continue; } if (opcode.Size != memory.Position - opcodeOffset) { throw new Exception( $"Opcode said it was {opcode.Size} but we read {memory.Position - opcodeOffset}"); } var instruction = new MsilInstruction(opcode) { Offset = opcodeOffset }; _instructions.Add(instruction); instruction.Operand?.Read(this, reader); } }
/// <summary> /// Function Declartion /// </summary> public FunctionDeclaration VisitFunctionDeclaration() { Labels.Clear(); if (TokenType == TokenType.Identifier) { ReadVariableName(out string name); MoveNext(); NodeList <TypeParameter> parameterList; //return type TypeParameter[] parameters = new TypeParameter[0]; if (TokenType == TokenType.LeftParenthesis) { parameters = VisitFunctionParameters().ToArray(); } parameterList = new NodeList <TypeParameter>(parameters); //todo throw if other MoveNextIf(TokenType.RightParenthesis); TypeSyntax returnType = null; if (TokenType == TokenType.Colon) { MoveNext(); returnType = VisitType(); } //todo abstract, virtual functions //To avoid block function BlockStatement body = VisitBlock(); return(new FunctionDeclaration(name, parameterList, returnType, body)); } throw new System.Exception($"Syntax error at line {Source.LineInfo}"); }
public void Clear_Passes() { var labels = new Labels("a", "b", "c"); labels.Clear(); Assert.AreEqual(0, labels.Count); }
public void Clear() { IsLoaded = false; path = ""; Lines.Clear(); Labels.Clear(); }
private void UpdateData(Model.Result result) { if (AddEllipse) { Ellipsies.Add(new Ellipse() { Width = 30, Height = 30 }); Canvas.Children.Add(Ellipsies.Last()); Canvas.SetLeft(Canvas.Children[Canvas.Children.Count - 1], 625); Canvas.SetTop(Canvas.Children[Canvas.Children.Count - 1], 575); Animations.Add(new DoubleAnimationUsingKeyFrames()); AddEllipse = false; } UpdateSeries(HeightSeries, result.Height); UpdateSeries(SpeedSeries, result.Speed); UpdateSeries(AccelerationSeries, result.Acceleration); Labels.Clear(); Labels.AddRange(result.Time.ConvertAll(new Converter <double, string>((double x) => { return(x.ToString()); }))); Ellipsies.Last().Fill = new SolidColorBrush(Chart.Colors[(int)(colorIndex - Chart.Colors.Count * Math.Truncate(colorIndex / (double)Chart.Colors.Count))]); UpdateAnimation = true; DataChanged = true; Times = result.Time; if (DataTab.IsSelected) { UpdateDataTab(); } if (AnimationTab.IsSelected) { SetAnim(); } }
public override async void GetLabels() { if (_gettingLabels) { return; } _gettingLabels = true; Labels.Clear(); Label = null; if (Repository != null && Repository.Repository != null) { try { var labels = await _github.Issue.Labels.GetAllForRepository(Repository.Repository.Owner.Login, Repository.Repository.Name); Labels.Add(_allLabels); foreach (var label in labels.OrderBy(l => l.Name)) { Labels.Add(label); } Label = _allLabels; } catch (Exception exception) { _log.Write(LogLevel.Warn, "Failed to get labels for repository", exception); } } _gettingLabels = false; }
public void UpdateLiveChart(string _Month) { Labels.Clear(); SeriesCollection[0].Values = new ChartValues <int>(); SeriesCollection[1].Values = new ChartValues <int>(); List <Device> dList = DatabaseController.GetDevices(); foreach (Device d in dList) { List <Calamity> cList = d.CalamityCollection .Where(e => e.Date.ToString("MMMM", CultureInfo.InvariantCulture) == _Month && e.Date.Year.ToString() == this.SelectedYear) .ToList(); if (cList.Count() != 0) { Labels.Add(d.Name); SeriesCollection[0].Values.Add(cList.Where(e => e.IsSolved).Count()); SeriesCollection[1].Values.Add(cList.Where(e => !e.IsSolved).Count()); } } OnPropertyChanged("SeriesCollection"); OnPropertyChanged("Labels"); }
private async void OnShowStatExecute() { SeriesCollection.Clear(); Labels.Clear(); foreach (var product in Products) { if (product.ProductTypeId == SelectedProductType.Id) { SeriesCollection.Add(new ColumnSeries { Title = product.Name, Values = new ChartValues <int> { product.StockBalance } }); Labels.Add(product.ProductType.Type); } } Product = Products.FirstOrDefault(s => s.ProductTypeId == SelectedProductType.Id); if (Product != null) { SelectedProductMeasure = Product.ProductMeasure; } else { await MessageDialogService.ShowInfoDialogAsync( "Продуктов указанного типа нет на складе"); } }
public void Init() { Items.Clear(); Labels.Clear(); foreach (var actor in Actors) { foreach (var item in actor.Items) { Items.Add(item); item.Actress = actor; if (item.Labels.Count > 0) { foreach (var label in item.Labels) { if (!Labels.Contains(label)) { Labels.Add(new SrcLabel() { Name = label }); } Labels[label].Items.Add(item); } } } } }
void AxMap1MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e) { Labels labels = MainMap.get_DrawingLabels(0); labels.Clear(); // it's assumed here that the layer we want to edit is the first 1 (with 0 index) int layerHandle = MainMap.get_LayerHandle(0); var sf = MainMap.get_Shapefile(layerHandle); if (sf != null) { double projX = 0.0; double projY = 0.0; MainMap.PixelToProj(e.x, e.y, ref projX, ref projY); object result = null; var ext = new Extents(); ext.SetBounds(projX, projY, 0.0, projX, projY, 0.0); if (sf.SelectShapes(ext, 0.0, SelectMode.INTERSECTION, ref result)) { int[] shapes = result as int[]; if (shapes != null && shapes.Length == 1) { string s = ""; for (int i = 0; i < sf.NumFields; i++) { s += sf.Field[i].Name + ": " + sf.CellValue[i, shapes[0]] + "\n"; } labels.AddLabel(s, e.x + 80, e.y); } } } MainMap.Redraw2(tkRedrawType.RedrawSkipDataLayers); }
private void Button_Click(object sender, RoutedEventArgs e) { var selectedItem = ((ComboBoxItem)reportTypeComboBox.SelectedItem).Content.ToString(); Dictionary <string, decimal> plotData = null; SeriesCollection.Clear(); Labels.Clear(); if (selectedItem == "Sklepy") { plotData = reportController.GetShopSummaryValues(SelectedDateBegin.ToString(), SelectedDateEnd.ToString()); } else if (selectedItem == "Kategorie") { plotData = reportController.GetCategoriesSummaryValues(SelectedDateBegin.ToString(), SelectedDateEnd.ToString()); } foreach (var row in plotData) { SeriesCollection.Add(new ColumnSeries { Title = row.Key, Values = new ChartValues <decimal> { row.Value } }); Labels.Add(row.Key); } //Formatter = value => value.ToString("0.00"); }
public virtual void UpdateLabels(List <string> labels) { Labels.Clear(); foreach (string label in labels) { Labels.Add(label); } }
public void ClearLiveChart() { Labels.Clear(); SeriesCollection[0].Values = null; SeriesCollection[1].Values = null; OnPropertyChanged("SeriesCollection"); OnPropertyChanged("Labels"); }
public void Reset() { Stop(); CPU.Reset(); RAM.Reset(); Lines.Clear(); Labels.Clear(); Load(); }
/// <summary> /// Загрузка ярлыков на текущий рабочий стол /// </summary> public void LoadLabels() { Labels.Clear(); var tmpList = LabelService.GetLabelsRange(DesktopIndex, DesktopService.GetDesktop(DesktopIndex).LabelCount); foreach (LabelModel labelModel in tmpList) { Labels.Add(new LabelViewModel(labelModel, User.Login, User.Font, User.FontSize, User.FontBold, User.FontItalic, User.FontUnderline, User.FontStrikeout, User.FontColor)); } }
private void OnSelectedPageChanged(MainPage mainPage) { if (mainPage == MainPage.Labels) { Labels.Clear(); dataCenter.GetAllLabels().Do(Labels.Add); SelectedLabel = null; } }
public void Destroy() { LOGIN.Destroy(); LOGIN = null; SC.Destroy(); foreach (SubMenus item in OpenButtons) { item.Destroy(); } OpenButtons.Clear(); for (int i = 0; i < Labels.Count; i++) { Labels[i].Delete(); Marshal.ReleaseComObject(Labels[i]); Labels[i] = null; } Labels.Clear(); foreach (Timers item in TIMERS) { item.Destroy(); } TIMERS.Clear(); foreach (Watchers item in WATCHERS) { item.Dispose(); } WATCHERS.Clear(); dlgUsersOnline.Visible = false; dlgUsersOnline.Destroy(); dlgUsersOnline.Dispose(); dlgUsersOnline = null; InternetChecking.Visible = false; InternetChecking.Dispose(); InternetChecking = null; m_ctrlOpenMaps.Delete(); Marshal.ReleaseComObject(m_ctrlOpenMaps); m_ctrlOpenMaps = null; Marshal.ReleaseComObject(m_cmdOpenMaps); m_cmdOpenMaps = null; m_ctrlPublishMap.Delete(); Marshal.ReleaseComObject(m_ctrlPublishMap); m_ctrlPublishMap = null; Marshal.ReleaseComObject(m_cmdPublishMap); m_cmdPublishMap = null; m_ctrlShareMap.Delete(); Marshal.ReleaseComObject(m_ctrlShareMap); m_ctrlShareMap = null; Marshal.ReleaseComObject(m_cmdShareMap); m_cmdShareMap = null; m_ctrlReceiveMap.Delete(); Marshal.ReleaseComObject(m_ctrlReceiveMap); m_ctrlReceiveMap = null; Marshal.ReleaseComObject(m_cmdReceiveMap); m_cmdReceiveMap = null; m_ctrlShareMaps.Delete(); Marshal.ReleaseComObject(m_ctrlShareMaps); m_ctrlShareMaps = null; Marshal.ReleaseComObject(m_cmdShareMaps); m_cmdShareMaps = null; m_rgMaps.Delete(); m_myTab = null; }
private void clearCharts() { try { if (Labels.Count != 0) { Labels.Clear(); SeriesCollection.Clear(); } } catch { } }
/// <summary> /// Clears all the labels. /// </summary> public void ClearLabels() { // lazily create the label array if (Labels == null) { Labels = new List <string>(); } else { Labels.Clear(); } }
private void BasicLineChartNodeModel_PortDisconnected(PortModel port) { // Clear UI when a input port is disconnected if (port.PortType == PortType.Input && this.State == ElementState.Active) { Labels.Clear(); Values.Clear(); Colors.Clear(); RaisePropertyChanged("DataUpdated"); } }
private void MakePlayground() { Labels.Clear(); Buttons.Clear(); GameGrid.Children.Clear(); CreateImage(); StageImage.Source = Game.GetStageImage(); CreateCharacterBtns(); CreateCharacterLbl(); }
protected override void OnDispose() { base.OnDispose(); SelectionMenu = null; Selection = null; PositionProvider = null; SelectedLabel = null; Labels.Clear(); UserChannel = null; SeparationLeftChannel = null; SeparationRightChannel = null; }
private void ClearPlot() { DataSeriesCollection.Clear(); PlotSeriesCollection.Clear(); Labels.Clear(); PlotTitles.Clear(); PlotModel.Title = ""; foreach (var axis in PlotModel.Axes) { axis.Reset(); } }
/// <summary> /// Clears all the labels and data from the chart. /// </summary> /// <returns>A task that represents the asynchronous operation.</returns> public async Task Clear() { dirty = true; Labels.Clear(); Datasets.Clear(); if (initialized) { await JS.Clear(JSRuntime, ElementId); } }
/// <summary> /// Clears all the labels and data from the chart. /// </summary> /// <returns>A task that represents the asynchronous operation.</returns> public async Task Clear() { dirty = true; Labels.Clear(); Datasets.Clear(); if (initialized) { await JSModule.Clear(ElementId); } }
internal void Clear() { Variables.Clear(); Subroutines.Clear(); Labels.Clear(); Includes.Clear(); Imports.Clear(); Map.Clear(); Summary.Clear(); MainName = ""; MainPath = ""; }