protected override void AddCommandXElementParameters(Command command)
 {
     if (command.Type != ECommandTypes.Unsupported) return;
     var unsupportedCommand = (UnsupportedCommand)command;
     if (unsupportedCommand.Value != null)
         CommandXElement.Add(new XAttribute("command", unsupportedCommand.Value));
 }
 protected XElement FindCommandNode(Command command)
 {
     foreach (XElement _command_node in LogFile.Root.Elements())
     {
         if (_command_node.Name.LocalName.
             Equals(command.Type.ToString(), StringComparison.OrdinalIgnoreCase)) return (_command_node);
     }
     var newCommandNode = new XElement(command.Type.ToString());
     LogFile.Root.Add(newCommandNode);
     return (newCommandNode);
 }
        protected void CreateCommandXElement(Command command)
        {
            if (File.Exists(LogFilePath)) OpenLogFile();
            else CreateNewLogFile();

            CommandNodeXElement = FindCommandNode(command);
            CommandXElement = new XElement(command.Name,
                            new XAttribute("invoked", DateTime.Now.ToString(CultureInfo.CurrentCulture)),
                            new XAttribute("user", Program.User));
            AddCommandXElementParameters(command);
            CommandNodeXElement.Add(CommandXElement);
        }
 public override void SaveToFile(Command command)
 {
     CreateCommandXElement(command);
     SaveLogFile();
 }
 protected override void AddCommandXElementParameters(Command command)
 {
     if (command.Parameters == null || command.Parameters.Length <= 0) return;
     CommandXElement.Add(new XAttribute("changed_to", command.Parameters[0]));
 }
 protected virtual void AddCommandXElementParameters(Command command)
 {
 }
 public virtual void SaveToFile(Command command)
 {
     CreateCommandXElement(command);
     SaveLogFile();
 }