当前位置: 首页>>代码示例>>C#>>正文


C# IEntity.ToString方法代码示例

本文整理汇总了C#中IEntity.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IEntity.ToString方法的具体用法?C# IEntity.ToString怎么用?C# IEntity.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEntity的用法示例。


在下文中一共展示了IEntity.ToString方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMemberText

		static string GetMemberText(IAmbience ambience, IEntity member)
		{
			StringBuilder text = new StringBuilder();
			if (member is IField) {
				text.Append(ambience.Convert(member as IField));
			} else if (member is IProperty) {
				text.Append(ambience.Convert(member as IProperty));
			} else if (member is IEvent) {
				text.Append(ambience.Convert(member as IEvent));
			} else if (member is IMethod) {
				text.Append(ambience.Convert(member as IMethod));
			} else if (member is IClass) {
				text.Append(ambience.Convert(member as IClass));
			} else {
				text.Append("unknown member ");
				text.Append(member.ToString());
			}
			string documentation = member.Documentation;
			if (documentation != null && documentation.Length > 0) {
				text.Append('\n');
				text.Append(CodeCompletionData.XmlDocumentationToText(documentation));
			}
			return text.ToString();
		}
开发者ID:pusp,项目名称:o2platform,代码行数:24,代码来源:ToolTipProvider.cs

示例2: Convert

		public virtual string Convert(IEntity entity)
		{
			if (entity == null)
				throw new ArgumentNullException("entity");
			IClass c = entity as IClass;
			if (c != null)
				return Convert(c);
			IMethod m = entity as IMethod;
			if (m != null)
				return Convert(m);
			IField f = entity as IField;
			if (f != null)
				return Convert(f);
			IProperty p = entity as IProperty;
			if (p != null)
				return Convert(p);
			IEvent e = entity as IEvent;
			if (e != null)
				return Convert(e);
			return entity.ToString();
		}
开发者ID:pusp,项目名称:o2platform,代码行数:21,代码来源:Ambience.cs

示例3: GetText

 /// <summary>
 /// Converts a member to text.
 /// Returns the declaration of the member as C# or VB code, e.g.
 /// "public void MemberName(string parameter)"
 /// </summary>
 private static string GetText(IEntity entity)
 {
     IAmbience ambience = MainForm.IsVisualBasic ? (IAmbience)vbAmbience : csharpAmbience;
     if (entity is IMethod)
         return ambience.Convert(entity as IMethod);
     if (entity is IProperty)
         return ambience.Convert(entity as IProperty);
     if (entity is IEvent)
         return ambience.Convert(entity as IEvent);
     if (entity is IField)
         return ambience.Convert(entity as IField);
     if (entity is IClass)
         return ambience.Convert(entity as IClass);
     // unknown entity:
     return entity.ToString();
 }
开发者ID:ExRam,项目名称:DotSpatial-PCL,代码行数:21,代码来源:CodeCompletionData.cs

示例4: GetText

 string GetText(IEntity entity)
 {
     return o2CodeCompletion.TextEditor.invokeOnThread(
         ()=> {					
                  IAmbience ambience = csharpAmbience;
                  if (entity is IMethod)
                      return ambience.Convert(entity as IMethod);
                  if (entity is IProperty)
                      return ambience.Convert(entity as IProperty);
                  if (entity is IEvent)
                      return ambience.Convert(entity as IEvent);
                  if (entity is IField)
                      return ambience.Convert(entity as IField);
                  if (entity is IClass)
                      return ambience.Convert(entity as IClass);
                  // unknown entity:
                  return entity.ToString();
         });
 }        
开发者ID:modulexcite,项目名称:FluentSharp_Fork.SharpDevelopEditor,代码行数:19,代码来源:O2CodeCompletion.cs

示例5: AssertParameters

        bool AssertParameters(Node sourceNode, IEntity sourceEntity, ICallableType method, ExpressionCollection args)
        {
            if (CheckParameters(method, args, true))
                return true;

            if (IsLikelyMacroExtensionMethodInvocation(sourceNode, sourceEntity, args))
                Error(CompilerErrorFactory.MacroExpansionError(sourceNode));
            else
                Error(CompilerErrorFactory.MethodSignature(sourceNode, sourceEntity.ToString(), GetSignature(args)));
            return false;
        }
开发者ID:Bombadil77,项目名称:boo,代码行数:11,代码来源:ProcessMethodBodies.cs

