コード例 #1
0
        public static XElement GetXmlDefinition(this VsItemType itemType, string includePath, bool isprojFile)
        {
            switch (itemType)
            {
            case VsItemType.Compiled:
                return(GetCompileXElement(includePath, false));

            case VsItemType.CompiledWithDependant:
                return(GetCompileXElement(includePath, true));

            case VsItemType.XamlPage:
                return(GetXamlPageXElement(includePath, isprojFile));

            case VsItemType.Resource:
                return(GetResourceXElement(includePath));

            case VsItemType.Content:
                return(GetContentXElement(includePath));

            case VsItemType.None:
                return(GetNoneXElement(includePath));

            default:
                return(null);
            }
        }
コード例 #2
0
 public VsItem(string name, string path, VsItemType type, bool exists = true)
 {
     Name         = name;
     Path         = path;
     Type         = type;
     Dependencies = new List <FilePath>();
     DependencyOf = new List <FilePath>();
     Exists       = exists;
 }
コード例 #3
0
        private VsItemType GetItemType(string fileName)
        {
            VsItemType returnType = VsItemType.Content;

            switch (Path.GetExtension(fileName).ToLowerInvariant())
            {
            case ".cs":
                if (fileName.EndsWith(".xaml.cs", StringComparison.OrdinalIgnoreCase))
                {
                    returnType = VsItemType.CompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.Compiled;
                }

                break;

            case ".vb":
                if (fileName.EndsWith(".xaml.vb", StringComparison.OrdinalIgnoreCase))
                {
                    returnType = VsItemType.CompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.Compiled;
                }

                break;

            case ".xaml":
                returnType = VsItemType.XamlPage;
                break;

            case ".resw":
                returnType = VsItemType.Resource;
                break;

            case ".pfx":
                returnType = VsItemType.None;
                break;

            default:
                returnType = VsItemType.Content;
                break;
            }

            return(returnType);
        }
コード例 #4
0
        private VsItemType GetItemType(string fileName)
        {
            VsItemType returnType = VsItemType.Content;

            switch (Path.GetExtension(fileName).ToLower())
            {
            case ".cs":
                if (fileName.EndsWith(".xaml.cs", true, CultureInfo.InvariantCulture))
                {
                    returnType = VsItemType.CompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.Compiled;
                }
                break;

            case ".vb":
                if (fileName.EndsWith(".xaml.vb", true, CultureInfo.InvariantCulture))
                {
                    returnType = VsItemType.CompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.Compiled;
                }
                break;

            case ".xaml":
                returnType = VsItemType.XamlPage;
                break;

            case ".resw":
                returnType = VsItemType.Resource;
                break;

            default:
                returnType = VsItemType.Content;
                break;
            }

            return(returnType);
        }
コード例 #5
0
        private VsItemType GetItemType(string fileName)
        {
            VsItemType returnType = VsItemType.Content;

            switch (Path.GetExtension(fileName).ToUpperInvariant())
            {
            case ".CS":
                if (fileName.EndsWith(".xaml.cs", StringComparison.OrdinalIgnoreCase))
                {
                    returnType = VsItemType.CompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.Compiled;
                }

                break;

            case ".IDL":
                returnType = VsItemType.Midl;

                break;

            case ".H":
                if (fileName.EndsWith(".xaml.h", StringComparison.OrdinalIgnoreCase))
                {
                    returnType = VsItemType.ClIncludeWithDependant;
                }
                else
                {
                    returnType = VsItemType.ClInclude;
                }

                break;

            case ".CPP":
                if (fileName.EndsWith(".xaml.cpp", StringComparison.OrdinalIgnoreCase))
                {
                    returnType = VsItemType.ClCompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.ClCompiled;
                }

                break;

            case ".VB":
                if (fileName.EndsWith(".xaml.vb", StringComparison.OrdinalIgnoreCase))
                {
                    returnType = VsItemType.CompiledWithDependant;
                }
                else
                {
                    returnType = VsItemType.Compiled;
                }

                break;

            case ".XAML":
                returnType = VsItemType.XamlPage;
                break;

            case ".RESW":
                returnType = VsItemType.Resource;
                break;

            case ".PFX":
                returnType = VsItemType.None;
                break;

            default:
                returnType = VsItemType.Content;
                break;
            }

            return(returnType);
        }
コード例 #6
0
		public VsProjectItem(VsItemType pItemType) {
			_itemType = pItemType;
		}
コード例 #7
0
ファイル: VsProject.cs プロジェクト: gamificationvn/cstoas3
		private static VsProjectItem readItem(XmlReader pXmlReader, VsItemType pItemType) {
			VsProjectItem item = new VsProjectItem(pItemType) {Item = pXmlReader["Include"]};
			
			if (false == pXmlReader.IsEmptyElement) {
				pXmlReader.Read();
				
				while (true) {
					if (pXmlReader.NodeType == XmlNodeType.EndElement) {
						break;
					}
					
					readItemProperty(item, pXmlReader);
				}
			}
			
			pXmlReader.Read();
			return item;
		}
コード例 #8
0
ファイル: VsProject.cs プロジェクト: gamificationvn/cstoas3
		/// <summary>
		/// 	Gets the List of VSProjectItem single type items.
		/// </summary>
		/// <param name = "pGetItemType">Type of the item.</param>
		/// <returns>List of items of specific itemType.</returns>
		public IList<VsProjectItem> GetSingleTypeItems(VsItemType pGetItemType) {
			return Items.Where(pItem => pItem.ItemType == pGetItemType).ToList();
		}