mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 01:35:32 +00:00
Initial replacement of old repository.
This commit is contained in:
51
HaInformator/Informate.cs
Normal file
51
HaInformator/Informate.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace HaInformator
|
||||
{
|
||||
public class Informate : HaControl
|
||||
{
|
||||
private ElementSelection _elementSelection;
|
||||
private AttrValSelection _attrValSelection;
|
||||
private ContextMenuSelection _cMenuSelection;
|
||||
private XDocument _doc;
|
||||
|
||||
public Informate(Logger logger,
|
||||
TreeView tView,
|
||||
ListBox lView,
|
||||
ListBox attrLView,
|
||||
ListBox valLView,
|
||||
GroupBox gbox,
|
||||
ContextMenuStrip cMenu)
|
||||
{
|
||||
this.Description = "Tool zur Darstellung aller Nodes, ihrer Attribute und Werte";
|
||||
_cMenuSelection = new ContextMenuSelection(cMenu);
|
||||
_attrValSelection = new AttrValSelection(attrLView, valLView, gbox, _cMenuSelection);
|
||||
_elementSelection = new ElementSelection(tView, lView, _attrValSelection, _cMenuSelection);
|
||||
}
|
||||
|
||||
public override HaControlResult Act(string filepath)
|
||||
{
|
||||
try
|
||||
{
|
||||
_doc = XDocument.Load(filepath, LoadOptions.PreserveWhitespace);
|
||||
_elementSelection.Load(new Tree(_doc));
|
||||
return HaControlResult.OK;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log(e.Message);
|
||||
return HaControlResult.Error;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user