コード例 #1
0
ファイル: PerformanceTest.cs プロジェクト: zanyants/mvp.xml
		public void SelectAllNodes()
		{
			// Generate simple objects
			var objects = new List<SimpleObject>();
			int totalIterations = 100000;
			for( int i=0; i<totalIterations; i++ )
			{
				SimpleObject o = new SimpleObject();
				o.Attr2 = i.ToString();
				o.Elem1 = "Elem1" + i;
				o.Elem2 = "Elem2" + i;
				objects.Add( o );
			}

			// Create navigator
			var context = new ObjectXPathContext();
			context.NamespaceManager.AddNamespace( "sdf", Namespaces.SDF );
			XPathNavigator nav = context.CreateNavigator( objects );

			// Select nodes
			var nodes = nav.Select( "//* | //@*" );
			int j = 0;
			while( nodes.MoveNext() )
			{
				var val = nodes.Current.Value;
				j++;
			}

			Assert.AreEqual( totalIterations * 5 + 1, j );
		}
コード例 #2
0
ファイル: SimpleObject.cs プロジェクト: zanyants/mvp.xml
		public CollectionOfSimple( bool init )
		{
			_dic = new ListDictionary();
			SimpleObject o;
			o = new SimpleObject( true );
			o.attr1 = 11;
			_dic.Add( "1", o );
			o = new SimpleObject( true );
			o.attr1 = 12;
			_dic.Add( "2", o );
			o = new SimpleObject( true );
			o.attr1 = 13;
			_dic.Add( "3", o );
		}
コード例 #3
0
ファイル: ObjListProperty.cs プロジェクト: zanyants/mvp.xml
		public ObjListProperty( bool init )
		{
			Child = "child value";

			_list = new ArrayList();
			_list.Add( "string1" );
			SimpleObject o;
			o = new SimpleObject( true );
			o.attr1 = 11;
			_list.Add( o );
			o = new SimpleObject( true );
			o.attr1 = 12;
			_list.Add( o );
			_list.Add( new ObjChildrenNSInherit( true ) );
		}
コード例 #4
0
ファイル: SerializationTest.cs プロジェクト: zanyants/mvp.xml
		public void SerializeSimple()
		{
			SimpleObject o = new SimpleObject( true );
			SerializeAndCompare( o );
		}
コード例 #5
0
		public ObjCustomProxyAtProperty( bool init )
		{
			a = "attribute";
			o = new SimpleObject( true );
		}
コード例 #6
0
 public ObjTransparentAttribute(bool init)
 {
     Name      = "Joe";
     TheSimple = new SimpleObject(true);
 }
コード例 #7
0
 public ObjCustomProxyAtProperty(bool init)
 {
     a = "attribute";
     o = new SimpleObject(true);
 }
コード例 #8
0
		public ObjTransparentAttribute( bool init )
		{
			Name = "Joe";
			TheSimple = new SimpleObject( true );
		}