Ejemplo n.º 1
0
 private void RandomLines()
 {
     Lines.Clear();
     for (var i = 0; i < Lines.MaxSize / 10; i++)
     {
         Lines.AddLine(new Vector2(UnityEngine.Random.value - 0.5f, UnityEngine.Random.value - 0.5f),
                       new Vector2(UnityEngine.Random.value - 0.5f, UnityEngine.Random.value - 0.5f));
     }
     Lines.UpdateShader();
 }
Ejemplo n.º 2
0
        public void OpenWorkSpace()
        {
            if (DiscardChanges())
            {
                OpenFileDialog open = new OpenFileDialog();
                open.DefaultExt = ".scumle";
                open.Filter     = "(.scumle)|*.scumle";
                List <ModelBase> loadedModelsList = new List <ModelBase>();

                // Show open file dialog box
                bool?result = open.ShowDialog();

                // Process open file dialog box results
                if (result == true)
                {
                    LoadThread loadThread = new LoadThread(Shapes, Lines, Path.GetFullPath(open.FileName));
                    loadThread.Start();
                    Shapes.Clear();
                    Lines.Clear();
                    UndoRedo.clear();
                    UndoRedo.ChangeSinceSave = false;
                    _currentFilePath         = Path.GetFullPath(open.FileName);
                }
            }
        }
        private async Task LoadData(IOutcomeReportServiceProvider provider)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            using (var periodService = provider.GetService())
            {
                var response = await periodService.GetPeriodAsync(new GetPeriodByIdRequest(PeriodViewModelId));

                if (ReferenceEquals(response.Exception, null) == false)
                {
                    Debug.WriteLine(response.Exception);
                }
                else
                {
                    Lines.Clear();
                    foreach (var line in response.Period.Lines)
                    {
                        Lines.Add(line);
                    }
                }
            }

            IsBusy = false;
        }
Ejemplo n.º 4
0
        private void ShowPreview()
        {
            if (drawingService.ListOfStrokes.Count <= 0 || !drawingService.IsCreatingGame)
            {
                return;
            }

            Lines.Clear();
            Index = 0;
            Timer = new Timer();

            if (drawingService.ListOfStrokes.Count <= 10)
            {
                Timer.Interval = 500;
            }
            else if (drawingService.ListOfStrokes.Count <= 100)
            {
                Timer.Interval = 100;
            }
            else
            {
                Timer.Interval = 10;
            }

            Timer.Elapsed += SendStrokeAfterTime;
            Timer.Start();
        }
Ejemplo n.º 5
0
 public void reset()
 {
     for (int i = 0; i < Cols; i++)
     {
         for (int j = 0; j < Rows; j++)
         {
             Grid[i, j].reset();
         }
     }
     Grid = null;
     if (OpenSet != null)
     {
         OpenSet.Clear();
     }
     if (ClosedSet != null)
     {
         ClosedSet.Clear();
     }
     Start = null;
     End   = null;
     Loop  = true;
     if (Path != null)
     {
         Path.Clear();
     }
     if (Lines != null)
     {
         Lines.Clear();
     }
     Window    = null;
     _instance = null;
 }
Ejemplo n.º 6
0
 public void startCalibrating()
 {
     isCalibrated = false;
     Points.Clear();
     Lines.Clear();
     isCalibrating = true;
 }
Ejemplo n.º 7
0
 public void Clear()
 {
     IsLoaded = false;
     path     = "";
     Lines.Clear();
     Labels.Clear();
 }
Ejemplo n.º 8
0
 public void Clear()
 {
     Lines.Clear();
     WrappedLineCount = 0;
     Form.Modify(WidgetName, "replace_inner", "{list}");
     ScrollToStart();
 }
