Initial replacement of old repository.

This commit is contained in:
Simon Martens
2021-09-15 13:31:10 +02:00
commit 3125edf027
222 changed files with 582725 additions and 0 deletions

51
HaInformator/Informate.cs Normal file
View 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;
}
}
}
}