internal XmlLuaProjectDocument ToXml(XmlLuaProjectDocument objectToSerialize)
        {
            if (objectToSerialize == null)
            {
                objectToSerialize = new XmlLuaProjectDocument();
            }

            // Serialize project's properties
            _projectProperties.GetUI(this);
            objectToSerialize.ProjectProperties = new XmlLuaProjectProperties(_projectProperties.StartAction,
                                                                              _projectProperties.ExternalProgram,
                                                                              _projectProperties.CommandLineArguments,
                                                                              _projectProperties.RemotePort,
                                                                              _projectProperties.StartupFileName,
                                                                              _projectProperties.WorkingDirectory,
                                                                              _projectProperties.UseRemoteMachine,
                                                                              _projectProperties.RemoteMachineName,
                                                                              _projectProperties.BuildOutputDirectory,
                                                                              _projectProperties.PreBuildEventCmdLine,
                                                                              _projectProperties.PostBuildEventCmdLine,
                                                                              _projectProperties.RunPostBuildEvent);

            base.ToXml(objectToSerialize);

            return(objectToSerialize);
        }
        internal void FromXml(XmlLuaProjectDocument objectToDeserialize)
        {
            base.FromXml(objectToDeserialize);

            // Deserialize project's properties
            if (objectToDeserialize.ProjectProperties != null)
            {
                _historyStack = new HistoryStack();
                _historyStack.CurrentIndexChanged += OnHistoryStackCurrentIndexChanged;
                _projectProperties = new ProjectPropertiesMain(this, _historyStack, objectToDeserialize.ProjectProperties);
            }

            _projectProperties.SetUI(this);
        }