Ejemplo n.º 9
0
        private void GenerateTransformation(string name, string familyName, string type, string subName, Transformation transform, bool Variations, bool log)
        {
            Lines.Clear();
            First = true;

            DestinationFile = $"{type}\\{name}{subName}.cs";
            AddSourceHeader();

            Lines.AppendLine($"using {Namespace};");

            if (!Namespace.Contains("Framework"))
            {
                Lines.AppendLine($"using Mosa.Compiler.Framework;");
                Lines.AppendLine($"using Mosa.Compiler.Framework.Transform;");
            }

            Lines.AppendLine();
            Lines.AppendLine($"namespace {Path}.Transform.Auto.{type}");
            Lines.AppendLine("{");

            GenerateTransformations(name, familyName, type, subName, transform, Variations, log);

            Lines.AppendLine("}");

            Save();
        }
Ejemplo n.º 10
0
        private void ReAnalysis()
        {
            Lines.Clear();

            Lines.FillWithLines(Text);

            var nowPlace = Place.Zero;
            var lexical  = new LuaLexicalAnalysis();

            foreach (var line in Lines)
            {
                var tokens = lexical.Analysis(line.Content);
                if (tokens != null)
                {
                    foreach (var token in tokens)
                    {
                        line.Documents.Add(new DocumentBlock()
                        {
                            Content      = token.Content,
                            StartPlace   = nowPlace,
                            DocumentType = (DocumentTypeEnum)Enum.Parse(typeof(DocumentTypeEnum), token.TokenType),
                        });
                        nowPlace = nowPlace.Offset(0, token.Length);
                    }
                }

                nowPlace = nowPlace.NextLine();
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Finalizes the fragment.
        /// </summary>
        public void Finish()
        {
            Content = string.Join("\n", Lines);
            Content = Content.Reverse();

            Lines.Clear();
        }
Ejemplo n.º 12
0
 public void Clear()
 {
     lock (_linesLock)
     {
         Lines.Clear();
     }
 }
Ejemplo n.º 13
0
            private void UpdateSizeAndLines()
            {
                Lines.Clear();
                if (Text == null || Font == null)
                {
                    Size = new Vec2(0);
                    return;
                }
                double width, height;

                width = height = 0;
                int startIndex = 0;

                for (int i = 0; i < Text.Length; i++)
                {
                    if (Text[i] == '\n' || i == Text.Length - 1)
                    {
                        var text = Text.Substring(startIndex, i - startIndex + (i == Text.Length - 1 ? 1 : 0));
                        Lines.Add(text);
                        var size = Font.MeasureString(text);
                        if (size.X > width)
                        {
                            width = size.X;
                        }
                        height    += size.Y;
                        startIndex = i + 1;
                    }
                }
                Size = new Vec2(width, height);
            }
Ejemplo n.º 14
0
        private void LoadData()
        {
            // Using old? tech
            Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
            openFileDialog.Filter = "UML (*.uml)|*.uml";
            if (openFileDialog.ShowDialog() == true)
            {
                String filename = openFileDialog.FileName;
                // check file exist, etc?

                // Delete any created objs:
                ClassBoxes.Clear();
                Lines.Clear();
                // TODO: empty undoRedo stack

                // https://msdn.microsoft.com/en-us/library/ms973893.aspx
                IFormatter formatter = new BinaryFormatter();
                Stream     stream    = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read);

                LinkedList <Object> data = (LinkedList <Object>)formatter.Deserialize(stream);
                data.ToList().ForEach(serializeShapeData => {
                    ClassBox shape = new ClassBox();
                    shape.LoadSerializedData(serializeShapeData);
                    ClassBoxes.Add(new ClassBoxViewModel(shape));
                });

                stream.Close();
            }
        }
Ejemplo n.º 15
0
 private void LoadData(Chapter chapter)
 {
     if (chapter == null)
     {
         throw new ArgumentNullException("chapter");
     }
     IsLoading      = true;
     Title          = chapter.Title;
     NextChapterId  = chapter.NextChapterId;
     PrevChapterId  = chapter.PrevChapterId;
     ParentVolumeId = chapter.ParentVolumeId;
     ParentSeriesId = chapter.ParentSeriesId;
     ChapterNo      = chapter.ChapterNo;
     Lines.Clear();
     foreach (var line in chapter.Lines)
     {
         if (line == null)
         {
             System.Diagnostics.Debug.WriteLine("null Lines in chapter data");
             continue;
         }
         var lv = LineViewModel.Create(line);
         if (lv != null)
         {
             Lines.Add(lv);
         }
     }
     CurrentLineNo = 1;
 }
Ejemplo n.º 16
0
        public void DrawLines()
        {
            if (Pairs == null)
            {
                return;
            }
            //Clear canvas
            foreach (var l in Lines)
            {
                _overlay.Children.Remove(l);
            }

            foreach (var p in Points)
            {
                _overlay.Children.Remove(p);
            }

            Points.Clear();
            Lines.Clear();
            //Drawing points
            foreach (var p in Pic1Points)
            {
                DrawPoint(p, 0);
            }

            foreach (var p in Pic2Points)
            {
                DrawPoint(p, 800);
            }

            foreach (var p in Pairs)
            {
                DrawLine(p);
            }
        }
Ejemplo n.º 17
0
        public async Task Draw()
        {
            //Clear canvas
            foreach (var l in Lines)
            {
                _overlay.Children.Remove(l);
            }

            foreach (var p in Points)
            {
                _overlay.Children.Remove(p);
            }

            Points.Clear();
            Lines.Clear();
            //Drawing points
            foreach (var p in Pic1Points)
            {
                DrawPoint(p, 0);
            }

            foreach (var p in Pic2Points)
            {
                DrawPoint(p, 800);
            }


            Thread t = new Thread(FindPairs);

            t.SetApartmentState(ApartmentState.STA);

            t.Start();
            //            DrawLines();
        }
Ejemplo n.º 18
0
        public void Load()
        {
            var             command = DataStore.Connection.CreateCommand();
            SqlCeDataReader reader  = null;

            command.CommandText = "SELECT [text] FROM [pad] ORDER BY [id]";

            Lines.Clear();

            reader = command.ExecuteReader();

            while (reader.Read())
            {
                Lines.Add(new Line {
                    Text = reader.GetString(0)
                });
            }

            if (Lines.Count == 0 || Lines.Last().Text != "")
            {
                Lines.Add(new Line {
                    Text = ""
                });
            }

            reader.Dispose();
            command.Dispose();
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Replaces existing <see cref="Lines"/> with the specified <see cref="ImageMarkerLine"/>s.
        /// </summary>
        /// <param name="lines">The new <see cref="ImageMarkerLine"/>s</param>
        public void UpdateLines(List <ImageMarkerLine> lines)
        {
            if (Lines.Count > 0)
            {
                ImageMarkerLine[] tempLines = new ImageMarkerLine[Lines.Count];
                Lines.CopyTo(tempLines);
                Lines.Clear();

                foreach (ImageMarkerLine imageMarkerLine in tempLines)
                {
                    Rectangle rectangle = GetImageMarkerLineRectangle(imageMarkerLine);
                    rectangle.Inflate(1, 1);
                    Invalidate(rectangle);
                }
            }

            if (lines.Count > 0)
            {
                Lines.AddRange(lines);

                foreach (ImageMarkerLine imageMarkerLine in Lines)
                {
                    Rectangle rectangle = GetImageMarkerLineRectangle(imageMarkerLine);
                    rectangle.Inflate(1, 1);
                    Invalidate(rectangle);
                }
            }
        }
Ejemplo n.º 20
0
 public void Condense(string newline)
 {
     if (Lines.Count > 0)
     {
         Lines.Clear();
         Lines.Add(newline);
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Creates directly from a set of lines by extracting them from the set provided.
        /// </summary>
        /// <param name="NewLines">The line set.</param>
        public void CreateDirect(C2DLineBaseSet NewLines)
        {
            Lines.Clear();
            Lines.ExtractAllOf(NewLines);

            this.MakeLineRects();
            this.MakeBoundingRect();
        }
Ejemplo n.º 22
0
 public void Dispose()
 {
     Lines.Clear();
     TimeLines.Values.ToList().ForEach(line => line.Dispose());
     TimeLines.Clear();
     Averager.Dispose();
     LineMaker.Dispose();
 }
Ejemplo n.º 23
0
 public void Exit()
 {
     task = null;
     Lines.Clear();
     ((patch_OuiMainMenu)Overworld.GetUI <OuiMainMenu>())?.RebuildMainAndTitle();
     Audio.Play(SFX.ui_main_button_back);
     Overworld.Goto <OuiModOptions>();
 }
Ejemplo n.º 24
0
 public void Clear()
 {
     Lines.Clear();
     Lines.Add(new HexBoardLine {
         Address = 0
     });
     OnPropertyChanged("Size");
 }
Ejemplo n.º 25
0
 private void CreateLines()
 {
     Lines.Clear();
     for (int i = 1; i < calculatedPoints.Count; i++)
     {
         Lines.Add(new Line(calculatedPoints[i - 1].X, calculatedPoints[i - 1].Y, calculatedPoints[i].X, calculatedPoints[i].Y, thickness, ObjectColor));
     }
 }
Ejemplo n.º 26
0
        public void UnsetData()
        {
            IsSet = false;

            Name = "";
            Tags.Clear();
            Lines.Clear();
        }
Ejemplo n.º 27
0
 public void ClearLines()
 {
     TimeLines.Values.ToList().ForEach(line => line.Clear());
     TimeLines.Clear();
     Averager.Clear();
     LineMaker.Clear();
     Lines.Clear();
 }
Ejemplo n.º 28
0
 public void UpdateLines(List <Line> list)
 {
     Lines.Clear();
     foreach (var item in list)
     {
         Lines.Add(item.Number);
     }
 }
Ejemplo n.º 29
0
 public void Clear()
 {
     Points.Clear();
     Lines.Clear();
     Arcs.Clear();
     Circles.Clear();
     Paths.Clear();
 }
Ejemplo n.º 30
0
        public void Import(string fileName)
        {
            int lineHeader = 0;

            Sample2 sample2Layout = new Sample2();

            ImportFile = new ImportFile(sample2Layout);
            if (ImportFile.PrepareFile(fileName))
            {
                Lines.Clear();

                while (ImportFile.ReadLine() && !ImportFile.ReadFailure)
                {
                    Lines.Append(ImportFile.Line + Environment.NewLine);

                    //The Sample2 line Identifier is encountered in column 1
                    //Delimited layout should always mark the column identifier
                    ImportFile.SetIdentificadorCorrente(ImportFile.CurrentLine["Col_1"].ToString());

                    switch ((Sample2.RecordType) int.Parse(ImportFile.CurrentIdentifier))
                    {
                    case Sample2.RecordType.Header:

                        lineHeader = ImportFile.CurrentLineNumber;
                        sample2Layout.HeaderRows.Add(new Sample2.HeaderRow(ImportFile.CurrentLine));
                        sample2Layout.HeaderRows.Last().LineNumber = ImportFile.CurrentLineNumber;
                        break;

                    case Sample2.RecordType.Detail:

                        sample2Layout.DetailRows.Add(new Sample2.DetailRow(ImportFile.CurrentLine));
                        sample2Layout.DetailRows.Last().LineNumber       = ImportFile.CurrentLineNumber;
                        sample2Layout.DetailRows.Last().ParentLineNumber = lineHeader;
                        break;

                    case Sample2.RecordType.Trailer:
                        sample2Layout.TrailerRows.Add(new Sample2.TrailerRow(ImportFile.CurrentLine));
                        sample2Layout.TrailerRows.Last().LineNumber       = ImportFile.CurrentLineNumber;
                        sample2Layout.TrailerRows.Last().ParentLineNumber = lineHeader;
                        break;
                    }

                    if (this.ImportOnlyFirstLine)
                    {
                        break;
                    }
                }

                if (ImportFile.Error)
                {
                    AddLineError("INTERNAL", ImportFile.ErrorDescription, ImportFile.CurrentLineNumber);
                }
            }
            else
            {
                AddLineError("INTERNAL", ImportFile.ErrorDescription, ImportFile.CurrentLineNumber);
            }
        }