Ejemplo n.º 1
0
		void OpenTable(Table table, string name = null)
		{
			var contentType = ContentType.IsTableType() ? ContentType : Parser.ParserType.Columns;
			var textEditor = new TextEditor(bytes: Coder.StringToBytes(table.ToString("\r\n", contentType), Coder.CodePage.UTF8), codePage: Coder.CodePage.UTF8, modified: false);
			textEditor.ContentType = contentType;
			textEditor.DisplayName = name;
			TabsParent.CreateTab(textEditor);
		}
Ejemplo n.º 2
0
		NEVariables GetTableVariables(Table table)
		{
			var results = GetVariables();
			for (var column = 0; column < table.NumColumns; ++column)
			{
				var col = column; // If we don't copy this the value will be updated and invalid
				var header = table.GetHeader(column);
				var colData = default(List<string>);
				var colDataInitialize = new NEVariableListInitializer(() => colData = Enumerable.Range(0, table.NumRows).Select(row => table[row, col]).ToList());
				results.Add(NEVariable.List(header, $"Column {header}", () => colData, colDataInitialize));
			}
			return results;
		}
Ejemplo n.º 3
0
		void SetText(Table table)
		{
			var output = GetTableText(table);
			Replace(new List<Range> { FullRange }, new List<string> { output });
			Selections.Replace(BeginRange);
		}
Ejemplo n.º 4
0
		string GetTableText(Table table)
		{
			if (!ContentType.IsTableType())
				ContentType = Parser.ParserType.Columns;
			return table.ToString(Data.DefaultEnding, ContentType);
		}
Ejemplo n.º 5
0
		void Command_Table_SetJoinSource() => joinTable = GetTable();