Replaced the old VS templates with ones that offer more flexiblity. Started replacing the Content Project for the samples with our custom project type. Inlcuded a basic not yet working AssimpImporter.
431 lines
13 KiB
C#
431 lines
13 KiB
C#
/* ****************************************************************************
|
|
*
|
|
* Copyright (c) Microsoft Corporation.
|
|
*
|
|
* This source code is subject to terms and conditions of the Apache License, Version 2.0. A
|
|
* copy of the license can be found in the License.html file at the root of this distribution. If
|
|
* you cannot locate the Apache License, Version 2.0, please send an email to
|
|
* vspython@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
|
|
* by the terms of the Apache License, Version 2.0.
|
|
*
|
|
* You must not remove this notice, or any other, from this software.
|
|
*
|
|
* ***************************************************************************/
|
|
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using Microsoft.VisualStudio.Shell.Interop;
|
|
using Microsoft.VisualStudio.Project.Automation;
|
|
|
|
namespace Microsoft.VisualStudio.Project {
|
|
[ComVisible(true)]
|
|
[ClassInterface(ClassInterfaceType.AutoDual)]
|
|
public class CommonProjectNodeProperties : ProjectNodeProperties, IVsCfgBrowseObject, VSLangProj.ProjectProperties {
|
|
private OAProjectConfigurationProperties _activeCfgSettings;
|
|
|
|
public CommonProjectNodeProperties(ProjectNode node)
|
|
: base(node) {
|
|
}
|
|
|
|
#region properties
|
|
/// <summary>
|
|
/// Returns/Sets the StartupFile project property
|
|
/// </summary>
|
|
[SRCategoryAttribute(SR.General)]
|
|
[LocDisplayName(SR.StartupFile)]
|
|
[SRDescriptionAttribute(SR.StartupFileDescription)]
|
|
[Browsable(false)]
|
|
public string StartupFile {
|
|
get {
|
|
var res = Node.ProjectMgr.GetProjectProperty(CommonConstants.StartupFile, true);
|
|
if (!Path.IsPathRooted(res)) {
|
|
res = CommonUtils.GetAbsoluteFilePath(Node.ProjectMgr.ProjectHome, res);
|
|
}
|
|
return res;
|
|
}
|
|
set {
|
|
this.Node.ProjectMgr.SetProjectProperty(CommonConstants.StartupFile, value);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns/Sets the WorkingDirectory project property
|
|
/// </summary>
|
|
[SRCategoryAttribute(SR.General)]
|
|
[LocDisplayName(SR.WorkingDirectory)]
|
|
[SRDescriptionAttribute(SR.WorkingDirectoryDescription)]
|
|
[Browsable(false)]
|
|
public string WorkingDirectory {
|
|
get {
|
|
return this.Node.ProjectMgr.GetProjectProperty(CommonConstants.WorkingDirectory, true);
|
|
}
|
|
set {
|
|
this.Node.ProjectMgr.SetProjectProperty(CommonConstants.WorkingDirectory, value);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns/Sets the PublishUrl project property which is where the project is published to
|
|
/// </summary>
|
|
[Browsable(false)]
|
|
public string PublishUrl {
|
|
get {
|
|
return this.Node.ProjectMgr.GetProjectProperty(CommonConstants.PublishUrl, true);
|
|
}
|
|
set {
|
|
this.Node.ProjectMgr.SetProjectProperty(CommonConstants.PublishUrl, value);
|
|
}
|
|
}
|
|
|
|
//We don't need this property, but still have to provide it, otherwise
|
|
//Add New Item wizard (which seems to be unmanaged) fails.
|
|
[Browsable(false)]
|
|
public string RootNamespace {
|
|
get {
|
|
return "";
|
|
}
|
|
set {
|
|
//Do nothing
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the home directory for the project.
|
|
/// </summary>
|
|
[SRCategoryAttribute(SR.Misc)]
|
|
[LocDisplayName(SR.ProjectHome)]
|
|
[SRDescriptionAttribute(SR.ProjectHomeDescription)]
|
|
[Browsable(false)]
|
|
public string ProjectHome {
|
|
get {
|
|
return Node.ProjectMgr.ProjectHome;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IVsCfgBrowseObject Members
|
|
|
|
int IVsCfgBrowseObject.GetCfg(out IVsCfg ppCfg) {
|
|
return Node.ProjectMgr.ConfigProvider.GetCfgOfName(
|
|
Node.ProjectMgr.CurrentConfig.GetPropertyValue(ProjectFileConstants.Configuration),
|
|
Node.ProjectMgr.CurrentConfig.GetPropertyValue(ProjectFileConstants.Platform),
|
|
out ppCfg);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ProjectProperties Members
|
|
|
|
[Browsable(false)]
|
|
public string AbsoluteProjectDirectory {
|
|
get {
|
|
return Node.ProjectMgr.ProjectFolder;
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.ProjectConfigurationProperties ActiveConfigurationSettings {
|
|
get {
|
|
if (_activeCfgSettings == null) {
|
|
_activeCfgSettings = new OAProjectConfigurationProperties(Node.ProjectMgr);
|
|
}
|
|
return _activeCfgSettings;
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string ActiveFileSharePath {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjWebAccessMethod ActiveWebAccessMethod {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string ApplicationIcon {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string AssemblyKeyContainerName {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string AssemblyName {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string AssemblyOriginatorKeyFile {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjOriginatorKeyMode AssemblyOriginatorKeyMode {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjScriptLanguage DefaultClientScript {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjHTMLPageLayout DefaultHTMLPageLayout {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string DefaultNamespace {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjTargetSchema DefaultTargetSchema {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public bool DelaySign {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public new object ExtenderNames {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string FileSharePath {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public bool LinkRepair {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string LocalPath {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string OfflineURL {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjCompare OptionCompare {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjOptionExplicit OptionExplicit {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjOptionStrict OptionStrict {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string OutputFileName {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjOutputType OutputType {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjProjectType ProjectType {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public virtual string ReferencePath
|
|
{
|
|
get
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public object DesignTimeReferences
|
|
{
|
|
get
|
|
{
|
|
return null;
|
|
}
|
|
set
|
|
{
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string TargetFrameworkMoniker
|
|
{
|
|
get
|
|
{
|
|
return Node.TargetFrameworkMoniker.FullName;
|
|
}
|
|
set
|
|
{
|
|
Node.TargetFrameworkMoniker = new System.Runtime.Versioning.FrameworkName(value);
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string ServerExtensionsVersion {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string StartupObject {
|
|
get {
|
|
return Node.ProjectMgr.GetProjectProperty(CommonConstants.StartupFile);
|
|
}
|
|
set {
|
|
Node.ProjectMgr.SetProjectProperty(CommonConstants.StartupFile, value);
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string URL {
|
|
get { return CommonUtils.MakeUri(Node.ProjectMgr.Url, false, UriKind.Absolute).AbsoluteUri; }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public VSLangProj.prjWebAccessMethod WebAccessMethod {
|
|
get {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
set {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string WebServer {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string WebServerVersion {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public string __id {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public object __project {
|
|
get { throw new System.NotImplementedException(); }
|
|
}
|
|
|
|
[Browsable(false)]
|
|
public object get_Extender(string ExtenderName) {
|
|
throw new System.NotImplementedException();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|