⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vsnetcollector.cs

📁 UML设计相关的源码。作UML相关开发的不容错过。
💻 CS
📖 第 1 页 / 共 4 页
字号:
				if( delegateData.Element.Count > 0 )
				{
					for( int i = 0 ; i < delegateData.Element.Count ; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) delegateData.Element[i] );
					}
				}

				xmlWriter.WriteEndElement(); // Delegate end
			}

			private void WriteEnumData( XmlTextWriter xmlWriter, EnumData enumData )
			{
				///
				/// Enum Type
				///
				xmlWriter.WriteStartElement( "Enum" );
				xmlWriter.WriteAttributeString( "Name", enumData.Name );
				xmlWriter.WriteAttributeString( "AccessType", enumData.AccessType.ToString() );
				xmlWriter.WriteAttributeString( "Comment", enumData.DocComment );
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", enumData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", enumData.VSObjectReference.ToString() );
					xmlWriter.WriteAttributeString( "ParentNameSpace", enumData.ParentNameSpaceName );
				}
				// Check weather this class contain members
				if( enumData.Element.Count > 0 )
				{
					for( int i = 0; i < enumData.Element.Count; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) enumData.Element[i] );
					}
				}
				xmlWriter.WriteEndElement();
			}

			private void WriteFunctionData( XmlTextWriter xmlWriter, FunctionData functionData )
			{
				///
				/// Function Type
				///
				xmlWriter.WriteStartElement( "Function" );
				xmlWriter.WriteAttributeString( "Name", functionData.Name );
				xmlWriter.WriteAttributeString( "FunctionType", functionData.FunctionType.ToString() );
				xmlWriter.WriteAttributeString( "AccessType", functionData.AccessType.ToString() );
				xmlWriter.WriteAttributeString( "Comment", functionData.DocComment );
				xmlWriter.WriteAttributeString( "CanOverrided", XmlConvert.ToString(functionData.CanOverride ));
				xmlWriter.WriteAttributeString( "IsOverloaded", XmlConvert.ToString(functionData.IsOverloaded ));
				xmlWriter.WriteAttributeString( "IsShared", XmlConvert.ToString(functionData.IsShared ));
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", functionData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", functionData.VSObjectReference.ToString() );
					xmlWriter.WriteAttributeString( "ParentNameSpace", functionData.ParentNameSpaceName );
				}

				// Save the Phototypes data 
				xmlWriter.WriteStartElement( "Phototypes" );
				FunctionData        destination = functionData;
			{
				xmlWriter.WriteAttributeString( "ClassName",destination.PhotoType.className );
				xmlWriter.WriteAttributeString( "fullName",destination.PhotoType.fullName );        
				xmlWriter.WriteAttributeString( "noName",destination.PhotoType.noName );          
				xmlWriter.WriteAttributeString( "paramDefaultValus",destination.PhotoType.paramDefaultValus );
				xmlWriter.WriteAttributeString( "paramNames",destination.PhotoType.paramNames );
				xmlWriter.WriteAttributeString( "paramTypes",destination.PhotoType.paramTypes );
				xmlWriter.WriteAttributeString( "phototypeInitExpression",destination.PhotoType.phototypeInitExpression );
				xmlWriter.WriteAttributeString( "phototypeType",destination.PhotoType.phototypeType );
				xmlWriter.WriteAttributeString( "uniqueSignature",destination.PhotoType.uniqueSignature );
			}
				xmlWriter.WriteEndElement(); // Phototypes end

				// Get the parameter data
				if( functionData.Element.Count > 0 )
				{
					for( int i = 0 ; i < functionData.Element.Count ; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) functionData.Element[i] );
					}
				}

				xmlWriter.WriteEndElement();  // Function end
			}

			private void WriteInterfaceData( XmlTextWriter xmlWriter, InterfaceData interfaceData )
			{
				///
				/// Interface Type
				///
				xmlWriter.WriteStartElement( "Interface" );
				xmlWriter.WriteAttributeString( "Name", interfaceData.Name );
				xmlWriter.WriteAttributeString( "AccessType", interfaceData.AccessType.ToString() );
				xmlWriter.WriteAttributeString( "Comment", interfaceData.DocComment );
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", interfaceData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", interfaceData.VSObjectReference.ToString() );
					xmlWriter.WriteAttributeString( "ParentNameSpace", interfaceData.ParentNameSpaceName );
				}
				// Bulid parent class name to ClassData.BaseList
				if( interfaceData.BaseList.Count > 0 )
				{
					for( int i = 0; i < interfaceData.BaseList.Count; i ++ )
					{
						xmlWriter.WriteAttributeString( "BaseClass", interfaceData.BaseList[i].ToString() );
					}
				}

				// Check weather this class contain members
				if( interfaceData.Element.Count > 0 )
				{
					for( int i = 0; i < interfaceData.Element.Count; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) interfaceData.Element[i] );
					}
				}
				xmlWriter.WriteEndElement();
			}

			private void WriteNameSpaceData( XmlTextWriter xmlWriter, NameSpaceData namespaceData )
			{
				///
				/// Namespace Type
				///
				xmlWriter.WriteStartElement( "Namespace" );
				xmlWriter.WriteAttributeString( "Name", namespaceData.Name );
				xmlWriter.WriteAttributeString( "Comment", namespaceData.DocComment );
			
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", namespaceData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", namespaceData.VSObjectReference.ToString() );
				}	

				// Check if it has elements
				if( namespaceData.Element.Count > 0 )
				{
					for( int i = 0 ; i < namespaceData.Element.Count ; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) namespaceData.Element[i] );
					}
				}

				xmlWriter.WriteEndElement();
			}

			private void WritePropertyData( XmlTextWriter xmlWriter, PropertyData propertyData )
			{
				///
				/// Property Type
				/// 
				xmlWriter.WriteStartElement( "Property" );
				xmlWriter.WriteAttributeString( "Name", propertyData.Name );
				xmlWriter.WriteAttributeString( "AccessType", propertyData.AccessType.ToString() );
				xmlWriter.WriteAttributeString( "Comment", propertyData.DocComment );
			
				// ***************************************************************//
				// I don't know why propertyData.Setter always break out exception
				// ***************************************************************//
				// Change those two function to the members
				// Modify 06/10/2002.
				/*
				try
				{
					WriteElements( xmlWriter, propertyData.Getter );
				}
				catch(Exception e)
				{
				}
				try
				{
					WriteElements( xmlWriter, propertyData.Setter );
				}
				catch(Exception e)
				{
				}
				*/
			
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", propertyData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", propertyData.VSObjectReference.ToString() );
					xmlWriter.WriteAttributeString( "ParentNameSpace", propertyData.ParentNameSpaceName );
				}

				// Save the Phototypes data 
				xmlWriter.WriteStartElement( "Phototypes" );
				PropertyData        destination = propertyData;
			{
				xmlWriter.WriteAttributeString( "ClassName",destination.PhotoType.className );
				xmlWriter.WriteAttributeString( "fullName",destination.PhotoType.fullName );        
				xmlWriter.WriteAttributeString( "noName",destination.PhotoType.noName );          
				xmlWriter.WriteAttributeString( "paramDefaultValus",destination.PhotoType.paramDefaultValus );
				xmlWriter.WriteAttributeString( "paramNames",destination.PhotoType.paramNames );
				xmlWriter.WriteAttributeString( "paramTypes",destination.PhotoType.paramTypes );
				xmlWriter.WriteAttributeString( "phototypeInitExpression",destination.PhotoType.phototypeInitExpression );
				xmlWriter.WriteAttributeString( "phototypeType",destination.PhotoType.phototypeType );
				xmlWriter.WriteAttributeString( "uniqueSignature",destination.PhotoType.uniqueSignature );
			}
				xmlWriter.WriteEndElement();

				// Check if it has elements
				if( propertyData.Element.Count > 0 )
				{
					for( int i = 0 ; i < propertyData.Element.Count ; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) propertyData.Element[i] );
					}
				}

				xmlWriter.WriteEndElement();
			}

			private void WriteStructData( XmlTextWriter xmlWriter, StructData structData )
			{
				///
				/// Struct Type
				///
				xmlWriter.WriteStartElement( "Struct" );
				xmlWriter.WriteAttributeString( "Name", structData.Name );
				xmlWriter.WriteAttributeString( "AccessType", structData.AccessType.ToString() );
				xmlWriter.WriteAttributeString( "Comment", structData.DocComment );
				xmlWriter.WriteAttributeString( "IsAbstract", XmlConvert.ToString(structData.IsAbstract ));
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", structData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", structData.VSObjectReference.ToString() );
					xmlWriter.WriteAttributeString( "ParentNameSpace", structData.ParentNameSpaceName );
				}
				// Bulid parent class name to ClassData.BaseList
				if( structData.BaseList.Count > 0 )
				{
					for( int i = 0; i < structData.BaseList.Count; i ++ )
					{
						xmlWriter.WriteAttributeString( "BaseClass", structData.BaseList[i].ToString() );
					}
				}

				// Check weather this class contain members
				if( structData.Element.Count > 0 )
				{
					for( int i = 0; i < structData.Element.Count; i ++ )
					{
						WriteElements( xmlWriter, (ElementData) structData.Element[i] );
					}
				}
				xmlWriter.WriteEndElement();
			}

			private void WriteVariableData( XmlTextWriter xmlWriter, VariableData variableData )
			{
				///
				/// Variable Data
				/// 
				xmlWriter.WriteStartElement( "Variable" );
				xmlWriter.WriteAttributeString( "Name", variableData.Name );
				xmlWriter.WriteAttributeString( "AccessType", variableData.AccessType.ToString() );
				xmlWriter.WriteAttributeString( "InitExpression", variableData.InitExpression.ToString() );
				xmlWriter.WriteAttributeString( "IsShared", variableData.IsShared.ToString() );
				xmlWriter.WriteAttributeString( "IsConstant", variableData.IsConstant.ToString() );
				xmlWriter.WriteAttributeString( "Comment", variableData.DocComment );
				if( IsWriteObjectInfo == true )
				{
					xmlWriter.WriteAttributeString( "Parent", variableData.Parent.ToString() );
					xmlWriter.WriteAttributeString( "VSObjectReference", variableData.VSObjectReference.ToString() );
				}
				// Save the Phototypes data 
				xmlWriter.WriteStartElement( "Phototypes" );
				VariableData        destination = variableData;
			{
				xmlWriter.WriteAttributeString( "ClassName",destination.PhotoType.className );
				xmlWriter.WriteAttributeString( "fullName",destination.PhotoType.fullName );        
				xmlWriter.WriteAttributeString( "noName",destination.PhotoType.noName );          
				xmlWriter.WriteAttributeString( "paramDefaultValus",destination.PhotoType.paramDefaultValus );
				xmlWriter.WriteAttributeString( "paramNames",destination.PhotoType.paramNames );
				xmlWriter.WriteAttributeString( "paramTypes",destination.PhotoType.paramTypes );
				xmlWriter.WriteAttributeString( "phototypeInitExpression",destination.PhotoType.phototypeInitExpression );
				xmlWriter.WriteAttributeString( "phototypeType",destination.PhotoType.phototypeType );
				xmlWriter.WriteAttributeString( "uniqueSignature",destination.PhotoType.uniqueSignature );
			}
				xmlWriter.WriteEndElement();

				xmlWriter.WriteEndElement();
		
			}

			private void WriteHeader( XmlTextWriter xmlWriter )
			{

			}


			/// <summary>
			/// Code Data collected from solutions
			/// </summary>
			private Data.CodeData codeData;
			public Data.CodeData CodeData
			{
				get
				{
					return codeData;
				}
			}

			/// <summary>
			/// Environment DTE
			/// </summary>
			public _DTE appObject;

			/// <summary>
			/// Used only for output debug info
			/// Describes wheather output the object information to the xml files
			/// </summary>
			public bool IsWriteObjectInfo;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -