Blame view

Vrh.OneReport/XmlProcessing/PluginElement.cs 3.54 KB
ab9f2fbe   Schwirg László   Add project files.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  using System.Xml.Linq;
  
  using Vrh.XmlProcessing;
  
  namespace Vrh.OneReport
  {
      public class PluginDescriptor : XmlLinqBase
      {
          #region AttributeNames static class
          /// <summary>
          /// Az XML fájlban ilyen attribútum nevek találhatóak egy "Output" elemben.
          /// </summary>
          public static class AttributeNames
          {
              /// <summary>
              /// 'Name' attribútum név a 'Plugin' elemben.
              /// </summary>
              public const string ID = "Id";
  
              /// <summary>
              /// 'Type' attribútum név a 'Plugin' elemben.
              /// </summary>
              public const string TYPE = "Type";
  
              /// <summary>
              /// 'ConnectionString' attribútum név a 'Dataset' elemben.
              /// </summary>
              public const string CONNECTIONSTRING = "ConnectionString";
  
              /// <summary>
              /// 'PluginAssemblyPath' attribútum név.
              /// </summary>
              public const string PLUGINASSEMBLYPATH = "PluginAssemblyPath";
  
              /// <summary>
              /// 'PluginMethodName' attribútum név.
              /// </summary>
              public const string PLUGINMETHODNAME = "PluginMethodName";
  
              /// <summary>
              /// 'PluginTypeFullName' attribútum név.
              /// </summary>
              public const string PLUGINTYPE = "PluginTypeFullName";
  
              /// <summary>
              /// 'PluginTypeFullName' attribútum név.
              /// </summary>
              public const string PLUGINXML = "PluginXml";
          }
          #endregion AttributeNames static class
  
          public PluginDescriptor(XElement xelement)
          {
              if (xelement != null)
              {
                  this.Id = GetValue(xelement.Attribute(AttributeNames.ID), "");
                  this.Type = GetEnumValue(xelement.Attribute(AttributeNames.TYPE), PluginTypes.DataPlugin);
                  this.PluginAssemblyPath = GetValue(xelement.Attribute(AttributeNames.PLUGINASSEMBLYPATH), "");
                  this.PluginMethodName = GetValue(xelement.Attribute(AttributeNames.PLUGINMETHODNAME),"");
                  this.PluginTypeFullName = GetValue(xelement.Attribute(AttributeNames.PLUGINTYPE),"");
                  this.PluginAssemblyXml= GetValue(xelement.Attribute(AttributeNames.PLUGINXML), "");
                  this.ConnectionString = ConnectionStringStore.Get(GetValue(xelement.Attribute(AttributeNames.CONNECTIONSTRING), ""));
              }
          }
          /// <summary>
          /// A plugin  neve
          /// </summary>
          public string Id { get; set; }
  
          /// <summary>
          /// Az adatforrás plugin típusa 
          /// </summary>
          public PluginTypes Type { get; set; }
  
          /// <summary>
          /// Az adatforráshoz tartozó connectionstring
          /// </summary>
          public string ConnectionString { get; set; }
  
          /// <summary>
          /// Plugin típus esetén a megvalósító plugin
          /// </summary>
          public string PluginAssemblyPath { get; set; }
  
          /// <summary>
          /// Plugin típus esetén a típus teljes neve
          /// </summary>
          public string PluginTypeFullName { get; set; }
  
          /// <summary>
          /// Plugin típus esetén az elérendő metódus név
          /// </summary>
          public string PluginMethodName { get; set; }
  
          /// <summary>
          /// Plugin típus esetén a meghívandó metódusnak átadandó xml paraméter struktúrára mutató xml sonnectionstring
          /// </summary>
          public string PluginAssemblyXml { get; set; }
      }
  }