コード例 #1
0
        /// <summary>
        /// Sets a project property. StaDyn projects properties are stored in the XML ".sdproj" file as "Property" elements.
        /// </summary>
        /// <param name="key">Name of the property.</param>
        /// <param name="value">Value of the property</param>
        public void SetProperty(string key, string value)
        {
            StaDynProjectNode projectNode = GetActiveProjectNode();

            if (projectNode == null)
            {
                throw new InvalidOperationException("Current project is not a StaDyn project");
            }
            projectNode.ProjectMgr.SetProjectProperty(key, value);
        }
コード例 #2
0
        /// <summary>
        /// Gets a project property. StaDyn projects properties are stored in the XML ".sdproj" file as "Property" elements.
        /// </summary>
        /// <param name="key">Name of the property.</param>
        /// <returns>Value of the property</returns>
        public string GetProperty(string key)
        {
            StaDynProjectNode projectNode = GetActiveProjectNode();

            if (projectNode == null)
            {
                return(null);
            }
            //throw new InvalidOperationException("Current project is not a StaDyn project");
            return(projectNode.ProjectMgr.GetProjectProperty(key));
        }