示例#1
0
        public ProjectProperty <T> GetProperty <T>(string propertyName, T defaultValue,
                                                   PropertyStorageLocations defaultLocation = PropertyStorageLocations.Base)
        {
            ILoadSaveCallback existingProperty;

            if (projectProperties.TryGetValue(propertyName, out existingProperty))
            {
                return((ProjectProperty <T>)existingProperty);
            }

            ProjectProperty <T> newProperty = new ProjectProperty <T>(this, propertyName, defaultValue, defaultLocation, true);

            projectProperties.Add(propertyName, newProperty);
            if (isLoaded)
            {
                newProperty.Load(project, activeConfiguration, activePlatform);
            }
            return(newProperty);
        }
示例#2
0
        public ProjectProperty <string> GetProperty(string propertyName, string defaultValue,
                                                    TextBoxEditMode textBoxEditMode          = TextBoxEditMode.EditEvaluatedProperty,
                                                    PropertyStorageLocations defaultLocation = PropertyStorageLocations.Base)
        {
            ILoadSaveCallback existingProperty;

            if (projectProperties.TryGetValue(propertyName, out existingProperty))
            {
                return((ProjectProperty <string>)existingProperty);
            }

            bool treatAsLiteral = (textBoxEditMode == TextBoxEditMode.EditEvaluatedProperty);
            ProjectProperty <string> newProperty = new ProjectProperty <string>(this, propertyName, defaultValue, defaultLocation, treatAsLiteral);

            projectProperties.Add(propertyName, newProperty);
            if (isLoaded)
            {
                newProperty.Load(project, activeConfiguration, activePlatform);
            }
            return(newProperty);
        }