protected NodeResultReader()
		{
			this._msSqlAuditor   = null;
			this._storageManager = null;

			this.GroupDefinition = null;
			this.TemplateNode    = null;
			this.Settings        = null;
		}
		private frmUserSettingsNode()
		{
			this._model               = null;
			this._node                = null;
			this._nodeDefinition      = null;
			this._template            = null;
			this._userSettingsManager = null;

			InitializeComponent();
		}
		public frmUserSettingsNode(MsSqlAuditorModel model, TreeNode node) : this()
		{
			if (node == null)
			{
				throw new ArgumentNullException("node");
			}

			this._node           = node;
			this._nodeDefinition = node.Tag as ConcreteTemplateNodeDefinition;

			if (this._nodeDefinition == null)
			{
				throw new ArgumentException("Template is not specified for the node.");
			}

			this._model               = model;
			this._template            = GetUserSettings();
			this._userSettingsManager = new UserSettingsManager(
				this._model.Settings.InterfaceLanguage
			);
		}
		protected NodeResultReader(
			MsSqlAuditorModel              msSqlAuditor,
			StorageManager                 storageManager,
			ConcreteTemplateNodeDefinition concreteTemplateNode
		) : this()
		{
			this._msSqlAuditor   = msSqlAuditor;
			this._storageManager = storageManager;

			if (concreteTemplateNode != null)
			{
				this.GroupDefinition = concreteTemplateNode.Group;
				this.TemplateNode    = concreteTemplateNode.TemplateNode;

				if (msSqlAuditor != null && msSqlAuditor.TemplateSettings != null && concreteTemplateNode.Connection != null)
				{
					this.Settings = msSqlAuditor.TemplateSettings.UserSettings.FirstOrDefault(
						i => i.TemplateName == concreteTemplateNode.Connection.TemplateFileName
							&& i.Connection.ParentKey == TemplateNode.IdsHierarchy
					);
				}
			}
		}
		public void ReadParametersFrom(InstanceTemplate settings)
		{
			if (settings != null)
			{
				var querySettings = settings.Connection.Activity.Parameters
					.Where(i => i.Key == IdsHierarchy && i.Type == ParameterInfoType.Parameter && i.Value != null);

				foreach (var parameterInfo in querySettings)
				{
					var parameter = ParameterValues.FirstOrDefault(p => p.Name == parameterInfo.Parameter);

					if (parameter != null)
					{
						parameter.UserValue = parameterInfo.Value;
					}
				}
			}
		}
		private InstanceTemplate GetUserSettings(bool createIfNotExists = false)
		{
			var existing = Program.Model.TemplateSettings.UserSettings.FirstOrDefault(
				i => i.TemplateName == ConnectionGroup.TemplateFileName
					&& i.Connection.ParentKey == IdsHierarchy
			);

			if (existing == null && createIfNotExists)
			{
				existing = new InstanceTemplate
				{
					TemplateName = ConnectionGroup.TemplateFileName,
					Connection = {ParentKey = IdsHierarchy}
				};

				Program.Model.TemplateSettings.UserSettings.Add(existing);
			}

			return existing;
		}