public void TestCreateDummyNode01() { Assert.Throws <ArgumentException>(() => { XmlElement srcElement = xmlDocument.CreateElement("OldNamespace.OldClass"); XmlElement dummy = MigrationManager.CreateDummyNode(srcElement, -1, 2); }); }
public static NodeMigrationData Migrate_0630_to_0700(NodeMigrationData data) { NodeMigrationData migrationData = new NodeMigrationData(data.Document); XmlElement oldNode = data.MigratedNodes.ElementAt(0); XmlElement dummyNode = MigrationManager.CreateDummyNode(oldNode, 1, 1); migrationData.AppendNode(dummyNode); return(migrationData); }
public static NodeMigrationData Migrate_0630_to_0700(NodeMigrationData data) { /* * NodeMigrationData migrationData = new NodeMigrationData(data.Document); * * // Create DSFunction node * XmlElement oldNode = data.MigratedNodes.ElementAt(0); * var newNode = MigrationManager.CreateFunctionNodeFrom(oldNode); * MigrationManager.SetFunctionSignature(newNode, "ProtoGeometry.dll", * "PolySurface.LocateSurfacesByLine", "PolySurface.LocateSurfacesByLine@Line"); * migrationData.AppendNode(newNode); * string newNodeId = MigrationManager.GetGuidFromXmlElement(newNode); * * // Create new nodes * XmlElement polySurface = MigrationManager.CreateFunctionNode( * data.Document, oldNode, 0, "ProtoGeometry.dll", * "PolySurface.BySolid", "*****@*****.**"); * migrationData.AppendNode(polySurface); * string polySurfaceId = MigrationManager.GetGuidFromXmlElement(polySurface); * * // Update connectors * PortId oldInPort0 = new PortId(newNodeId, 0, PortType.Input); * XmlElement connector0 = data.FindFirstConnector(oldInPort0); * PortId polySurfaceInPort0 = new PortId(polySurfaceId, 0, PortType.Input); * * data.ReconnectToPort(connector0, polySurfaceInPort0); * data.CreateConnector(polySurface, 0, newNode, 0); * * return migrationData;*/ NodeMigrationData migrationData = new NodeMigrationData(data.Document); XmlElement oldNode = data.MigratedNodes.ElementAt(0); XmlElement dummyNode = MigrationManager.CreateDummyNode(oldNode, 2, 1); migrationData.AppendNode(dummyNode); return(migrationData); }