Пример #1
0
        public static ScnTrackCollection Parse(string text, string path = null, ScnTrackIncludes includes = ScnTrackIncludes.Before)
        {
            var tracks = new ScnTrackCollection();

            tracks.Source         = text;
            tracks.SourcePath     = path;
            tracks.SourceIncludes = includes;
            tracks.Parse();
            tracks.GetSourceFragments();
            return(tracks);
        }
Пример #2
0
        public static ScnTrackCollection Load()
        {
            var tracks = new ScnTrackCollection();

            ProjectFile.All.ForEach(f => {
                if (f.Type == ProjectFile.Types.SceneryPart || f.Type == ProjectFile.Types.SceneryMain)
                {
                    var set = ScnTrackCollection.Parse(f.Text, f.Path, ScnTrackIncludes.Ignore);
                    if (set.Count > 0)
                    {
                        tracks.AddRange(set);
                    }
                }
            });
            return(tracks);
        }
Пример #3
0
        private void NameTracksMenuItem_Click(object sender, EventArgs e)
        {
            var ed = CurrentEditor;

            if (ed != null && !String.IsNullOrWhiteSpace(ed.Text))
            {
                Status.Text = Messages.ProcessingTracks;
                Application.DoEvents();
                var tracks = ScnTrackCollection.Parse(ed.Text, ed.File.Path);
                if (tracks.Count > 0)
                {
                    tracks.SortAddNames();
                    ed.BeginAutoUndo();
                    ed.Text = tracks.ReplaceText();
                    ed.EndAutoUndo();
                }
                Status.Text = Messages.Ready;
            }
        }