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


C# Entity.ToString方法代码示例

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


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

示例1: DeleteSqlSync

        public SqlPreCommand DeleteSqlSync(Entity ident, string comment = null)
        {
            var pre = OnPreDeleteSqlSync(ident);
            var collections = (from tml in this.TablesMList()
                               select new SqlPreCommandSimple("DELETE {0} WHERE {1} = {2} --{3}"
                                   .FormatWith(tml.Name, tml.BackReference.Name.SqlEscape(), ident.Id, comment ?? ident.ToString()))).Combine(Spacing.Simple);

            var main = new SqlPreCommandSimple("DELETE {0} WHERE {1} = {2} --{3}"
                    .FormatWith(Name, this.PrimaryKey.Name.SqlEscape(), ident.Id, comment ?? ident.ToString()));

            return SqlPreCommand.Combine(Spacing.Simple, pre, collections, main);
        }
开发者ID:rondoo,项目名称:framework,代码行数:12,代码来源:Schema.Delete.cs

示例2: DeleteChanges

 public string DeleteChanges(Entity entity, IDictionary<string, object> existingRecord)
 {
     var display = entity.ToString();
     var joinedKeyValue = "#" + entity.JoinedKeyValue;
     if (display != joinedKeyValue)
     {
         display += " ({0})".Fill(joinedKeyValue);
     }
     return "Deleted " + display;
 }
开发者ID:anupvarghese,项目名称:Ilaro.Admin,代码行数:10,代码来源:ChangesDescriber.cs

示例3: CreateChanges

 public string CreateChanges(Entity entity)
 {
     var display = entity.ToString();
     var joinedKeyValue = "#" + entity.JoinedKeyValue;
     if (display != joinedKeyValue)
     {
         display += " ({0})".Fill(joinedKeyValue);
     }
     return "Created " + display;
 }
开发者ID:anupvarghese,项目名称:Ilaro.Admin,代码行数:10,代码来源:ChangesDescriber.cs

示例4: HandleReceiveEntity

        private void HandleReceiveEntity(Entity ent)
        {
            if (ent is Response)
                HandleResponse(ent as Response);
            else if (ent is Request)
                HandleRequest(ent as Request);
            else if (ent is Notice)
                HandleNotice(ent as Notice);
            else
                Console.WriteLine("TEBPProvicer received an invalid entity (ignored).");

            if (ent.RequiresAnswer && !ent.Responded)
                throw new NotSupportedException("The entity " + ent.ToString() + " has not been responded to.");
        }
开发者ID:fubar-coder,项目名称:cryptrans,代码行数:14,代码来源:TEBPProvider.cs

示例5: RunTest

    static void RunTest(Store testlist, Entity test, bool shouldSucceed, int mode)
    {
        string inputpath = null, outputpath = null,
            inputformat = null, outputformat = null,
            inputbase = null, outputbase = null;

        if (mode == 0) {
            inputformat = "xml";
            outputformat = "n3";

            string uribase = "http://www.w3.org/2000/10/rdf-tests/rdfcore/";
            Resource input = testlist.SelectObjects(test, "http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#inputDocument")[0];
            inputbase = input.Uri;
            inputpath = input.Uri.Substring(uribase.Length);

            if (testlist.SelectObjects(test, "http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#outputDocument").Length > 0) {
                Resource output = testlist.SelectObjects(test, "http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#outputDocument")[0];
                outputpath = output.Uri.Substring(uribase.Length);
                outputbase = output.Uri;
            }
        } else if (mode == 1) {
            inputformat = "n3";
            outputformat = "n3";
            inputbase = "file:/home/syosi/cvs-trunk/WWW/2000/10/swap/test/n3parser.tests";

            string uribase = "http://www.example.org/";

            if (testlist.SelectObjects(test, "http://www.w3.org/2004/11/n3test#inputDocument").Length == 0) return;
            Resource input = testlist.SelectObjects(test, "http://www.w3.org/2004/11/n3test#inputDocument")[0];
            inputpath = input.Uri.Substring(uribase.Length);

            if (testlist.SelectObjects(test, "http://www.w3.org/2004/11/n3test#outputDocument").Length > 0) {
                Resource output = testlist.SelectObjects(test, "http://www.w3.org/2004/11/n3test#outputDocument")[0];
                outputpath = output.Uri.Substring(uribase.Length);
            }
        }

        string desc = test.ToString();
        try {
            desc += " " + ((Literal)testlist.SelectObjects(test, "http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#description")[0]).Value;
        } catch (Exception e) {
        }

        try {
            total++;

            RdfReader reader = RdfReader.Create(inputformat, Path.Combine(basepath, inputpath));
            reader.BaseUri = inputbase;

            MemoryStore inputmodel = new MemoryStore(reader);
            if (reader.Warnings.Count > 0) {
                string warnings = String.Join("; ", (string[])((ArrayList)reader.Warnings).ToArray(typeof(string)));
                throw new ParserException(warnings);
            }
            if (!shouldSucceed) {
                Console.WriteLine(desc + ": Should Not Have Passed **\n");
                badpass++;
                return;
            }

            if (shouldSucceed && outputpath != null) {
                RdfReader reader2 = RdfReader.Create(outputformat, Path.Combine(basepath, outputpath));
                reader2.BaseUri = outputbase;
                MemoryStore outputmodel = new MemoryStore(reader2);

                CompareModels(inputmodel, outputmodel);
            }
        } catch (System.IO.FileNotFoundException ex) {
            Console.WriteLine(inputpath + " Not Found");
            error++;
        } catch (System.IO.DirectoryNotFoundException ex) {
            Console.WriteLine(inputpath + " Not Found");
            error++;
        } catch (ParserException ex) {
            if (shouldSucceed) {
                Console.WriteLine(desc + ": " + ex.Message + " **");
                Console.WriteLine();
                badfail++;
            }
        }
    }
开发者ID:JoshData,项目名称:semweb-dotnet,代码行数:81,代码来源:runtests.cs

示例6: PrintEntity

 /// <summary>
 /// Prints the description for an individual entity on its own line.
 /// </summary>
 /// <param name="entity"></param>
 private static void PrintEntity( Entity entity )
 {
     Console.Out.WriteLine( entity.GetID() + " - " + entity.ToString() + " [" + entity.m_Type.ToString() + "]" );
 }
开发者ID:ericdalrymple,项目名称:HotSpot,代码行数:8,代码来源:GameSystem.cs

示例7: GetUniqueName

		string GetUniqueName( Set<string> names, Entity entity )
		{
			string name = entity.Name;
			if( string.IsNullOrEmpty( name ) )
				name = entity.ToString();
			string uniqueName;
			for( int n = 1; ; n++ )
			{
				uniqueName = name;
				if( n != 1 )
					uniqueName += n.ToString();
				if( !names.Contains( uniqueName ) )
					break;
			}
			return uniqueName;
		}
开发者ID:whztt07,项目名称:SDK,代码行数:16,代码来源:AddonForm.cs


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