示例6: GetText

		/// <summary>
		/// Converts a member to text.
		/// Returns the declaration of the member as C# or VB code, e.g.
		/// "public void MemberName(string parameter)"
		/// </summary>
		static string GetText(IEntity entity)
		{
            IAmbience ambience = IntellisenseForm.SupportedLanguage == ESupportedLanguage.VisualBasic ? (IAmbience)new VBNetAmbience() : new CSharpAmbience();
            if (entity is IMethod)
                return ambience.Convert(entity as IMethod);
            if (entity is IProperty)
                return ambience.Convert(entity as IProperty);
            if (entity is IEvent)
                return ambience.Convert(entity as IEvent);
            if (entity is IField)
                return ambience.Convert(entity as IField);
            if (entity is IClass)
                return ambience.Convert(entity as IClass);
			// unknown entity:
			return entity.ToString();
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:21,代码来源:CodeCompletionData.cs

示例7: GetMemberText

		static string GetMemberText(IAmbience ambience, IEntity member, string expression, out bool debuggerCanShowValue)
		{
			bool tryDisplayValue = false;
			debuggerCanShowValue = false;
			StringBuilder text = new StringBuilder();
			if (member is IField) {
				text.Append(ambience.Convert(member as IField));
				tryDisplayValue = true;
			} else if (member is IProperty) {
				text.Append(ambience.Convert(member as IProperty));
				tryDisplayValue = true;
			} else if (member is IEvent) {
				text.Append(ambience.Convert(member as IEvent));
			} else if (member is IMethod) {
				text.Append(ambience.Convert(member as IMethod));
			} else if (member is IClass) {
				text.Append(ambience.Convert(member as IClass));
			} else {
				text.Append("unknown member ");
				text.Append(member.ToString());
			}
			if (tryDisplayValue && currentDebugger != null) {
				LoggingService.Info("asking debugger for value of '" + expression + "'");
				string currentValue = currentDebugger.GetValueAsString(expression);
				if (currentValue != null) {
					debuggerCanShowValue = true;
					text.Append(" = ");
					text.Append(currentValue);
				}
			}
			string documentation = member.Documentation;
			if (documentation != null && documentation.Length > 0) {
				text.Append('\n');
				text.Append(ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.CodeCompletionData.ConvertDocumentation(documentation));
			}
			return text.ToString();
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:37,代码来源:DebuggerService.cs

示例8: UnsafeVisit

 public JsNode UnsafeVisit(IEntity me)
 {
     if (CompilerConfiguration.Current.EnableLogging)
     {
         Log.Debug("JsTypeImporter: Visit Entity: " + me.ToString());
     }
     if (BeforeVisitEntity != null)
         BeforeVisitEntity(me);
     JsNode node2 = null;
     switch (me.SymbolKind)
     {
         #region switch case
         //case EntityType.ent_anonymous_method:
         //    node2 = _Visit((CsEntityAnonymousMethod)me); break;
         //case EntityType.ent_block:
         //    node2 = _Visit((CsEntityBlock)me); break;
         //case EntityType.ent_block_variable:
         //    node2 = _Visit((CsEntityBlockVariable)me); break;
         case SymbolKind.TypeDefinition:
             node2 = _Visit((ITypeDefinition)me); break;
         //case EntityType.ent_constant:
         //    node2 = _Visit((IConst)me); break;
         //case EntityType.ent_delegate:
         //    node2 = _Visit((IDelegate)me); break;
         //case EntityType.ent_enum:
         //    node2 = _Visit((CsEntityEnum)me); break;
         case SymbolKind.Event:
             node2 = _Visit((IEvent)me); break;
         //case EntityType.ent_formal_parameter:
         //    node2 = _Visit((CsEntityFormalParameter)me); break;
         //case EntityType.ent_generic_param:
         //    node2 = _Visit((CsEntityGenericParam)me); break;
         //case EntityType.Interface:
         //    node2 = _Visit((IInterface)me); break;
         //case EntityType.ent_local_constant:
         //    node2 = _Visit((CsEntityLocalConstant)me); break;
         //case EntityType.ent_local_variable:
         //    node2 = _Visit((CsEntityLocalVariable)me); break;
         case SymbolKind.Method:
         case SymbolKind.Constructor:
         case SymbolKind.Operator:
         case SymbolKind.Accessor:
             node2 = _Visit((IMethod)me); break;
         //case EntityType.ent_namespace:
         //    node2 = _Visit((CsEntityNamespace)me); break;
         case SymbolKind.Property:
         case SymbolKind.Indexer:
             node2 = _Visit((IProperty)me); break;
         //case EntityType.ent_struct:
         //    node2 = _Visit((IStruct)me); break;
         case SymbolKind.Field:
             node2 = _Visit((IField)me); break;
         #endregion
     }
     if (AfterVisitEntity != null)
         AfterVisitEntity(me, node2);
     return node2;
 }
开发者ID:benbon,项目名称:SharpKit,代码行数:58,代码来源:MemberConverter.cs

示例9: AssertParameters

        bool AssertParameters(Node sourceNode, IEntity sourceEntity, ICallableType method, ExpressionCollection args)
        {
            if (CheckParameters(method, args, true)) return true;

            Error(CompilerErrorFactory.MethodSignature(sourceNode, sourceEntity.ToString(), GetSignature(args)));
            return false;
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:7,代码来源:ProcessMethodBodies.cs

示例10: GetOtherEntity

        /// <summary>
        /// Gets the entity in the reference that wasn't provided. Hence the "other" entity.
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public IEntity GetOtherEntity(IEntity entity)
        {
            IEntity otherEntity = null;

            //using (LogGroup logGroup = LogGroup.Start("Retrieving the entity from the reference that is not the one provided (ie. the other entity).", NLog.LogLevel.Debug))
            //{
            if (entity == null)
                throw new ArgumentNullException("entity");

            if (referenceEntity == null)
                throw new InvalidOperationException("The referenced entity is null.");

            if (sourceEntity == null)
                throw new InvalidOperationException("The source entity is null.");

            if (referenceEntity.ID == entity.ID)
                otherEntity = sourceEntity;
            else if (sourceEntity.ID == entity.ID)
                otherEntity = referenceEntity;
            else
                throw new InvalidOperationException("Can't get the other entity. Neither entity matches.\nParameter entity type: " + entity.ToString() + "\nParameter entity ID: " + entity.ID.ToString() + "\nEntity #1 type: " + Type1Name + "\nEntity #2 type: " + Type2Name + "\nProperty #1 type: " + Property1Name + "\nProperty #2 type: " + Property2Name + "\nEntity #1 ID: " + Entity1ID.ToString() + "\nEntity #2 ID: " + Entity2ID.ToString());

            //LogWriter.Debug("Other entity type: " + otherEntity.GetType().ToString());
            //LogWriter.Debug("Other entity ID: " + otherEntity.ID.ToString());
            //}

            return otherEntity;
        }
开发者ID:jeremysimmons,项目名称:sitestarter,代码行数:33,代码来源:EntityReference.cs

示例11: EntityNotAvailableException

 public EntityNotAvailableException(IEntity entity)
     : base(string.Format(CultureInfo.CurrentCulture, MathNet.Symbolics.Properties.Resources.ex_NotAvailable_Entity, (entity == null ? "N/A" : entity.ToString())))
 {
     _entity = entity;
 }
开发者ID:JackWangCUMT,项目名称:mathnet-yttrium,代码行数:5,代码来源:EntityNotAvailableException.cs

示例12: CreateFriendlyUrl

        /// <summary>
        /// Creates a friendly URL to the page corresponding with the specified action and specified type.
        /// </summary>
        /// <param name="action">The action to be performed at the target page.</param>
        /// <param name="typeName">The name of the type being acted upon at the target page.</param>
        /// <param name="propertyName">The name of the property to filter the type by.</param>
        /// <param name="entity">The entity to link to.</param>
        /// <returns>The URL to the page handling the provided action in relation to the provided type.</returns>
        public string CreateFriendlyUrl(string action, IEntity entity)
        {
            string link = String.Empty;
            using (LogGroup logGroup = LogGroup.StartDebug("Creating a friendly URL for the specified action and provided entity type."))
            {
                if (entity == null)
                    throw new ArgumentNullException("entity");

                LogWriter.Debug("Action: " + action);
                LogWriter.Debug("Entity type: " + entity.ShortTypeName);

                link = ApplicationPath
                + "/" + PrepareForUrl(action)
                + "-" + PrepareForUrl(entity.ShortTypeName);

                link = link + "/" + entity.ID.ToString();

                if (entity.ToString() != entity.GetType().FullName)
                    link = link + "/" + PrepareForUrl(Utilities.Summarize(entity.ToString(), 80));

                link = link + ".aspx";

                link = AddResult(link);

                LogWriter.Debug("Link: " + link);
            }
            return link;
        }
开发者ID:jeremysimmons,项目名称:sitestarter,代码行数:36,代码来源:UrlCreator.cs

示例13: Authorise

        public override IEntity Authorise(IEntity toEntity)
        {
            IEntity authorisedEntity = null;

            using (LogGroup logGroup = LogGroup.StartDebug("Authorising the creation of a reference on the '" + SourceProperty + "' property of the '" + SourceEntity.ShortTypeName + "' type to referenced entity '" + toEntity.ToString() + "' of type '"  + toEntity.ShortTypeName + "'."))
            {
                if (IsAuthorised(toEntity))
                {
                    LogWriter.Debug("Entity IS authorised.");

                    authorisedEntity = toEntity;
                }
                else
                    LogWriter.Debug("Entity is NOT authorised.");
            }

            return authorisedEntity;
        }
开发者ID:jeremysimmons,项目名称:sitestarter,代码行数:18,代码来源:BaseAuthoriseReferenceStrategy.cs

示例14: GetText

 /// <summary>
 /// Converts a member to text.
 /// Returns the declaration of the member as C# or VB code, e.g.
 /// "public void MemberName(string parameter)"
 /// </summary>
 static string GetText(IEntity entity)
 {
     IAmbience ambience = csharpAmbience;
     if (entity is IMethod)
         return ambience.Convert(entity as IMethod);
     if (entity is IProperty)
         return ambience.Convert(entity as IProperty);
     if (entity is IEvent)
         return ambience.Convert(entity as IEvent);
     if (entity is IField)
         return ambience.Convert(entity as IField);
     if (entity is IClass)
         return ambience.Convert(entity as IClass);
     // unknown entity:
     return entity.ToString();
 }
开发者ID:nhannhan159,项目名称:PAT,代码行数:21,代码来源:CodeCompletionData.cs


注:本文中的IEntity.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。