private void Initialize()
 {
     _historyStack = new HistoryStack();
     _historyStack.CurrentIndexChanged += OnHistoryStackCurrentIndexChanged;
     _projectProperties = new ProjectPropertiesMain(this, _historyStack);
     _projectProperties.SetUI(this);
 }
示例#2
0
        public void SetDataFromUI(object destination)
        {
            ILuaEditDocumentProject luaPrj = destination as ILuaEditDocumentProject;

            if (luaPrj != null)
            {
                ILuaEditProjectProperties luaPrjProps = luaPrj.ProjectProperties;

                if (luaPrjProps != null)
                {
                    if (cboStartupFile.SelectedIndex == 0)
                    {
                        luaPrjProps.StartupFileName = string.Empty;
                    }
                    else if (cboStartupFile.SelectedIndex > 0)
                    {
                        luaPrjProps.StartupFileName = Win32Utils.GetRelativePath((cboStartupFile.Items[cboStartupFile.SelectedIndex] as ILuaEditDocumentEditable).FileName, Path.GetDirectoryName(_prjDoc.FileName));
                    }

                    luaPrjProps.StartAction          = radStartProject.Checked ? DebugStartAction.StartProject : DebugStartAction.StartExternalProgram;
                    luaPrjProps.UseRemoteMachine     = chkRemoteMachine.Checked;
                    luaPrjProps.RemoteMachineName    = txtRemoteMachine.Text;
                    luaPrjProps.RemotePort           = Convert.ToInt32(nudPort.Value);
                    luaPrjProps.WorkingDirectory     = txtWorkingDir.Text;
                    luaPrjProps.ExternalProgram      = txtExternalProgram.Text;
                    luaPrjProps.CommandLineArguments = txtCmdLineArgs.Text;
                }
            }
        }
        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);
        }
示例#4
0
        public void SetDataFromUI(object destination)
        {
            ILuaEditDocumentProject luaPrj = destination as ILuaEditDocumentProject;

            if (luaPrj != null)
            {
                ILuaEditProjectProperties luaPrjProps = luaPrj.ProjectProperties;

                if (luaPrjProps != null)
                {
                    luaPrjProps.PreBuildEventCmdLine  = txtPreBuildEventCmdLine.Text;
                    luaPrjProps.PostBuildEventCmdLine = txtPostBuildEventCmdLine.Text;
                    luaPrjProps.RunPostBuildEvent     = (PostBuildRunType)cboRunPostBuildEvent.SelectedIndex;
                }
            }
        }
示例#5
0
        public void SetUIFromData(object source)
        {
            try
            {
                _isUpdatingUIFromData = true;
                ILuaEditDocumentProject luaPrj = source as ILuaEditDocumentProject;

                if (luaPrj != null)
                {
                    ILuaEditProjectProperties       luaPrjProps = luaPrj.ProjectProperties;
                    List <ILuaEditDocumentEditable> docList     = new List <ILuaEditDocumentEditable>();
                    GetEditableFilesFromPrjRecursive(luaPrj, docList);

                    cboStartupFile.Items.Clear();
                    int startupFileSelIndex = cboStartupFile.Items.Add("Currently Selected File");

                    foreach (ILuaEditDocumentEditable doc in docList)
                    {
                        int    index           = cboStartupFile.Items.Add(doc);
                        string relativeDocPath = Win32Utils.GetRelativePath(doc.FileName, Path.GetDirectoryName(_prjDoc.FileName));

                        if (luaPrjProps != null && luaPrjProps.StartupFileName == relativeDocPath)
                        {
                            startupFileSelIndex = index;
                        }
                    }

                    cboStartupFile.SelectedIndex = startupFileSelIndex;

                    if (luaPrjProps != null)
                    {
                        radStartProject.Checked         = luaPrjProps.StartAction == DebugStartAction.StartProject;
                        radStartExternalProgram.Checked = luaPrjProps.StartAction == DebugStartAction.StartExternalProgram;
                        txtExternalProgram.Text         = luaPrjProps.ExternalProgram;
                        txtCmdLineArgs.Text             = luaPrjProps.CommandLineArguments;
                        chkRemoteMachine.Checked        = luaPrjProps.UseRemoteMachine;
                        txtRemoteMachine.Text           = luaPrjProps.RemoteMachineName;
                        nudPort.Value      = luaPrjProps.RemotePort;
                        txtWorkingDir.Text = luaPrjProps.WorkingDirectory;
                    }
                }
            }
            finally
            {
                _isUpdatingUIFromData = false;
            }
        }
示例#6
0
        public void SetUIFromData(object source)
        {
            ILuaEditDocumentProject luaPrj = source as ILuaEditDocumentProject;

            if (luaPrj != null)
            {
                try
                {
                    _isUpdatingUIFromData = true;
                    ILuaEditProjectProperties luaPrjProps = luaPrj.ProjectProperties;

                    if (luaPrjProps != null)
                    {
                        txtOutputDir.Text = luaPrjProps.BuildOutputDirectory;
                    }
                }
                finally
                {
                    _isUpdatingUIFromData = false;
                }
            }
        }
示例#7
0
        public void SetDataFromUI(object destination)
        {
            ILuaEditDocumentProject luaPrj = destination as ILuaEditDocumentProject;

            if (luaPrj != null)
            {
                try
                {
                    _isUpdatingUIFromData = true;
                    ILuaEditProjectProperties luaPrjProps = luaPrj.ProjectProperties;

                    if (luaPrjProps != null)
                    {
                        luaPrjProps.BuildOutputDirectory = txtOutputDir.Text;
                    }
                }
                finally
                {
                    _isUpdatingUIFromData = false;
                }
            }
        }
示例#8
0
        public void SetUIFromData(object source)
        {
            try
            {
                _isUpdatingUIFromData = true;
                ILuaEditDocumentProject luaPrj = source as ILuaEditDocumentProject;

                if (luaPrj != null)
                {
                    ILuaEditProjectProperties luaPrjProps = luaPrj.ProjectProperties;

                    if (luaPrjProps != null)
                    {
                        txtPreBuildEventCmdLine.Text       = luaPrjProps.PreBuildEventCmdLine;
                        txtPostBuildEventCmdLine.Text      = luaPrjProps.PostBuildEventCmdLine;
                        cboRunPostBuildEvent.SelectedIndex = (int)luaPrjProps.RunPostBuildEvent;
                    }
                }
            }
            finally
            {
                _isUpdatingUIFromData = false;
            }
        }
 public ProjectPropertiesMain(ILuaEditDocumentProject parentDoc, HistoryStack prjHistoryStack, ILuaEditProjectProperties copy)
     : this(parentDoc, prjHistoryStack)
 {
     if (copy != null)
     {
         this.BuildOutputDirectory  = copy.BuildOutputDirectory;
         this.CommandLineArguments  = copy.CommandLineArguments;
         this.ExternalProgram       = copy.ExternalProgram;
         this.PostBuildEventCmdLine = copy.PostBuildEventCmdLine;
         this.PreBuildEventCmdLine  = copy.PreBuildEventCmdLine;
         this.RemoteMachineName     = copy.RemoteMachineName;
         this.RemotePort            = copy.RemotePort;
         this.RunPostBuildEvent     = copy.RunPostBuildEvent;
         this.StartAction           = copy.StartAction;
         this.StartupFileName       = copy.StartupFileName;
         this.UseRemoteMachine      = copy.UseRemoteMachine;
         this.WorkingDirectory      = copy.WorkingDirectory;
     }
 }