20241008代码上传

master
李冬阳 8 months ago
commit 75fd3a3076

@ -0,0 +1,85 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5503038E-4D69-4703-9F79-90C8D9061A70}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HelloTeamcenter</RootNamespace>
<AssemblyName>HelloTeamcenter</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="TcSoaClient, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaClient.dll</HintPath>
</Reference>
<Reference Include="TcSoaCommon, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaCommon.dll</HintPath>
</Reference>
<Reference Include="TcSoaCoreStrong, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaCoreStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCoreTypes, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaCoreTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaQueryStrong, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaQueryStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaQueryTypes, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaQueryTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModel, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaStrongModel.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="clientx\AppXCredentialManager.cs" />
<Compile Include="clientx\AppXDeletedObjectListener.cs" />
<Compile Include="clientx\AppXExceptionHandler.cs" />
<Compile Include="clientx\AppXPartialErrorListener.cs" />
<Compile Include="clientx\AppXRequestListener.cs" />
<Compile Include="clientx\AppXUpdateObjectListener.cs" />
<Compile Include="clientx\Session.cs" />
<Compile Include="hello\DataManagement.cs" />
<Compile Include="hello\Hello.cs" />
<Compile Include="hello\HomeFolder.cs" />
<Compile Include="hello\Query.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HelloTeamcenter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Siemens Product Lifecycle Management Software Inc.")]
[assembly: AssemblyProduct("HelloTeamcenter")]
[assembly: AssemblyCopyright("Copyright 2008 Siemens Product Lifecycle Management Software Inc.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6ce4adbe-4247-464b-8d53-e3ecb88955fd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,146 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.IO;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Soa;
using Teamcenter.Soa.Common;
using Teamcenter.Soa.Client;
using Teamcenter.Soa.Exceptions;
namespace Teamcenter.ClientX
{
/**
* The CredentialManager is used by the Teamcenter Services framework to get the
* user's credentials when challanged by the server. This can occur after a period
* of inactivity and the server has timed-out the user's session, at which time
* the client application will need to re-authenitcate. The framework will
* call one of the getCredentials methods (depending on circumstances) and will
* send the SessionService.login service request. Upon successfull completion of
* the login service request. The last service request (one that cuased the challange)
* will be resent.
*
* The framework will also call the setUserPassword setGroupRole methods when ever
* these credentials change, thus allowing this implementation of the CredentialManager
* to cache these values so prompting of the user is not requried for re-authentication.
*
*/
public class AppXCredentialManager : CredentialManager
{
private String name = null;
private String password = null;
private String group = ""; // default group
private String role = ""; // default role
private String discriminator = "SoaAppX"; // always connect same user
// to same instance of server
/**
* Return the type of credentials this implementation provides,
* standard (user/password) or Single-Sign-On. In this case
* Standard credentials are returned.
*
* @see com.teamcenter.soa.client.CredentialManager#getCredentialType()
*/
public int CredentialType
{
get { return SoaConstants.CLIENT_CREDENTIAL_TYPE_STD; }
}
/**
* Prompt's the user for credentials.
* This method will only be called by the framework when a login attempt has
* failed.
*
* @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException)
*/
public string[] GetCredentials(InvalidCredentialsException e)
//throws CanceledOperationException
{
Console.WriteLine(e.Message);
return PromptForCredentials();
}
/**
* Return the cached credentials.
* This method will be called when a service request is sent without a valid
* session ( session has expired on the server).
*
* @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException)
*/
public String[] GetCredentials(InvalidUserException e)
//throws CanceledOperationException
{
// Have not logged in yet, shoult not happen but just in case
if (name == null) return PromptForCredentials();
// Return cached credentials
String[] tokens = { name, password, group, role, discriminator };
return tokens;
}
/**
* Cache the group and role
* This is called after the SessionService.setSessionGroupMember service
* operation is called.
*
* @see com.teamcenter.soa.client.CredentialManager#setGroupRole(java.lang.String,
* java.lang.String)
*/
public void SetGroupRole(String group, String role)
{
this.group = group;
this.role = role;
}
/**
* Cache the User and Password
* This is called after the SessionService.login service operation is called.
*
* @see com.teamcenter.soa.client.CredentialManager#setUserPassword(java.lang.String,
* java.lang.String, java.lang.String)
*/
public void SetUserPassword(String user, String password, String discriminator)
{
this.name = user;
this.password = password;
this.discriminator = discriminator;
}
public String[] PromptForCredentials()
//throws CanceledOperationException
{
try
{
Console.WriteLine("Please enter user credentials (return to quit):");
Console.Write("User Name: ");
name = Console.ReadLine();
if (name.Length == 0)
throw new CanceledOperationException("");
Console.Write("Password: ");
password = Console.ReadLine();
}
catch (IOException e)
{
String message = "Failed to get the name and password.\n" + e.Message;
Console.WriteLine(message);
throw new CanceledOperationException(message);
}
String[] tokens = { name, password, group, role, discriminator };
return tokens;
}
}
}

@ -0,0 +1,38 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client.Model;
namespace Teamcenter.ClientX
{
/**
* Implementation of the DeleteListener, simply prints out list of all objects
* that are deleted.
*
*/
public class AppXDeletedObjectListener : DeleteListener
{
public void ModelObjectDelete(string[] uids)
{
if (uids.Length == 0)
return;
System.Console.WriteLine("");
System.Console.WriteLine("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete");
System.Console.WriteLine("The following objects have been deleted from the server and removed from the client data model:");
for (int i = 0; i < uids.Length; i++)
{
System.Console.WriteLine(" " + uids[i]);
}
}
}
}

@ -0,0 +1,101 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.IO;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Soa.Client;
using Teamcenter.Soa.Exceptions;
namespace Teamcenter.ClientX
{
/**
* Implementation of the ExceptionHandler. For ConnectionExceptions (server
* temporarily down .etc) prompts the user to retry the last request. For other
* exceptions convert to a RunTime exception.
*/
public class AppXExceptionHandler : ExceptionHandler
{
/*
* (non-Javadoc)
*
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException)
*/
public void HandleException(InternalServerException ise)
{
Console.WriteLine("");
Console.WriteLine("*****");
Console.WriteLine("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException).");
if (ise is ConnectionException)
{
// ConnectionException are typically due to a network error (server
// down .etc) and can be recovered from (the last request can be sent again,
// after the problem is corrected).
Console.Write("\nThe server returned an connection error.\n" + ise.Message
+ "\nDo you wish to retry the last service request?[y/n]");
}
else if (ise is ProtocolException)
{
// ProtocolException are typically due to programming errors
// (content of HTTP
// request is incorrect). These are generally can not be
// recovered from.
Console.Write("\nThe server returned an protocol error.\n" + ise.Message
+ "\nThis is most likely the result of a programming error."
+ "\nDo you wish to retry the last service request?[y/n]");
}
else
{
Console.WriteLine("\nThe server returned an internal server error.\n"
+ ise.Message
+ "\nThis is most likely the result of a programming error."
+ "\nA RuntimeException will be thrown.");
throw new SystemException(ise.Message);
}
try
{
String retry = Console.ReadLine();
// If yes, return to the calling SOA client framework, where the
// last service request will be resent.
if (retry.ToLower().Equals("y") || retry.ToLower().Equals("yes"))
return;
throw new SystemException("The user has opted not to retry the last request");
}
catch (IOException e)
{
Console.Error.WriteLine("Failed to read user response.\nA RuntimeException will be thrown.");
throw new SystemException(e.Message);
}
}
/*
* (non-Javadoc)
*
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException)
*/
public void HandleException(CanceledOperationException coe)
{
Console.WriteLine("");
Console.WriteLine("*****");
Console.WriteLine("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(CanceledOperationException).");
// Expecting this from the login tests with bad credentials, and the
// AnyUserCredentials class not
// prompting for different credentials
throw new SystemException(coe.Message);
}
}
}

@ -0,0 +1,68 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client.Model;
namespace Teamcenter.ClientX
{
/**
* Implementation of the PartialErrorListener. Print out any partial errors
* returned.
*
*/
public class AppXPartialErrorListener : PartialErrorListener
{
/*
* (non-Javadoc)
*
* @see com.teamcenter.soa.client.model.PartialErrorListener#handlePartialError(com.teamcenter.soa.client.model.ErrorStack[])
*/
public void HandlePartialError(ErrorStack[] stacks)
{
if (stacks.Length == 0) return;
Console.WriteLine("");
Console.WriteLine("*****");
Console.WriteLine("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener.");
for (int i = 0; i < stacks.Length; i++)
{
ErrorValue[] errors = stacks[i].ErrorValues;
Console.Write("Partial Error for ");
// The different service implementation may optionally associate
// an ModelObject, client ID, or nothing, with each partial error
if (stacks[i].HasAssociatedObject() )
{
Console.WriteLine("object "+ stacks[i].AssociatedObject.Uid);
}
else if (stacks[i].HasClientId())
{
Console.WriteLine("client id "+ stacks[i].ClientId);
}
else if (stacks[i].HasClientIndex())
{
Console.WriteLine("client index " + stacks[i].ClientIndex);
}
// Each Partial Error will have one or more contributing error messages
for (int j = 0; j < errors.Length; j++)
{
Console.WriteLine(" Code: " + errors[j].Code + "\tSeverity: "
+ errors[j].Level + "\t" + errors[j].Message);
}
}
}
}
}

@ -0,0 +1,42 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client;
namespace Teamcenter.ClientX
{
/**
* This implemenation of the RequestListener, logs each service request
* to the console.
*
*/
public class AppXRequestListener : RequestListener
{
/**
* Called before each request is sent to the server.
*/
public void ServiceRequest(ServiceInfo info)
{
// will log the service name when done
}
/**
* Called after each response from the server.
* Log the service operation to the console.
*/
public void ServiceResponse(ServiceInfo info)
{
Console.WriteLine(info.Id + ": " + info.Service + "." + info.Operation);
}
}
}

@ -0,0 +1,48 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
namespace Teamcenter.ClientX
{
/**
* Implementation of the ChangeListener. Print out all objects that have been updated.
*
*/
public class AppXUpdateObjectListener : ChangeListener
{
public void ModelObjectChange(ModelObject[] objects)
{
if (objects.Length == 0) return;
System.Console.WriteLine("");
System.Console.WriteLine("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange");
System.Console.WriteLine("The following objects have been updated in the client data model:");
for (int i = 0; i < objects.Length; i++)
{
String uid = objects[i].Uid;
String type = objects[i].GetType().Name;
String name = "";
if (objects[i].GetType().Name.Equals("WorkspaceObject"))
{
ModelObject wo = objects[i];
try
{
name = wo.GetProperty("object_string").StringValue;
}
catch (NotLoadedException /*e*/) {} // just ignore
}
System.Console.WriteLine(" " + uid + " " + type + " " + name);
}
}
}
}

@ -0,0 +1,247 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.Collections;
using System.Net;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Services.Strong.Core._2006_03.Session;
using Teamcenter.Soa;
using Teamcenter.Soa.Client;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using User = Teamcenter.Soa.Client.Model.Strong.User;
namespace Teamcenter.ClientX
{
public class Session
{
/**
* Single instance of the Connection object that is shared throughtout
* the application. This Connection object is needed whenever a Service
* stub is instantiated.
*/
private static Connection connection;
/**
* The credentialManager is used both by the Session class and the Teamcenter
* Services Framework to get user credentials.
*
*/
private static AppXCredentialManager credentialManager;
/**
* Create an instance of the Session with a connection to the specified
* server.
*
* Add implementations of the ExceptionHandler, PartialErrorListener,
* ChangeListener, and DeleteListeners.
*
* @param host Address of the host to connect to, http://serverName:port/tc
*/
public Session(String host)
{
// Create an instance of the CredentialManager, this is used
// by the SOA Framework to get the user's credentials when
// challanged by the server (sesioin timeout on the web tier).
credentialManager = new AppXCredentialManager();
// Create the Connection object, no contact is made with the server
// until a service request is made
connection = new Connection(host, new CookieCollection(), credentialManager, SoaConstants.REST,
SoaConstants.HTTP, false);
// Add an ExceptionHandler to the Connection, this will handle any
// InternalServerException, communication errors, xml marshalling errors
// .etc
connection.ExceptionHandler = new AppXExceptionHandler();
// While the above ExceptionHandler is required, all of the following
// Listeners are optional. Client application can add as many or as few Listeners
// of each type that they want.
// Add a Partial Error Listener, this will be notified when ever a
// a service returns partial errors.
connection.ModelManager.AddPartialErrorListener(new AppXPartialErrorListener());
// Add a Change Listener, this will be notified when ever a
// a service returns model objects that have been updated.
connection.ModelManager.AddChangeListener(new AppXUpdateObjectListener());
// Add a Delete Listener, this will be notified when ever a
// a service returns objects that have been deleted.
connection.ModelManager.AddDeleteListener(new AppXDeletedObjectListener());
// Add a Request Listener, this will be notified before and after each
// service request is sent to the server.
Connection.AddRequestListener(new AppXRequestListener());
}
/**
* Get the single Connection object for the application
*
* @return connection
*/
public static Connection getConnection()
{
return connection;
}
/**
* Login to the Teamcenter Server
*
*/
public User login()
{
// Get the service stub
SessionService sessionService = SessionService.getService(connection);
try
{
// Prompt for credentials until they are right, or until user
// cancels
String[] credentials = credentialManager.PromptForCredentials();
while (true)
{
try
{
// *****************************
// Execute the service operation
// *****************************
LoginResponse resp = sessionService.Login(credentials[0], credentials[1],
credentials[2], credentials[3],"",credentials[4]);
return resp.User;
}
catch (InvalidCredentialsException e)
{
credentials = credentialManager.GetCredentials(e);
}
}
}
// User canceled the operation, don't need to tell him again
catch (CanceledOperationException /*e*/) {}
// Exit the application
//System.exit(0);
return null;
}
/**
* Terminate the session with the Teamcenter Server
*
*/
public void logout()
{
// Get the service stub
SessionService sessionService = SessionService.getService(connection);
try
{
// *****************************
// Execute the service operation
// *****************************
sessionService.Logout();
}
catch (ServiceException /*e*/) { }
}
/**
* Print some basic information for a list of objects
*
* @param objects
*/
public static void printObjects(ModelObject[] objects)
{
if(objects == null)
return;
// Ensure that the referenced User objects that we will use below are loaded
getUsers( objects );
Console.WriteLine("Name\t\tOwner\t\tLast Modified");
Console.WriteLine("====\t\t=====\t\t=============");
for (int i = 0; i < objects.Length; i++)
{
if(!(objects[i] is WorkspaceObject ))
continue;
WorkspaceObject wo = (WorkspaceObject)objects[i];
try
{
String name = wo.Object_string;
User owner = (User) wo.Owning_user;
DateTime lastModified =wo.Last_mod_date;
Console.WriteLine(name + "\t" + owner.User_name + "\t" + lastModified.ToString());
}
catch (NotLoadedException e)
{
// Print out a message, and skip to the next item in the folder
// Could do a DataManagementService.getProperties call at this point
Console.WriteLine(e.Message);
Console.WriteLine("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
}
}
}
private static void getUsers(ModelObject[] objects)
{
if(objects == null)
return;
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
ArrayList unKnownUsers = new ArrayList();
for (int i = 0; i < objects.Length; i++)
{
if(!(objects[i] is WorkspaceObject ))
continue;
WorkspaceObject wo = (WorkspaceObject)objects[i];
User owner = null;
try
{
owner = (User) wo.Owning_user;
String userName = owner.User_name;
}
catch (NotLoadedException /*e*/)
{
if(owner != null)
unKnownUsers.Add(owner);
}
}
User[] users = new User[unKnownUsers.Count];
unKnownUsers.CopyTo( users );
String[] attributes = { "user_name" };
// *****************************
// Execute the service operation
// *****************************
dmService.GetProperties(users, attributes);
}
}
}

@ -0,0 +1,379 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.Collections;
using Teamcenter.ClientX;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
// Include the Data Management Service Interface
using Teamcenter.Services.Strong.Core;
// Input and output structures for the service operations
// Note: the different namespace from the service interface
using Teamcenter.Services.Strong.Core._2006_03.DataManagement;
using Teamcenter.Services.Strong.Core._2007_01.DataManagement;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
namespace Teamcenter.Hello
{
/**
* Perform different operations in the DataManamentService
*
*/
public class DataManagement
{
/**
* Perform a sequence of data management operations: Create Items, Revise
* the Items, and Delete the Items
*
*/
public void createReviseAndDelete()
{
try
{
int numberOfItems = 3;
// Reserve Item IDs and Create Items with those IDs
ItemIdsAndInitialRevisionIds[] itemIds = generateItemIds(numberOfItems, "Item");
CreateItemsOutput[] newItems = createItems(itemIds, "Item");
// Copy the Item and ItemRevision to separate arrays for further
// processing
Item[] items = new Item[newItems.Length];
ItemRevision[] itemRevs = new ItemRevision[newItems.Length];
for (int i = 0; i < items.Length; i++)
{
items[i] = newItems[i].Item;
itemRevs[i] = newItems[i].ItemRev;
}
// Reserve revision IDs and revise the Items
Hashtable allRevIds = generateRevisionIds(items);
reviseItems(allRevIds, itemRevs);
// Delete all objects created
deleteItems(items);
}
catch (ServiceException e)
{
System.Console.Out.WriteLine(e.Message );
}
}
/**
* Reserve a number Item and Revision Ids
*
* @param numberOfIds Number of IDs to generate
* @param type Type of IDs to generate
*
* @return An array of Item and Revision IDs. The size of the array is equal
* to the input numberOfIds
*
* @throws ServiceException If any partial errors are returned
*/
public ItemIdsAndInitialRevisionIds[] generateItemIds(int numberOfIds, String type)
// throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
GenerateItemIdsAndInitialRevisionIdsProperties[] properties = new GenerateItemIdsAndInitialRevisionIdsProperties[1];
GenerateItemIdsAndInitialRevisionIdsProperties property = new GenerateItemIdsAndInitialRevisionIdsProperties();
property.Count = numberOfIds;
property.ItemType = type;
property.Item = null; // Not used
properties[0] = property;
// *****************************
// Execute the service operation
// *****************************
GenerateItemIdsAndInitialRevisionIdsResponse response = dmService.GenerateItemIdsAndInitialRevisionIds(properties);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.generateItemIdsAndInitialRevisionIds returned a partial error.");
// The return is a map of ItemIdsAndInitialRevisionIds keyed on the
// 0-based index of requested IDs. Since we only asked for IDs for one
// data type, the map key is '0'
Int32 bIkey = 0;
Hashtable allNewIds = response.OutputItemIdsAndInitialRevisionIds;
ItemIdsAndInitialRevisionIds[] myNewIds = (ItemIdsAndInitialRevisionIds[]) allNewIds[bIkey];
return myNewIds;
}
/**
* Create Items
*
* @param itemIds Array of Item and Revision IDs
* @param itemType Type of item to create
*
* @return Set of Items and ItemRevisions
*
* @throws ServiceException If any partial errors are returned
*/
public CreateItemsOutput[] createItems(ItemIdsAndInitialRevisionIds[] itemIds, String itemType)
// throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
// Populate form type
GetItemCreationRelatedInfoResponse relatedResponse = dmService.GetItemCreationRelatedInfo(itemType, null);
String[] formTypes = new String[0];
if ( relatedResponse.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.getItemCretionRelatedInfo returned a partial error.");
formTypes = new String[relatedResponse.FormAttrs.Length];
for ( int i = 0; i < relatedResponse.FormAttrs.Length; i++ )
{
FormAttributesInfo attrInfo = relatedResponse.FormAttrs[i];
formTypes[i] = attrInfo.FormType;
}
ItemProperties[] itemProps = new ItemProperties[itemIds.Length];
for (int i = 0; i < itemIds.Length; i++)
{
// Create form in cache for form property population
ModelObject[] forms = createForms(itemIds[i].NewItemId, formTypes[0],
itemIds[i].NewRevId, formTypes[1],
null, false);
ItemProperties itemProperty = new ItemProperties();
itemProperty.ClientId = "AppX-Test";
itemProperty.ItemId = itemIds[i].NewItemId;
itemProperty.RevId = itemIds[i].NewRevId;
itemProperty.Name = "AppX-Test";
itemProperty.Type = itemType;
itemProperty.Description = "Test Item for the SOA AppX sample application.";
itemProperty.Uom = "";
// Retrieve one of form attribute value from Item master form.
ServiceData serviceData = dmService.GetProperties(forms, new String[]{"project_id"});
if ( serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.getProperties returned a partial error.");
Property property = null;
try
{
property= forms[0].GetProperty("project_id");
}
catch ( NotLoadedException /*ex*/){}
// Only if value is null, we set new value
if ( property == null || property.StringValue == null || property.StringValue.Length == 0)
{
itemProperty.ExtendedAttributes = new ExtendedAttributes[1];
ExtendedAttributes theExtendedAttr = new ExtendedAttributes();
theExtendedAttr.Attributes = new Hashtable();
theExtendedAttr.ObjectType = formTypes[0];
theExtendedAttr.Attributes["project_id"] = "project_id";
itemProperty.ExtendedAttributes[0] = theExtendedAttr;
}
itemProps[i] = itemProperty;
}
// *****************************
// Execute the service operation
// *****************************
CreateItemsResponse response = dmService.CreateItems(itemProps, null, "");
// before control is returned the ChangedHandler will be called with
// newly created Item and ItemRevisions
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.createItems returned a partial error.");
return response.Output;
}
/**
* Reserve Revision IDs
*
* @param items Array of Items to reserve Ids for
*
* @return Map of RevisionIds
*
* @throws ServiceException If any partial errors are returned
*/
public Hashtable generateRevisionIds(Item[] items) //throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
GenerateRevisionIdsResponse response = null;
GenerateRevisionIdsProperties[] input = null;
input = new GenerateRevisionIdsProperties[items.Length];
for (int i = 0; i < items.Length; i++)
{
GenerateRevisionIdsProperties property = new GenerateRevisionIdsProperties();
property.Item = items[i];
property.ItemType = "";
input[i] = property;
}
// *****************************
// Execute the service operation
// *****************************
response = dmService.GenerateRevisionIds(input);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.generateRevisionIds returned a partial error.");
return response.OutputRevisionIds;
}
/**
* Revise Items
*
* @param revisionIds Map of Revsion IDs
* @param itemRevs Array of ItemRevisons
*
* @return Map of Old ItemRevsion(key) to new ItemRevision(value)
*
* @throws ServiceException If any partial errors are returned
*/
public Hashtable reviseItems(Hashtable revisionIds, ItemRevision[] itemRevs) //throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
Hashtable revs = new Hashtable();
for (int i = 0; i < itemRevs.Length; i++)
{
RevisionIds rev = (RevisionIds) revisionIds[i];
ReviseProperties revProps = new ReviseProperties();
revProps.RevId = rev.NewRevId;
revProps.Name = "testRevise";
revProps.Description = "describe testRevise";
Hashtable attrs = new Hashtable();
attrs["project_id"] = "project_id_val";
revProps.ExtendedAttributes = attrs;
revs[itemRevs[i]]= revProps;
}
// *****************************
// Execute the service operation
// *****************************
ReviseResponse revised = dmService.Revise(revs);
// before control is returned the ChangedHandler will be called with
// newly created Item and ItemRevisions
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (revised.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.revise returned a partial error.");
return revised.OldItemRevToNewItemRev;
}
/**
* Delete the Items
*
* @param items Array of Items to delete
*
* @throws ServiceException If any partial errors are returned
*/
public void deleteItems(Item[] items) //throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
// *****************************
// Execute the service operation
// *****************************
ServiceData serviceData = dmService.DeleteObjects(items);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.deleteObjects returned a partial error.");
}
/**
* Create ItemMasterForm and ItemRevisionMasterForm
*
* @param IMFormName Name of ItemMasterForm
* @param IMFormType Type of ItemMasterForm
* @param IRMFormName Name of ItemRevisionMasterForm
* @param IRMFormType Type of ItemRevisionMasterForm
* @param parent The container object that two
* newly-created forms will be added into.
* @return ModelObject[] Array of forms
*
* @throws ServiceException If any partial errors are returned
*/
public ModelObject[] createForms ( String IMFormName, String IMFormType,
String IRMFormName, String IRMFormType,
ModelObject parent, bool saveDB ) //throws ServiceException
{
//Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
FormInfo[] inputs = new FormInfo[2];
inputs[0] = new FormInfo();
inputs[0].ClientId = "1";
inputs[0].Description="";
inputs[0].Name = IMFormName;
inputs[0].FormType=IMFormType;
inputs[0].SaveDB = saveDB;
inputs[0].ParentObject = parent ;
inputs[1] = new FormInfo();
inputs[1].ClientId = "2";
inputs[1].Description="";
inputs[1].Name = IRMFormName;
inputs[1].FormType=IRMFormType;
inputs[1].SaveDB = saveDB;
inputs[1].ParentObject = parent;
CreateOrUpdateFormsResponse response = dmService.CreateOrUpdateForms(inputs);
if ( response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.createForms returned a partial error.");
ModelObject[] forms = new ModelObject [inputs.Length];
for (int i=0; i<inputs.Length; ++i)
{
forms[i] = response.Outputs[i].Form;
}
return forms;
}
}
}

@ -0,0 +1,91 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.ClientX;
using User = Teamcenter.Soa.Client.Model.Strong.User;
namespace Teamcenter.Hello
{
/**
* This sample client application demonstrates some of the basic features of the
* Teamcenter Services framework and a few of the services.
*
* An instance of the Connection object is created with implementations of the
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners
* intefaces. This client application performs the following functions:
* 1. Establishes a session with the Teamcenter server
* 2. Display the contents of the Home Folder
* 3. Performs a simple query of the database
* 4. Create, revise, and delete an Item
*
*/
public class Hello
{
/**
* @param args -help or -h will print out a Usage statement
*/
public static void Main(string[] args)
{
String serverHost = "http://localhost:7001/tc";
if (args.Length > 0)
{
if (args[0].Equals("-help") || args[0].Equals("-h"))
{
System.Console.Out.WriteLine("usage: Hello [-host http://server:port/tc]");
return;
}
if (args[0].Equals("-host") && args.Length > 1)
{
// Get optional host information
serverHost = args[1];
}
}
try
{
Session session = new Session(serverHost);
HomeFolder home = new HomeFolder();
Query query = new Query();
DataManagement dm = new DataManagement();
// Establish a session with the Teamcenter Server
User user = session.login();
// Using the User object returned from the login service request
// display the contents of the Home Folder
home.listHomeFolder(user);
// Perform a simple query of the database
query.queryItems();
// Perform some basic data management functions
dm.createReviseAndDelete();
// Terminate the session with the Teamcenter server
session.logout();
}
catch (SystemException e)
{
Console.WriteLine(e.Message);
}
}
}
}

@ -0,0 +1,79 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
namespace Teamcenter.Hello
{
public class HomeFolder
{
/**
* List the contents of the Home folder.
*
*/
public void listHomeFolder(User user)
{
Folder home = null;
WorkspaceObject[] contents = null;
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
try
{
// User was a primary object returned from the login command
// the Object Property Policy should be configured to include the
// 'home_folder' property. However the actuall 'home_folder' object
// was a secondary object returned from the login request and
// therefore does not have any properties associated with it. We will need to
// get those properties explicitly with a 'getProperties' service request.
home = user.Home_folder;
}
catch (NotLoadedException e)
{
Console.Out.WriteLine(e.Message);
Console.Out.WriteLine("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
return;
}
try
{
ModelObject[] objects = { home };
String[] attributes = { "contents" };
// *****************************
// Execute the service operation
// *****************************
dmService.GetProperties(objects, attributes);
// The above getProperties call returns a ServiceData object, but it
// just has pointers to the same object we passed into the method, so the
// input object have been updated with new property values
contents = home.Contents;
}
// This should never be thrown, since we just explicitly asked for this
// property
catch (NotLoadedException /*e*/){}
Console.Out.WriteLine("");
Console.Out.WriteLine("Home Folder:");
Session.printObjects( contents );
}
}
}

@ -0,0 +1,112 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.ClientX;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
//Include the Saved Query Service Interface
using Teamcenter.Services.Strong.Query;
// Input and output structures for the service operations
// Note: the different namespace from the service interface
using Teamcenter.Services.Strong.Query._2006_03.SavedQuery;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
namespace Teamcenter.Hello
{
public class Query
{
/**
* Perform a simple query of the database
*
*/
public void queryItems()
{
ImanQuery query = null;
// Get the service stub
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
// *****************************
// Execute the service operation
// *****************************
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
Console.Out.WriteLine("There are no saved queries in the system.");
return;
}
// Find one called 'Item Name'
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("Item Name"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
Console.Out.WriteLine("GetSavedQueries service request failed.");
Console.Out.WriteLine(e.Message);
return;
}
if (query == null)
{
Console.WriteLine("There is not an 'Item Name' query.");
return;
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
savedQueryInput[0].MaxNumToReturn = 25;
savedQueryInput[0].LimitListCount = 0;
savedQueryInput[0].LimitList = new Teamcenter.Soa.Client.Model.ModelObject[0];
savedQueryInput[0].Entries = new String[] { "Item Name" };
savedQueryInput[0].Values = new String[1];
savedQueryInput[0].Values[0] = "*";
savedQueryInput[0].MaxNumToInflate = 25;
//*****************************
//Execute the service operation
//*****************************
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
System.Console.Out.WriteLine("");
System.Console.Out.WriteLine("Found Items:");
Teamcenter.ClientX.Session.printObjects( found.Objects );
}
catch (ServiceException e)
{
Console.Out.WriteLine("ExecuteSavedQuery service request failed.");
Console.Out.WriteLine(e.Message);
return;
}
}
}
}

@ -0,0 +1,735 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5503038E-4D69-4703-9F79-90C8D9061A70}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HelloTeamcenter</RootNamespace>
<AssemblyName>OriginAutocad</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkVersion>v3.0</TargetFrameworkVersion>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<StartupObject>
</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="acdbmgd, Version=18.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ObjectARX2010\acdbmgd.dll</HintPath>
</Reference>
<Reference Include="acmgd, Version=18.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ObjectARX2010\acmgd.dll</HintPath>
</Reference>
<Reference Include="Autodesk.AutoCAD.Interop, Version=18.0.0.0, Culture=neutral, PublicKeyToken=eed84259d7cbf30b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ObjectARX2010\inc-win32\Autodesk.AutoCAD.Interop.dll</HintPath>
</Reference>
<Reference Include="Autodesk.AutoCAD.Interop.Common, Version=18.0.0.0, Culture=neutral, PublicKeyToken=eed84259d7cbf30b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ObjectARX2010\inc-win32\Autodesk.AutoCAD.Interop.Common.dll</HintPath>
</Reference>
<Reference Include="FCCNetClientProxyv80, Version=8.2.0.0, Culture=neutral, PublicKeyToken=0074cebd077fc3ec, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\FCCNetClientProxyv80.dll</HintPath>
</Reference>
<Reference Include="FMSNetTicketv80, Version=1.0.0.0, Culture=neutral, PublicKeyToken=13154ac4654a9a4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\FMSNetTicketv80.dll</HintPath>
</Reference>
<Reference Include="FSCNetClientProxyv80, Version=8.2.0.0, Culture=neutral, PublicKeyToken=0074cebd077fc3ec, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\FSCNetClientProxyv80.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="TcSoaAdministrationStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAdministrationStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAdministrationTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAdministrationTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaAiStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAiStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAiTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAiTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaAllocationsStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAllocationsStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAllocationsTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAllocationsTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaAsbAsmAlignmentStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAsbAsmAlignmentStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAsbAsmAlignmentTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAsbAsmAlignmentTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaAsBuiltStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAsBuiltStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAsBuiltTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAsBuiltTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaAsMaintainedStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAsMaintainedStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAsMaintainedTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAsMaintainedTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaAuthorizedDataAccessStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAuthorizedDataAccessStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaAuthorizedDataAccessTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaAuthorizedDataAccessTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaBomStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaBomStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaBomTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaBomTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaBusinessModelerStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaBusinessModelerStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaBusinessModelerTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaBusinessModelerTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadBomAlignmentStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCadBomAlignmentStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadBomAlignmentTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCadBomAlignmentTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCadStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCadTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaCaeStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCaeStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCaeTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCaeTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaCalendarManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCalendarManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCalendarManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaCalendarManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaChangeManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaChangeManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaChangeManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaChangeManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaClassificationStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaClassificationStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaClassificationTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaClassificationTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaClient, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaClient.dll</HintPath>
</Reference>
<Reference Include="TcSoaCommon, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaCommon.dll</HintPath>
</Reference>
<Reference Include="TcSoaConfigurationStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaConfigurationStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaConfigurationTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaConfigurationTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaCoreStrong, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaCoreStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCoreTypes, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaCoreTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaDocumentManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaDocumentManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaDocumentManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaDocumentManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaFMS, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaFMS.dll</HintPath>
</Reference>
<Reference Include="TcSoaGlobalMultiSiteStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaGlobalMultiSiteStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaGlobalMultiSiteTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaGlobalMultiSiteTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaImportExportStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaImportExportStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaImportExportTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaImportExportTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaIssueManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaIssueManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaIssueManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaIssueManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaManufacturingStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaManufacturingStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaManufacturingTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaManufacturingTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaMESStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaMESStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaMESTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaMESTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaMultisiteStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaMultisiteStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaMultisiteTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaMultisiteTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaParameterManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaParameterManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaParameterManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaParameterManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaProductionManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaProductionManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaProductionManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaProductionManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaProjectManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaProjectManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaProjectManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaProjectManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaQueryStrong, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaQueryStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaQueryTypes, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaQueryTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaRdvStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaRdvStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaRdvTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaRdvTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaReportsStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaReportsStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaReportsTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaReportsTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaRequirementsManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaRequirementsManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaRequirementsManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaRequirementsManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaSrmIntegrationStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaSrmIntegrationStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaSrmIntegrationTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaSrmIntegrationTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModel, Version=2007.1.0.425, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\libs\TcSoaStrongModel.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelAcadGmo, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelAcadGmo.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelAdsFoundation, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelAdsFoundation.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelAsBuilt, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelAsBuilt.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelAsMaintained, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelAsMaintained.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelBrndMgmt, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelBrndMgmt.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCba, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCba.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCcdm, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCcdm.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCm, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCm.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCmtEbop, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCmtEbop.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCmtEmserver, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCmtEmserver.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCmtPadTwp, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCmtPadTwp.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelContmgmtBase, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelContmgmtBase.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelContmgmtDita, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelContmgmtDita.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelContmgmtS1000d, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelContmgmtS1000d.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelCpgMaterials, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelCpgMaterials.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelDpv, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelDpv.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEdaLibrary, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEdaLibrary.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEdaServer, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEdaServer.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEmps, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEmps.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEsddm, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEsddm.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEsddmScm, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEsddmScm.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEsmBase, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEsmBase.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEsmProcessor, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEsmProcessor.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelEsmSoftware, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelEsmSoftware.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelFpMgmt, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelFpMgmt.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelGmdpv, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelGmdpv.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelGmo, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelGmo.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelHrn, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelHrn.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelIssueManagement, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelIssueManagement.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelMES, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelMES.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelMROCore, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelMROCore.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelPkgArt, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelPkgArt.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelProductVariant, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelProductVariant.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelScdt, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelScdt.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelScmCc, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelScmCc.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelServiceEventManagement, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelServiceEventManagement.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelServiceProcessing, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelServiceProcessing.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelServiceRequest, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelServiceRequest.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelSpecMgr, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelSpecMgr.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelTcae, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelTcae.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelTransactionProcessing, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelTransactionProcessing.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModelVendorManagement, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStrongModelVendorManagement.dll</HintPath>
</Reference>
<Reference Include="TcSoaStructureManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStructureManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaStructureManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaStructureManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaSvcProcessingStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaSvcProcessingStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaSvcProcessingTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaSvcProcessingTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaSvcRequestStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaSvcRequestStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaSvcRequestTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaSvcRequestTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaTranslationStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaTranslationStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaTranslationTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaTranslationTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaValidationStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaValidationStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaValidationTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaValidationTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaVendorManagementStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaVendorManagementStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaVendorManagementTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaVendorManagementTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaWireHarnessStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaWireHarnessStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaWireHarnessTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaWireHarnessTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaWorkflowStrong, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaWorkflowStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaWorkflowTypes, Version=8000.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\TcSoaWorkflowTypes.dll</HintPath>
</Reference>
<Reference Include="Teamcenter_SSO, Version=8.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\Teamcenter_SSO.dll</HintPath>
</Reference>
<Reference Include="Teamcenter_SSOloader, Version=8.3.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\soa_client\net\libs\Teamcenter_SSOloader.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="clientx\AppXCredentialManager.cs" />
<Compile Include="clientx\AppXDeletedObjectListener.cs" />
<Compile Include="clientx\AppXExceptionHandler.cs" />
<Compile Include="clientx\AppXPartialErrorListener.cs" />
<Compile Include="clientx\AppXRequestListener.cs" />
<Compile Include="clientx\AppXUpdateObjectListener.cs" />
<Compile Include="clientx\Session.cs" />
<Compile Include="form\Login.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\Login.Designer.cs">
<DependentUpon>Login.cs</DependentUpon>
</Compile>
<Compile Include="form\OpenFromTC.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\OpenFromTC.Designer.cs">
<DependentUpon>OpenFromTC.cs</DependentUpon>
</Compile>
<Compile Include="form\SaveToTC.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\SaveToTC.Designer.cs">
<DependentUpon>SaveToTC.cs</DependentUpon>
</Compile>
<Compile Include="form\Search.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\Search.Designer.cs">
<DependentUpon>Search.cs</DependentUpon>
</Compile>
<Compile Include="hello\BTLClass.cs" />
<Compile Include="hello\DataManagement.cs" />
<Compile Include="hello\Hello.cs" />
<Compile Include="hello\HomeFolder.cs" />
<Compile Include="hello\MXLClass.cs" />
<Compile Include="hello\MyExtension.cs" />
<Compile Include="hello\OriginBTL.cs" />
<Compile Include="hello\OriginDataSet.cs" />
<Compile Include="hello\OriginItemType.cs" />
<Compile Include="hello\OriginMXL.cs" />
<Compile Include="hello\OriginReadXml.cs" />
<Compile Include="hello\OriginTool.cs" />
<Compile Include="hello\OriginTypeRule.cs" />
<Compile Include="hello\Query.cs" />
<Compile Include="hello\Tool.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="form\Login.resx">
<DependentUpon>Login.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\OpenFromTC.resx">
<DependentUpon>OpenFromTC.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\SaveToTC.resx">
<DependentUpon>SaveToTC.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\Search.resx">
<DependentUpon>Search.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="res\autocad_01.ico" />
<Content Include="res\FOLDER.ICO" />
<Content Include="res\FOLDEROP.ICO" />
<Content Include="res\item.ico" />
<Content Include="res\itemrev.ico" />
<Content Include="res\login.bmp" />
<Content Include="res\mail.ico" />
<Content Include="res\Newstuff_Folder.png" />
<Content Include="res\tai.ico" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

@ -0,0 +1,17 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<ErrorReportUrlHistory>
</ErrorReportUrlHistory>
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
</Project>

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloTeamcenter", "HelloTeamcenter.csproj", "{5503038E-4D69-4703-9F79-90C8D9061A70}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5503038E-4D69-4703-9F79-90C8D9061A70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -0,0 +1,41 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Windows;
using HelloTeamcenter.hello;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HelloTeamcenter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Siemens Product Lifecycle Management Software Inc.")]
[assembly: AssemblyProduct("HelloTeamcenter")]
[assembly: AssemblyCopyright("Copyright 2008 Siemens Product Lifecycle Management Software Inc.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6ce4adbe-4247-464b-8d53-e3ecb88955fd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,119 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:2.0.50727.3623
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace HelloTeamcenter.Properties {
using System;
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HelloTeamcenter.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 为使用此强类型资源类的所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap autocad_01 {
get {
object obj = ResourceManager.GetObject("autocad_01", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap FOLDER {
get {
object obj = ResourceManager.GetObject("FOLDER", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap FOLDEROP {
get {
object obj = ResourceManager.GetObject("FOLDEROP", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap item {
get {
object obj = ResourceManager.GetObject("item", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap itemrev {
get {
object obj = ResourceManager.GetObject("itemrev", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap login {
get {
object obj = ResourceManager.GetObject("login", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap Newstuff_Folder {
get {
object obj = ResourceManager.GetObject("Newstuff_Folder", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap tai {
get {
object obj = ResourceManager.GetObject("tai", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="autocad_01" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\autocad_01.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FOLDER" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\FOLDER.ICO;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FOLDEROP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\FOLDEROP.ICO;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="item" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\item.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="itemrev" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\itemrev.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="login" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\login.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Newstuff_Folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\Newstuff_Folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="tai" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\tai.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>

@ -0,0 +1,146 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.IO;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Soa;
using Teamcenter.Soa.Common;
using Teamcenter.Soa.Client;
using Teamcenter.Soa.Exceptions;
namespace Teamcenter.ClientX
{
/**
* The CredentialManager is used by the Teamcenter Services framework to get the
* user's credentials when challanged by the server. This can occur after a period
* of inactivity and the server has timed-out the user's session, at which time
* the client application will need to re-authenitcate. The framework will
* call one of the getCredentials methods (depending on circumstances) and will
* send the SessionService.login service request. Upon successfull completion of
* the login service request. The last service request (one that cuased the challange)
* will be resent.
*
* The framework will also call the setUserPassword setGroupRole methods when ever
* these credentials change, thus allowing this implementation of the CredentialManager
* to cache these values so prompting of the user is not requried for re-authentication.
*
*/
public class AppXCredentialManager : CredentialManager
{
private String name = null;
private String password = null;
private String group = ""; // default group
private String role = ""; // default role
private String discriminator = "SoaAppX"; // always connect same user
// to same instance of server
/**
* Return the type of credentials this implementation provides,
* standard (user/password) or Single-Sign-On. In this case
* Standard credentials are returned.
*
* @see com.teamcenter.soa.client.CredentialManager#getCredentialType()
*/
public int CredentialType
{
get { return SoaConstants.CLIENT_CREDENTIAL_TYPE_STD; }
}
/**
* Prompt's the user for credentials.
* This method will only be called by the framework when a login attempt has
* failed.
*
* @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException)
*/
public string[] GetCredentials(InvalidCredentialsException e)
//throws CanceledOperationException
{
Console.WriteLine(e.Message);
return PromptForCredentials();
}
/**
* Return the cached credentials.
* This method will be called when a service request is sent without a valid
* session ( session has expired on the server).
*
* @see com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException)
*/
public String[] GetCredentials(InvalidUserException e)
//throws CanceledOperationException
{
// Have not logged in yet, shoult not happen but just in case
if (name == null) return PromptForCredentials();
// Return cached credentials
String[] tokens = { name, password, group, role, discriminator };
return tokens;
}
/**
* Cache the group and role
* This is called after the SessionService.setSessionGroupMember service
* operation is called.
*
* @see com.teamcenter.soa.client.CredentialManager#setGroupRole(java.lang.String,
* java.lang.String)
*/
public void SetGroupRole(String group, String role)
{
this.group = group;
this.role = role;
}
/**
* Cache the User and Password
* This is called after the SessionService.login service operation is called.
*
* @see com.teamcenter.soa.client.CredentialManager#setUserPassword(java.lang.String,
* java.lang.String, java.lang.String)
*/
public void SetUserPassword(String user, String password, String discriminator)
{
this.name = user;
this.password = password;
this.discriminator = discriminator;
}
public String[] PromptForCredentials()
//throws CanceledOperationException
{
try
{
Console.WriteLine("Please enter user credentials (return to quit):");
Console.Write("User Name: ");
name = Console.ReadLine();
if (name.Length == 0)
throw new CanceledOperationException("");
Console.Write("Password: ");
password = Console.ReadLine();
}
catch (IOException e)
{
String message = "Failed to get the name and password.\n" + e.Message;
Console.WriteLine(message);
throw new CanceledOperationException(message);
}
String[] tokens = { name, password, group, role, discriminator };
return tokens;
}
}
}

@ -0,0 +1,38 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client.Model;
namespace Teamcenter.ClientX
{
/**
* Implementation of the DeleteListener, simply prints out list of all objects
* that are deleted.
*
*/
public class AppXDeletedObjectListener : DeleteListener
{
public void ModelObjectDelete(string[] uids)
{
if (uids.Length == 0)
return;
System.Console.WriteLine("");
System.Console.WriteLine("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete");
System.Console.WriteLine("The following objects have been deleted from the server and removed from the client data model:");
for (int i = 0; i < uids.Length; i++)
{
System.Console.WriteLine(" " + uids[i]);
}
}
}
}

@ -0,0 +1,101 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.IO;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Soa.Client;
using Teamcenter.Soa.Exceptions;
namespace Teamcenter.ClientX
{
/**
* Implementation of the ExceptionHandler. For ConnectionExceptions (server
* temporarily down .etc) prompts the user to retry the last request. For other
* exceptions convert to a RunTime exception.
*/
public class AppXExceptionHandler : ExceptionHandler
{
/*
* (non-Javadoc)
*
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException)
*/
public void HandleException(InternalServerException ise)
{
Console.WriteLine("");
Console.WriteLine("*****");
Console.WriteLine("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException).");
if (ise is ConnectionException)
{
// ConnectionException are typically due to a network error (server
// down .etc) and can be recovered from (the last request can be sent again,
// after the problem is corrected).
Console.Write("\nThe server returned an connection error.\n" + ise.Message
+ "\nDo you wish to retry the last service request?[y/n]");
}
else if (ise is ProtocolException)
{
// ProtocolException are typically due to programming errors
// (content of HTTP
// request is incorrect). These are generally can not be
// recovered from.
Console.Write("\nThe server returned an protocol error.\n" + ise.Message
+ "\nThis is most likely the result of a programming error."
+ "\nDo you wish to retry the last service request?[y/n]");
}
else
{
Console.WriteLine("\nThe server returned an internal server error.\n"
+ ise.Message
+ "\nThis is most likely the result of a programming error."
+ "\nA RuntimeException will be thrown.");
throw new SystemException(ise.Message);
}
try
{
String retry = Console.ReadLine();
// If yes, return to the calling SOA client framework, where the
// last service request will be resent.
if (retry.ToLower().Equals("y") || retry.ToLower().Equals("yes"))
return;
throw new SystemException("The user has opted not to retry the last request");
}
catch (IOException e)
{
Console.Error.WriteLine("Failed to read user response.\nA RuntimeException will be thrown.");
throw new SystemException(e.Message);
}
}
/*
* (non-Javadoc)
*
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException)
*/
public void HandleException(CanceledOperationException coe)
{
Console.WriteLine("");
Console.WriteLine("*****");
Console.WriteLine("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(CanceledOperationException).");
// Expecting this from the login tests with bad credentials, and the
// AnyUserCredentials class not
// prompting for different credentials
throw new SystemException(coe.Message);
}
}
}

@ -0,0 +1,68 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client.Model;
namespace Teamcenter.ClientX
{
/**
* Implementation of the PartialErrorListener. Print out any partial errors
* returned.
*
*/
public class AppXPartialErrorListener : PartialErrorListener
{
/*
* (non-Javadoc)
*
* @see com.teamcenter.soa.client.model.PartialErrorListener#handlePartialError(com.teamcenter.soa.client.model.ErrorStack[])
*/
public void HandlePartialError(ErrorStack[] stacks)
{
if (stacks.Length == 0) return;
Console.WriteLine("");
Console.WriteLine("*****");
Console.WriteLine("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener.");
for (int i = 0; i < stacks.Length; i++)
{
ErrorValue[] errors = stacks[i].ErrorValues;
Console.Write("Partial Error for ");
// The different service implementation may optionally associate
// an ModelObject, client ID, or nothing, with each partial error
if (stacks[i].HasAssociatedObject() )
{
Console.WriteLine("object "+ stacks[i].AssociatedObject.Uid);
}
else if (stacks[i].HasClientId())
{
Console.WriteLine("client id "+ stacks[i].ClientId);
}
else if (stacks[i].HasClientIndex())
{
Console.WriteLine("client index " + stacks[i].ClientIndex);
}
// Each Partial Error will have one or more contributing error messages
for (int j = 0; j < errors.Length; j++)
{
Console.WriteLine(" Code: " + errors[j].Code + "\tSeverity: "
+ errors[j].Level + "\t" + errors[j].Message);
}
}
}
}
}

@ -0,0 +1,42 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client;
namespace Teamcenter.ClientX
{
/**
* This implemenation of the RequestListener, logs each service request
* to the console.
*
*/
public class AppXRequestListener : RequestListener
{
/**
* Called before each request is sent to the server.
*/
public void ServiceRequest(ServiceInfo info)
{
// will log the service name when done
}
/**
* Called after each response from the server.
* Log the service operation to the console.
*/
public void ServiceResponse(ServiceInfo info)
{
Console.WriteLine(info.Id + ": " + info.Service + "." + info.Operation);
}
}
}

@ -0,0 +1,48 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
namespace Teamcenter.ClientX
{
/**
* Implementation of the ChangeListener. Print out all objects that have been updated.
*
*/
public class AppXUpdateObjectListener : ChangeListener
{
public void ModelObjectChange(ModelObject[] objects)
{
if (objects.Length == 0) return;
System.Console.WriteLine("");
System.Console.WriteLine("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange");
System.Console.WriteLine("The following objects have been updated in the client data model:");
for (int i = 0; i < objects.Length; i++)
{
String uid = objects[i].Uid;
String type = objects[i].GetType().Name;
String name = "";
if (objects[i].GetType().Name.Equals("WorkspaceObject"))
{
ModelObject wo = objects[i];
try
{
name = wo.GetProperty("object_string").StringValue;
}
catch (NotLoadedException /*e*/) {} // just ignore
}
System.Console.WriteLine(" " + uid + " " + type + " " + name);
}
}
}
}

@ -0,0 +1,278 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.Collections;
using System.Net;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Services.Strong.Core._2006_03.Session;
using Teamcenter.Soa;
using Teamcenter.Soa.Client;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using User = Teamcenter.Soa.Client.Model.Strong.User;
namespace Teamcenter.ClientX
{
public class Session
{
/**
* Single instance of the Connection object that is shared throughtout
* the application. This Connection object is needed whenever a Service
* stub is instantiated.
*/
private static Connection connection;
/**
* The credentialManager is used both by the Session class and the Teamcenter
* Services Framework to get user credentials.
*
*/
private static AppXCredentialManager credentialManager;
/**
* Create an instance of the Session with a connection to the specified
* server.
*
* Add implementations of the ExceptionHandler, PartialErrorListener,
* ChangeListener, and DeleteListeners.
*
* @param host Address of the host to connect to, http://serverName:port/tc
*/
public Session(String host)
{
// Create an instance of the CredentialManager, this is used
// by the SOA Framework to get the user's credentials when
// challanged by the server (sesioin timeout on the web tier).
credentialManager = new AppXCredentialManager();
// Create the Connection object, no contact is made with the server
// until a service request is made
connection = new Connection(host, new CookieCollection(), credentialManager, SoaConstants.REST,
SoaConstants.HTTP, false);
// Add an ExceptionHandler to the Connection, this will handle any
// InternalServerException, communication errors, xml marshalling errors
// .etc
connection.ExceptionHandler = new AppXExceptionHandler();
// While the above ExceptionHandler is required, all of the following
// Listeners are optional. Client application can add as many or as few Listeners
// of each type that they want.
// Add a Partial Error Listener, this will be notified when ever a
// a service returns partial errors.
connection.ModelManager.AddPartialErrorListener(new AppXPartialErrorListener());
// Add a Change Listener, this will be notified when ever a
// a service returns model objects that have been updated.
connection.ModelManager.AddChangeListener(new AppXUpdateObjectListener());
// Add a Delete Listener, this will be notified when ever a
// a service returns objects that have been deleted.
connection.ModelManager.AddDeleteListener(new AppXDeletedObjectListener());
// Add a Request Listener, this will be notified before and after each
// service request is sent to the server.
Connection.AddRequestListener(new AppXRequestListener());
}
/**
* Get the single Connection object for the application
*
* @return connection
*/
public static Connection getConnection()
{
return connection;
}
/**
* Login to the Teamcenter Server
*
*/
public User login()
{
// Get the service stub
SessionService sessionService = SessionService.getService(connection);
try
{
// Prompt for credentials until they are right, or until user
// cancels
String[] credentials = credentialManager.PromptForCredentials();
while (true)
{
try
{
// *****************************
// Execute the service operation
// *****************************
LoginResponse resp = sessionService.Login(credentials[0], credentials[1],
credentials[2], credentials[3],"",credentials[4]);
return resp.User;
}
catch (InvalidCredentialsException e)
{
credentials = credentialManager.GetCredentials(e);
}
}
}
// User canceled the operation, don't need to tell him again
catch (CanceledOperationException /*e*/) {}
// Exit the application
//System.exit(0);
return null;
}
public User mylogin(string username,string password,string usergroup,string userrole)
{
// Get the service stub
SessionService sessionService = SessionService.getService(connection);
try
{
while (true)
{
try
{
// *****************************
// Execute the service operation
// *****************************
LoginResponse resp = sessionService.Login(username, password,
usergroup, userrole, "", "");
return resp.User;
}
catch (InvalidCredentialsException e)
{
return null;
}
}
}
// User canceled the operation, don't need to tell him again
catch (CanceledOperationException /*e*/) { }
// Exit the application
//System.exit(0);
return null;
}
/**
* Terminate the session with the Teamcenter Server
*
*/
public void logout()
{
// Get the service stub
SessionService sessionService = SessionService.getService(connection);
try
{
// *****************************
// Execute the service operation
// *****************************
sessionService.Logout();
}
catch (ServiceException /*e*/) { }
}
/**
* Print some basic information for a list of objects
*
* @param objects
*/
public static void printObjects(ModelObject[] objects)
{
if(objects == null)
return;
// Ensure that the referenced User objects that we will use below are loaded
getUsers( objects );
Console.WriteLine("Name\t\tOwner\t\tLast Modified");
Console.WriteLine("====\t\t=====\t\t=============");
for (int i = 0; i < objects.Length; i++)
{
if(!(objects[i] is WorkspaceObject ))
continue;
WorkspaceObject wo = (WorkspaceObject)objects[i];
try
{
String name = wo.Object_string;
User owner = (User) wo.Owning_user;
DateTime lastModified =wo.Last_mod_date;
Console.WriteLine(name + "\t" + owner.User_name + "\t" + lastModified.ToString());
}
catch (NotLoadedException e)
{
// Print out a message, and skip to the next item in the folder
// Could do a DataManagementService.getProperties call at this point
Console.WriteLine(e.Message);
Console.WriteLine("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
}
}
}
private static void getUsers(ModelObject[] objects)
{
if(objects == null)
return;
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
ArrayList unKnownUsers = new ArrayList();
for (int i = 0; i < objects.Length; i++)
{
if(!(objects[i] is WorkspaceObject ))
continue;
WorkspaceObject wo = (WorkspaceObject)objects[i];
User owner = null;
try
{
owner = (User) wo.Owning_user;
String userName = owner.User_name;
}
catch (NotLoadedException /*e*/)
{
if(owner != null)
unKnownUsers.Add(owner);
}
}
User[] users = new User[unKnownUsers.Count];
unKnownUsers.CopyTo( users );
String[] attributes = { "user_name" };
// *****************************
// Execute the service operation
// *****************************
dmService.GetProperties(users, attributes);
}
}
}

@ -0,0 +1,206 @@
namespace HelloTeamcenter.form
{
partial class Login
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Login));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(405, 31);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(58, 13);
this.label1.TabIndex = 1;
this.label1.Text = "连接到: ";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(405, 75);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(58, 13);
this.label2.TabIndex = 2;
this.label2.Text = "用户名: ";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(405, 114);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(52, 13);
this.label3.TabIndex = 3;
this.label3.Text = "密 码: ";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(405, 154);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(58, 13);
this.label4.TabIndex = 4;
this.label4.Text = "所在组: ";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(405, 191);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(52, 13);
this.label5.TabIndex = 5;
this.label5.Text = "角 色: ";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(457, 27);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(120, 20);
this.textBox1.TabIndex = 6;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(457, 68);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(120, 20);
this.textBox2.TabIndex = 7;
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(457, 107);
this.textBox3.Name = "textBox3";
this.textBox3.PasswordChar = '*';
this.textBox3.Size = new System.Drawing.Size(120, 20);
this.textBox3.TabIndex = 8;
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(457, 148);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(120, 20);
this.textBox4.TabIndex = 9;
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(457, 186);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(120, 20);
this.textBox5.TabIndex = 10;
//
// button1
//
this.button1.Location = new System.Drawing.Point(407, 231);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 25);
this.button1.TabIndex = 11;
this.button1.Text = "登录";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Location = new System.Drawing.Point(502, 231);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 25);
this.button2.TabIndex = 12;
this.button2.Text = "取消";
this.button2.UseVisualStyleBackColor = true;
//
// pictureBox1
//
this.pictureBox1.Image = global::HelloTeamcenter.Properties.Resources.login;
this.pictureBox1.Location = new System.Drawing.Point(7, 13);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(383, 216);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// Login
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(590, 269);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox5);
this.Controls.Add(this.textBox4);
this.Controls.Add(this.textBox3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Login";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "登录";
this.TopMost = true;
this.Load += new System.EventHandler(this.Login_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.PictureBox pictureBox1;
public System.Windows.Forms.Label label1;
public System.Windows.Forms.Label label2;
public System.Windows.Forms.Label label3;
public System.Windows.Forms.Label label4;
public System.Windows.Forms.Label label5;
public System.Windows.Forms.TextBox textBox1;
public System.Windows.Forms.TextBox textBox2;
public System.Windows.Forms.TextBox textBox3;
public System.Windows.Forms.TextBox textBox4;
public System.Windows.Forms.TextBox textBox5;
public System.Windows.Forms.Button button1;
public System.Windows.Forms.Button button2;
}
}

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using System.IO;
using Teamcenter.Hello;
using Teamcenter.ClientX;
namespace HelloTeamcenter.form
{
public partial class Login : Form
{
public Login()
{
InitializeComponent();
}
public string m_WebAddress = "http://localhost:7001/tc";
public string username = "";
public string password = "";
public string usergroup = "";
public string userrole = "";
public Document appodc;
private void Login_Load(object sender, EventArgs e)
{
string tempdir = System.Environment.GetEnvironmentVariable("TEMP").ToString();
Editor ed = appodc.Editor;
ed.WriteMessage("login文件路径" + tempdir + "\n");
string loginfile = tempdir + "\\login.ini";
if (File.Exists(loginfile))
{
StreamReader sr = new StreamReader(loginfile);
string line;
if ((line = sr.ReadLine()) != null)
{
string[] ans = line.Split('|');
for (int i = 0; i < ans.Length; i++)
{
if (i == 0)
m_WebAddress = ans[i].ToString();
if (i == 1)
username = ans[i].ToString();
if (i == 3)
usergroup = ans[i].ToString();
if (i == 4)
userrole = ans[i].ToString();
}
}
sr.Close();
}
textBox1.Text = m_WebAddress;
textBox2.Text = username;
textBox3.Text = password;
textBox4.Text = usergroup;
textBox4.Text = userrole;
}
}
}

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAECAAAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8A///////////0bm5ubm5ub/Rs6IjoiEzv9G6Pd4d3Tm/0bP/3f/dM7/Ru/45v905v9Gz/jO/3
TO/0bn/2b/dOb/Rs5///90zv9G5ubm/3Tm/0bPeIf/bs7/Rub///fm5v9Gzs53zs7O/0xsbGxsbGz/RE
RERERERP//////////8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//wAA//8AAP//
</value>
</data>
</root>

@ -0,0 +1,135 @@
namespace HelloTeamcenter.form
{
partial class OpenFromTC
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OpenFromTC));
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.treeView1 = new System.Windows.Forms.TreeView();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 333);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(79, 13);
this.label1.TabIndex = 1;
this.label1.Text = "数据集名称:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(105, 329);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(197, 20);
this.textBox1.TabIndex = 2;
this.textBox1.TabStop = false;
//
// button1
//
this.button1.Location = new System.Drawing.Point(446, 324);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 25);
this.button1.TabIndex = 3;
this.button1.Tag = "";
this.button1.Text = "确定";
this.button1.UseVisualStyleBackColor = true;
//
// button2
//
this.button2.Location = new System.Drawing.Point(446, 355);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 25);
this.button2.TabIndex = 4;
this.button2.Text = "查找->";
this.button2.UseVisualStyleBackColor = true;
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "autocad_01.ico");
this.imageList1.Images.SetKeyName(1, "FOLDER.ICO");
this.imageList1.Images.SetKeyName(2, "FOLDEROP.ICO");
this.imageList1.Images.SetKeyName(3, "item.ico");
this.imageList1.Images.SetKeyName(4, "itemrev.ico");
this.imageList1.Images.SetKeyName(5, "mail.ico");
this.imageList1.Images.SetKeyName(6, "Newstuff_Folder.png");
this.imageList1.Images.SetKeyName(7, "tai.ico");
//
// treeView1
//
this.treeView1.ImageIndex = 7;
this.treeView1.ImageList = this.imageList1;
this.treeView1.Location = new System.Drawing.Point(14, 13);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = 7;
this.treeView1.Size = new System.Drawing.Size(509, 304);
this.treeView1.TabIndex = 5;
this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick);
//
// OpenFromTC
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(538, 386);
this.Controls.Add(this.treeView1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "OpenFromTC";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "打开";
this.TopMost = true;
this.Load += new System.EventHandler(this.OpenFromTC_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.Label label1;
public System.Windows.Forms.TextBox textBox1;
public System.Windows.Forms.Button button1;
public System.Windows.Forms.Button button2;
public System.Windows.Forms.ImageList imageList1;
public System.Windows.Forms.TreeView treeView1;
}
}

@ -0,0 +1,454 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Teamcenter.Hello;
using Teamcenter.Soa.Client;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Teamcenter.Services.Strong.Query;
using Teamcenter.Services.Strong.Core._2007_06.DataManagement;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
using DataSet = Teamcenter.Soa.Client.Model.Strong.Dataset;
public struct ALLOBJECT
{
public TreeNode treenode;
public WorkspaceObject workobject;
public string name;
public string uid;
}
namespace HelloTeamcenter.form
{
public partial class OpenFromTC : Form
{
public List<ALLOBJECT> alllist = new List<ALLOBJECT>();
public List<ALLOBJECT> folderlist = new List<ALLOBJECT>();
public List<ALLOBJECT> itemlist = new List<ALLOBJECT>();
public List<ALLOBJECT> itemvisionlist = new List<ALLOBJECT>();
public List<ALLOBJECT> datasetlist = new List<ALLOBJECT>();
public OpenFromTC()
{
InitializeComponent();
}
public Document appodc;
public User user;
public bool first = true;
public Folder home = null;
Editor ed;
private void OpenFromTC_Load(object sender, EventArgs e)
{
ed = appodc.Editor;
treeView1.Nodes.Clear();
TreeNode rootnode = new TreeNode("Home", 7, 7);
treeView1.Nodes.Add(rootnode);
WorkspaceObject[] contents = null;
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
try
{
home = user.Home_folder;
}
catch (NotLoadedException ex)
{
ed.WriteMessage(ex.Message);
return;
}
try
{
ModelObject[] objects = { home };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = home.Contents;
}
catch (NotLoadedException ex) { ed.WriteMessage(ex.Message); }
//ALLOBJECT topobject = new ALLOBJECT();
//topobject.treenode = rootnode;
//topobject.workobject = home;
//alllist.Add(topobject);
//folderlist.Add(topobject);
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects = { childobj };
String[] attributes = { "object_string" ,"object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Folder fl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
}
alllist.Add(perobject);
folderlist.Add(perobject);
}
else if (type == "Item" || type == "D5Product"
|| type == "D5AsmPart" || type == "D5Part"
|| type == "D5StdFasteners" || type == "D5CommonParts")
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
alllist.Add(perobject);
itemlist.Add(perobject);
}
}
foreach(TreeNode ch in rootnode.Nodes)
{
ch.EnsureVisible();
}
}
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
//MessageBox.Show("获得");
TreeNode nownode = this.treeView1.SelectedNode;
getChild(nownode);
foreach (TreeNode ch in nownode.Nodes)
{
ch.EnsureVisible();
}
}
private void getChild(TreeNode nownode)
{
nownode.Nodes.Clear();
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
WorkspaceObject[] contents = null;
//dmService.GetProperties(objects, attributes);
string nodetext = nownode.Text;
int imageindex = nownode.SelectedImageIndex;
List<ALLOBJECT> templist = new List<ALLOBJECT>();
if (imageindex == 1)
{
foreach (ALLOBJECT perobject in folderlist)
{
if (perobject.treenode.Equals(nownode))
{
Folder fl = perobject.workobject as Folder;
ModelObject[] objects = { fl };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = fl.Contents;
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects1 = { childobj };
String[] attributes1 = { "object_string", "object_type" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = childobj;
Folder infl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
templist.Add(inperobject);
folderlist.Add(inperobject);
}
else if (type == "Item" || type == "D5Product"
|| type == "D5AsmPart" || type == "D5Part"
|| type == "D5StdFasteners" || type == "D5CommonParts")
{
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
templist.Add(inperobject);
itemlist.Add(inperobject);
}
}
break;
}
}
if (templist.Count > 0 && templist != null)
{
alllist.AddRange(templist);
templist.Clear();
}
return;
}
else if (imageindex == 3)
{
foreach (ALLOBJECT perobject in itemlist)
{
if (perobject.treenode.Equals(nownode))
{
Item item = perobject.workobject as Item;
ModelObject[] itemrevisionlist = null;
ModelObject[] objects = { item };
String[] attributes = { "revision_list" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
itemrevisionlist = item.Revision_list;
for (int i = 0; i < itemrevisionlist.Length; i++)
{
ItemRevision itemrevision = itemrevisionlist[i] as ItemRevision;
ModelObject[] objects1 = { itemrevision };
String[] attributes1 = { "object_string", "object_type" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
string name = itemrevision.Object_string;
string type = itemrevision.Object_type;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = itemrevision;
TreeNode childnode = new TreeNode(name, 4, 4);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
templist.Add(inperobject);
itemvisionlist.Add(inperobject);
}
break;
}
}
if (templist.Count > 0 && templist != null)
{
alllist.AddRange(templist);
templist.Clear();
}
return;
}
else if (imageindex == 4)
{
foreach (ALLOBJECT perobject in itemvisionlist)
{
if (perobject.treenode.Equals(nownode))
{
ItemRevision itemrevision = perobject.workobject as ItemRevision;
ExpandGRMRelationsPref myPref = new ExpandGRMRelationsPref();
RelationAndTypesFilter2 myFilter = new RelationAndTypesFilter2();
myFilter.RelationName = "IMAN_specification";
String[] typeVec = { "D5DWG", "Folder" };
myFilter.ObjectTypeNames = typeVec;
myPref.ExpItemRev = false;
RelationAndTypesFilter2[] myfilter = { myFilter };
myPref.Info = myfilter;
ModelObject[] objects1 = { itemrevision };
ExpandGRMRelationsResponse myResp = dmService.ExpandGRMRelationsForPrimary(objects1,myPref);
ExpandGRMRelationsOutput[] myoutput = myResp.Output;
for (int i = 0; i < myoutput.Length; i++)
{
ExpandGRMRelationsOutput one_out = myoutput[i];
for (int j = 0; j < one_out.OtherSideObjData.Length; j++)
{
ExpandGRMRelationsData otherSideData = one_out.OtherSideObjData[j];
for (int k = 0; k < otherSideData.OtherSideObjects.Length; k++)
{
Type typeinfo = otherSideData.OtherSideObjects[k].GetType();
string typename = typeinfo.Name;
if (typename == "Folder")
{
Folder infold = otherSideData.OtherSideObjects[k] as Folder;
ModelObject[] objects = { infold };
String[] attributes = { "object_string", "object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = infold.Object_string;
string type = infold.Object_type;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = infold;
TreeNode childnode = new TreeNode(name, 1, 1);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
templist.Add(inperobject);
folderlist.Add(inperobject);
}
else
{
DataSet dateset = otherSideData.OtherSideObjects[k] as DataSet;
ModelObject[] objects = { dateset };
String[] attributes = { "object_string" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = dateset.Object_string;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = dateset;
inperobject.name = name;
TreeNode childnode = new TreeNode(name, 0, 0);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
templist.Add(inperobject);
datasetlist.Add(inperobject);
}
}
}
}
break;
}
}
if (templist.Count > 0 && templist != null)
{
alllist.AddRange(templist);
templist.Clear();
}
return;
}
else if (imageindex == 6)
{
}
else if(imageindex == 7)
{
alllist.Clear();
folderlist.Clear();
itemlist.Clear();
itemvisionlist.Clear();
datasetlist.Clear();
try
{
ModelObject[] objects = { home };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = home.Contents;
}
catch (NotLoadedException ex) { ed.WriteMessage(ex.Message); }
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects = { childobj };
String[] attributes = { "object_string", "object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Folder fl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
}
alllist.Add(perobject);
folderlist.Add(perobject);
}
else if (type == "Item" || type == "D5Product"
|| type == "D5AsmPart" || type == "D5Part"
|| type == "D5StdFasteners" || type == "D5CommonParts")
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
alllist.Add(perobject);
itemlist.Add(perobject);
}
}
foreach (TreeNode ch in nownode.Nodes)
{
ch.EnsureVisible();
}
}
}
}
}

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABq
EAAAAk1TRnQBSQFMAgEBCAEAARQBAAEUAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8AFQAQ/ycA
AZoCGgHwBQAQ/wMAAvANAAEEEAABGgHwARoBmgHlAVkBUgF5AfAEABD/AgABtAGtAc8BtQHvAgcBvAgA
AuwCBwEAAQMB+wEAAwcEAAIaAcMBGgLDAaABeQFZATIBmQGYAbwB8AEAAf8OAAH/AgABzweLAa4B9wHv
AQcEAALsAv8BAAEDAfsBAAL/AQcEAAGaAsMBGgL2AcMBeQI4AVgBVgFQAZgB8AH/DewBAAH/AgABzwGL
CYoBkgQAAuwC/wEAAQMB+wEAAv8BBwQAAXoDoAEaAvYBmgJZAVgBeAJQAfAB/wHsCwcB7AEAAf8CAAHP
ArIBrAeKAa4EAALsAv8BAAEDAfsBAAL/AQcEAAF6AuUBegJSAZkBGgGaAVkBmQGYAVYBUAHwAf8B7AED
AwcDAwMHAQMB7AEAAf8CAAHPAawFsgSKAZEBvAMAAQQB7AL/BAAC/wEHAwAB8AGaAXoB5QF6ATECUgEc
AZkBmgEaAZgBVwFWAfAB/wHsAfsBAwEHAQMDAAEDAQcBAwEHAewBAAH/AgABtQGtBbMDsgGzAa4BBwQA
AewI/wHsAwAB8AHDAfYBwwF6AVkBOAFYAngBHAGYAZkBmAF4AfAB/wHsAv8BAwEAAv8B+wEAAQMCBwHs
AQAB/wIAAbUBtAG7AroGswGRAQcEAAEDAQAG/wHsAgMCAAHwAZoCwwF6AjgBWAFXAVABSgFyAXMBHAGZ
AfAB/wHsAfsBBwEAAf8B+wP/AQABAwEHAewBAAH/AgABBwG0Aa0CtAEJAbsEugG0Ae8FAAEDAQAE/wHs
AgMB7AIAAfABmgF6AZoBegJZAnkBVgFQAXIBBwMAAf8B7AEHAQAB+wP/AfsC/wEAAQMB7AEAAf8CAAG1
AZkBkAGYAbMBtAEJAhkCCQG1AQcGAAEDAQAC/wHsAgMEAAHwARoBegF5AZkBoAFYAVkBmQJWARwEAAH/
AewBAAP/AfsD/wH7Af8BAAHsAQAB/wEAAbsBtAF5AZkBeQG0AgkEtAG1CAABAwIAAgMHAAHwArwBmQF5
AZkBeAJWAXgEAAH/AewC/wH7A/8B+wP/AfsCAAH/AgAB7wF+AV4BWAEcA7QB1gIJAQcJAAMDAewBAQcA
AbwB8AEIAZgBeAKYAZkBBwQAAf8N7AEAAf8CAAKZAnkBtQHvAwACtQEHDQABAQcAAfABvALwAbwBBwK8
BQAQ/wIAAQcBGgGRArwRAAEEAgABAQgABLwB8AcAEP8EAAHvHAAO8CoAARoB8AG8AfAEAAHvCYEB/wOB
AfAmAAGZARoBegFTAVkBUgF0AQcDAAGyAbkD2gO5AdoBuQH0AtoBuQG8IwACkwFMAXoDoAHlATEBMgFS
AZkCAAGyAtoCswLZAbMBiwGzAfQBswHUAbkBvA7sBAAM7AIAAfACmQEbAf8BmgH2AsMCoAExATgBMgF0
AgABsgOzBtkB9AHZArMBvAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewEAAHsAf8B+wEHAfsBBwH7
AQcB+wEHAfsB7AIAAbwBGgHDAv8BmQH/AvYCwwE3AjgBeQIAAbIBswGyAtkBuAHbAbkB2wGyAfQB2QGy
AbkBvAHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB+wEHAewDAAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwEA
AewBAAG8AZoBoALDAZoB9gP/AfYBNwI4AXkCAAGyAdkBsgG4AbIBuAGKAbIBgQGyAfQB2QGyAbkBvAHs
Af8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewDAAHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB7AEAAewBAAG8
AXkDoAFSAZkCwwEaAZoBegI4AXkCAAGyAdkBuAK5AbgB2QGyAYoB2QH0AdkBsgG5AbwB7AH/AQcB+wEH
AfsBBwH7AQcB+wEHAfsBBwHsAgAB7AH/AQcB+wEHAfsBBwH7AQcB+wEHAfsBAALsAQAB8AF6AuUBegFT
AVIBcwF0AbwB9AH2AXoBWQGZAgABsgLaAbMC3AG5AbgB2QG7Af8BuwGzAdoBvAHsAf8B+wEHAfsBBwH7
AQcB+wEHAfsBBwH7AewCAAHsCv8B7AEAAQcB7AEAARoBmQN6AVkBMQErAUsBUgKZAZoCegIAAYEDswGQ
AYoBgQKzAbsBigG6ArMBBwHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB+wEHAewCAA3sAfsB7AEAAXQBwwH2
AsMBegFZATgBMgFMAZkBGgUAAboB2wK6AdoBugKRAdoBuwS6AQcB7AH/AfsBBwH7AQcB+wEHAfsBBwH7
AQcB+wHsAwAB7AH/AQcB+wEHAfsBBwH7AQcB+wEHAfsBBwHsAQABdAHDAfYC/wGaAzgBUgcAAbkC2wGz
BNkBuAHyAf8B8gHbAdoBvAHsDP8B7AMAAewB/wH7AQcB+wEHAfsBBwX/AewBAAF6AsMC9gEaAfsCOAFS
BwABswTbAQkC3AIJAfQC2wHaAbwB7AEHAfsBBwH7AQcB+wEHBuwDAAHsAf8BBwH7AQcB+wEHAf8G7AEA
AnoCoAJ6AVkB+wE4AXkHAAGzAdsB3AcJAfQBCQHcAdsBvAEAAewBBwH7AQcB+wEHAewKAAHsBf8B7AcA
AnoBWQLlAcMBegJZAZkHAAG5CRkB9AMZAfACAAXsDAAF7AkAAfABGgFSAlkCegFTAXkRAAHwKAAC8AoA
AUIBTQE+BwABPgMAASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD/4EAAv8CAAT/Af4BHwIAAecB/wHA
AQMB4AEPAgABwAE/AcABAwGAAQECAAHAAQMBwAEDAYADAAHAAQMBwAEDAYADAAHAAQMBwAEDAYADAAHA
AQEBwAEDBAABwAEBAYABAQQAAcABAQHAAQEEAAHAAQEB4AEDAQABBwIAAcABAQHwAQcBAAEPAgABgAED
AfgBBwHAAQ8CAAHAAQMB/AEHAeABDwIAAcAB4wH+AScB4AEfAgABwQL/AWcB8AF/AgAB9wP/AYABAQX/
AYcBgAEABP8B/AEDAYABAAGAAQEB4AEAAeABAQGAAgABAQHAAgABAQGAAgABAQHAAgABAQGAAgABAQGA
AgABAQGAAgABAQGAAgABAQGAAgABAQMAAQEBgAIAAQEDAAEBAYACAAEBAwABDwGAAgABAQGAAgABPwGA
AgABAQGAAgABPwGAAgABAwGAAQEBAAE/AYABAAGAAf8BwAF/AQABPwGAAQABwQH/AeAB/wGAAT8B/wHv
BP8B8wH/Cw==
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAECAAAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8A///////////0bm5ubm5ub/Rs6IjoiEzv9G6Pd4d3Tm/0bP/3f/dM7/Ru/45v905v9Gz/jO/3
TO/0bn/2b/dOb/Rs5///90zv9G5ubm/3Tm/0bPeIf/bs7/Rub///fm5v9Gzs53zs7O/0xsbGxsbGz/RE
RERERERP//////////8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//wAA//8AAP//
</value>
</data>
</root>

@ -0,0 +1,120 @@
namespace HelloTeamcenter.form
{
partial class SaveToTC
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SaveToTC));
this.treeView1 = new System.Windows.Forms.TreeView();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.ImageIndex = 7;
this.treeView1.ImageList = this.imageList1;
this.treeView1.Location = new System.Drawing.Point(12, 13);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = 7;
this.treeView1.Size = new System.Drawing.Size(491, 323);
this.treeView1.TabIndex = 6;
this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick);
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "autocad_01.ico");
this.imageList1.Images.SetKeyName(1, "FOLDER.ICO");
this.imageList1.Images.SetKeyName(2, "FOLDEROP.ICO");
this.imageList1.Images.SetKeyName(3, "item.ico");
this.imageList1.Images.SetKeyName(4, "itemrev.ico");
this.imageList1.Images.SetKeyName(5, "mail.ico");
this.imageList1.Images.SetKeyName(6, "Newstuff_Folder.png");
this.imageList1.Images.SetKeyName(7, "tai.ico");
//
// button1
//
this.button1.Location = new System.Drawing.Point(428, 342);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 25);
this.button1.TabIndex = 7;
this.button1.Text = "保存";
this.button1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 348);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(63, 13);
this.label1.TabIndex = 8;
this.label1.Text = "Item类型";
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Items.AddRange(new object[] {
"Item"});
this.comboBox1.Location = new System.Drawing.Point(83, 345);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(242, 21);
this.comboBox1.TabIndex = 9;
//
// SaveToTC
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(515, 385);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Controls.Add(this.treeView1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "SaveToTC";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "保存";
this.Load += new System.EventHandler(this.SaveToTC_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.TreeView treeView1;
public System.Windows.Forms.ImageList imageList1;
public System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
public System.Windows.Forms.ComboBox comboBox1;
}
}

@ -0,0 +1,450 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Teamcenter.Hello;
using Teamcenter.Soa.Client;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Teamcenter.Services.Strong.Query;
using Teamcenter.Services.Strong.Core._2007_06.DataManagement;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
using DataSet = Teamcenter.Soa.Client.Model.Strong.Dataset;
using HelloTeamcenter.hello;
namespace HelloTeamcenter.form
{
public partial class SaveToTC : Form
{
public Document appdoc;
public User user;
public bool first = true;
public Folder home = null;
Editor ed;
public List<ALLOBJECT> folderlist = new List<ALLOBJECT>();
public List<ALLOBJECT> itemlist = new List<ALLOBJECT>();
public List<ALLOBJECT> itemvisionlist = new List<ALLOBJECT>();
public List<ALLOBJECT> datasetlist = new List<ALLOBJECT>();
public OriginBTL btlinfo;
public List<OriginMXL> bomlist;
public Hashtable itemtypetable;
public string xmlpath = "";
public SaveToTC()
{
InitializeComponent();
}
private void SaveToTC_Load(object sender, EventArgs e)
{
ed = appdoc.Editor;
treeView1.Nodes.Clear();
//读取Item类型.xml信息
OriginItemType originitemtype = new OriginItemType();
originitemtype.getType(this.xmlpath);
this.itemtypetable = originitemtype.Itemtypetable;
foreach (DictionaryEntry de in itemtypetable)
{
this.comboBox1.Items.Add(de.Key.ToString());
}
OriginReadXml originreadxml = new OriginReadXml();
OriginTypeRule origintyperule = originreadxml.OriginReadRuleXML(xmlpath);
OriginTool origintool = new OriginTool();
string itemtype = origintool.getItemType(btlinfo, origintyperule);
if (this.comboBox1.Items.Contains(itemtype))
this.comboBox1.SelectedText = itemtype;
else
{
this.comboBox1.Items.Add(itemtype);
this.comboBox1.SelectedText = itemtype;
}
TreeNode rootnode = new TreeNode("Home", 7, 7);
treeView1.Nodes.Add(rootnode);
WorkspaceObject[] contents = null;
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
try
{
home = user.Home_folder;
}
catch (NotLoadedException ex)
{
MessageBox.Show(ex.Message);
return;
}
try
{
ModelObject[] objects = { home };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = home.Contents;
}
catch (NotLoadedException ex) { MessageBox.Show(ex.Message); }
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects = { childobj };
String[] attributes = { "object_string", "object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Folder fl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
}
folderlist.Add(perobject);
}
else if (type == "Item" || this.itemtypetable.ContainsValue(type)) //需要替换类型
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
rootnode.Nodes.Add(childnode);
itemlist.Add(perobject);
}
}
foreach (TreeNode ch in rootnode.Nodes)
{
ch.EnsureVisible();
}
//这边是加载Item类型.xml文件的信息
////Tool tool = new Tool();
////BTLClass btlinfo = tool.getBTL("DFHM_BTL");
////string itemtype = tool.initItemType(btlinfo.Item_id, btlinfo.Materialgrade);
////this.comboBox1.SelectedText = itemtype;
}
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeNode nownode = this.treeView1.SelectedNode;
getChild(nownode);
foreach (TreeNode ch in nownode.Nodes)
{
ch.EnsureVisible();
}
}
private void getChild(TreeNode nownode)
{
nownode.Nodes.Clear();
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
WorkspaceObject[] contents = null;
string nodetext = nownode.Text;
int imageindex = nownode.SelectedImageIndex;
if (imageindex == 1)
{
foreach (ALLOBJECT perobject in folderlist)
{
if (perobject.treenode.Equals(nownode))
{
Folder fl = perobject.workobject as Folder;
ModelObject[] objects = { fl };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = fl.Contents;
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects1 = { childobj };
String[] attributes1 = { "object_string", "object_type" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = childobj;
Folder infl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
folderlist.Add(inperobject);
}
else if (type == "Item" || this.itemtypetable.ContainsValue(type))//需要替换类型
{
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
itemlist.Add(inperobject);
}
}
break;
}
}
return;
}
else if (imageindex == 3)
{
foreach (ALLOBJECT perobject in itemlist)
{
if (perobject.treenode.Equals(nownode))
{
Item item = perobject.workobject as Item;
ModelObject[] itemrevisionlist = null;
ModelObject[] objects = { item };
String[] attributes = { "revision_list" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
itemrevisionlist = item.Revision_list;
for (int i = 0; i < itemrevisionlist.Length; i++)
{
ItemRevision itemrevision = itemrevisionlist[i] as ItemRevision;
ModelObject[] objects1 = { itemrevision };
String[] attributes1 = { "object_string", "object_type" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
string name = itemrevision.Object_string;
string type = itemrevision.Object_type;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = itemrevision;
TreeNode childnode = new TreeNode(name, 4, 4);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
itemvisionlist.Add(inperobject);
}
break;
}
}
return;
}
else if (imageindex == 4)
{
foreach (ALLOBJECT perobject in itemvisionlist)
{
if (perobject.treenode.Equals(nownode))
{
ItemRevision itemrevision = perobject.workobject as ItemRevision;
ExpandGRMRelationsPref myPref = new ExpandGRMRelationsPref();
RelationAndTypesFilter2 myFilter = new RelationAndTypesFilter2();
myFilter.RelationName = "IMAN_specification";
String[] typeVec = { "D5DWG", "Folder" };
myFilter.ObjectTypeNames = typeVec;
myPref.ExpItemRev = false;
RelationAndTypesFilter2[] myfilter = { myFilter };
myPref.Info = myfilter;
ModelObject[] objects1 = { itemrevision };
ExpandGRMRelationsResponse myResp = dmService.ExpandGRMRelationsForPrimary(objects1, myPref);
ExpandGRMRelationsOutput[] myoutput = myResp.Output;
for (int i = 0; i < myoutput.Length; i++)
{
ExpandGRMRelationsOutput one_out = myoutput[i];
for (int j = 0; j < one_out.OtherSideObjData.Length; j++)
{
ExpandGRMRelationsData otherSideData = one_out.OtherSideObjData[j];
for (int k = 0; k < otherSideData.OtherSideObjects.Length; k++)
{
Type typeinfo = otherSideData.OtherSideObjects[k].GetType();
string typename = typeinfo.Name;
if (typename == "Folder")
{
Folder infold = otherSideData.OtherSideObjects[k] as Folder;
ModelObject[] objects = { infold };
String[] attributes = { "object_string", "object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = infold.Object_string;
string type = infold.Object_type;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = infold;
TreeNode childnode = new TreeNode(name, 1, 1);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
folderlist.Add(inperobject);
}
else
{
DataSet dateset = otherSideData.OtherSideObjects[k] as DataSet;
ModelObject[] objects = { dateset };
String[] attributes = { "object_string" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = dateset.Object_string;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = dateset;
inperobject.name = name;
TreeNode childnode = new TreeNode(name, 0, 0);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
datasetlist.Add(inperobject);
}
}
}
}
break;
}
}
return;
}
else if (imageindex == 6)
{
}
else if (imageindex == 7)
{
folderlist.Clear();
itemlist.Clear();
itemvisionlist.Clear();
datasetlist.Clear();
try
{
ModelObject[] objects = { home };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = home.Contents;
}
catch (NotLoadedException ex) { MessageBox.Show(ex.Message); }
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects = { childobj };
String[] attributes = { "object_string", "object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Folder fl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
}
folderlist.Add(perobject);
}
else if (type == "Item" || this.itemtypetable.ContainsValue(type))
{
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
perobject.treenode = childnode;
perobject.name = name;
perobject.uid = childobj.Uid;
nownode.Nodes.Add(childnode);
itemlist.Add(perobject);
}
}
foreach (TreeNode ch in nownode.Nodes)
{
ch.EnsureVisible();
}
}
}
}
}

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABq
EAAAAk1TRnQBSQFMAgEBCAEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8AFQAQ/ycA
AZoCGgHwBQAQ/wMAAvANAAEEEAABGgHwARoBmgHlAVkBUgF5AfAEABD/AgABtAGtAc8BtQHvAgcBvAgA
AuwCBwEAAQMB+wEAAwcEAAIaAcMBGgLDAaABeQFZATIBmQGYAbwB8AEAAf8OAAH/AgABzweLAa4B9wHv
AQcEAALsAv8BAAEDAfsBAAL/AQcEAAGaAsMBGgL2AcMBeQI4AVgBVgFQAZgB8AH/DewBAAH/AgABzwGL
CYoBkgQAAuwC/wEAAQMB+wEAAv8BBwQAAXoDoAEaAvYBmgJZAVgBeAJQAfAB/wHsCwcB7AEAAf8CAAHP
ArIBrAeKAa4EAALsAv8BAAEDAfsBAAL/AQcEAAF6AuUBegJSAZkBGgGaAVkBmQGYAVYBUAHwAf8B7AED
AwcDAwMHAQMB7AEAAf8CAAHPAawFsgSKAZEBvAMAAQQB7AL/BAAC/wEHAwAB8AGaAXoB5QF6ATECUgEc
AZkBmgEaAZgBVwFWAfAB/wHsAfsBAwEHAQMDAAEDAQcBAwEHAewBAAH/AgABtQGtBbMDsgGzAa4BBwQA
AewI/wHsAwAB8AHDAfYBwwF6AVkBOAFYAngBHAGYAZkBmAF4AfAB/wHsAv8BAwEAAv8B+wEAAQMCBwHs
AQAB/wIAAbUBtAG7AroGswGRAQcEAAEDAQAG/wHsAgMCAAHwAZoCwwF6AjgBWAFXAVABSgFyAXMBHAGZ
AfAB/wHsAfsBBwEAAf8B+wP/AQABAwEHAewBAAH/AgABBwG0Aa0CtAEJAbsEugG0Ae8FAAEDAQAE/wHs
AgMB7AIAAfABmgF6AZoBegJZAnkBVgFQAXIBBwMAAf8B7AEHAQAB+wP/AfsC/wEAAQMB7AEAAf8CAAG1
AZkBkAGYAbMBtAEJAhkCCQG1AQcGAAEDAQAC/wHsAgMEAAHwARoBegF5AZkBoAFYAVkBmQJWARwEAAH/
AewBAAP/AfsD/wH7Af8BAAHsAQAB/wEAAbsBtAF5AZkBeQG0AgkEtAG1CAABAwIAAgMHAAHwArwBmQF5
AZkBeAJWAXgEAAH/AewC/wH7A/8B+wP/AfsCAAH/AgAB7wF+AV4BWAEcA7QB1gIJAQcJAAMDAewBAQcA
AbwB8AEIAZgBeAKYAZkBBwQAAf8N7AEAAf8CAAKZAnkBtQHvAwACtQEHDQABAQcAAfABvALwAbwBBwK8
BQAQ/wIAAQcBGgGRArwRAAEEAgABAQgABLwB8AcAEP8EAAHvHAAO8CoAARoB8AG8AfAEAAHvCYEB/wOB
AfAmAAGZARoBegFTAVkBUgF0AQcDAAGyAbkD2gO5AdoBuQH0AtoBuQG8IwACkwFMAXoDoAHlATEBMgFS
AZkCAAGyAtoCswLZAbMBiwGzAfQBswHUAbkBvA7sBAAM7AIAAfACmQEbAf8BmgH2AsMCoAExATgBMgF0
AgABsgOzBtkB9AHZArMBvAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewEAAHsAf8B+wEHAfsBBwH7
AQcB+wEHAfsB7AIAAbwBGgHDAv8BmQH/AvYCwwE3AjgBeQIAAbIBswGyAtkBuAHbAbkB2wGyAfQB2QGy
AbkBvAHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB+wEHAewDAAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwEA
AewBAAG8AZoBoALDAZoB9gP/AfYBNwI4AXkCAAGyAdkBsgG4AbIBuAGKAbIBgQGyAfQB2QGyAbkBvAHs
Af8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewDAAHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB7AEAAewBAAG8
AXkDoAFSAZkCwwEaAZoBegI4AXkCAAGyAdkBuAK5AbgB2QGyAYoB2QH0AdkBsgG5AbwB7AH/AQcB+wEH
AfsBBwH7AQcB+wEHAfsBBwHsAgAB7AH/AQcB+wEHAfsBBwH7AQcB+wEHAfsBAALsAQAB8AF6AuUBegFT
AVIBcwF0AbwB9AH2AXoBWQGZAgABsgLaAbMC3AG5AbgB2QG7Af8BuwGzAdoBvAHsAf8B+wEHAfsBBwH7
AQcB+wEHAfsBBwH7AewCAAHsCv8B7AEAAQcB7AEAARoBmQN6AVkBMQErAUsBUgKZAZoCegIAAYEDswGQ
AYoBgQKzAbsBigG6ArMBBwHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB+wEHAewCAA3sAfsB7AEAAXQBwwH2
AsMBegFZATgBMgFMAZkBGgUAAboB2wK6AdoBugKRAdoBuwS6AQcB7AH/AfsBBwH7AQcB+wEHAfsBBwH7
AQcB+wHsAwAB7AH/AQcB+wEHAfsBBwH7AQcB+wEHAfsBBwHsAQABdAHDAfYC/wGaAzgBUgcAAbkC2wGz
BNkBuAHyAf8B8gHbAdoBvAHsDP8B7AMAAewB/wH7AQcB+wEHAfsBBwX/AewBAAF6AsMC9gEaAfsCOAFS
BwABswTbAQkC3AIJAfQC2wHaAbwB7AEHAfsBBwH7AQcB+wEHBuwDAAHsAf8BBwH7AQcB+wEHAf8G7AEA
AnoCoAJ6AVkB+wE4AXkHAAGzAdsB3AcJAfQBCQHcAdsBvAEAAewBBwH7AQcB+wEHAewKAAHsBf8B7AcA
AnoBWQLlAcMBegJZAZkHAAG5CRkB9AMZAfACAAXsDAAF7AkAAfABGgFSAlkCegFTAXkRAAHwKAAC8AoA
AUIBTQE+BwABPgMAASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD/4EAAv8CAAT/Af4BHwIAAecB/wHA
AQMB4AEPAgABwAE/AcABAwGAAQECAAHAAQMBwAEDAYADAAHAAQMBwAEDAYADAAHAAQMBwAEDAYADAAHA
AQEBwAEDBAABwAEBAYABAQQAAcABAQHAAQEEAAHAAQEB4AEDAQABBwIAAcABAQHwAQcBAAEPAgABgAED
AfgBBwHAAQ8CAAHAAQMB/AEHAeABDwIAAcAB4wH+AScB4AEfAgABwQL/AWcB8AF/AgAB9wP/AYABAQX/
AYcBgAEABP8B/AEDAYABAAGAAQEB4AEAAeABAQGAAgABAQHAAgABAQGAAgABAQHAAgABAQGAAgABAQGA
AgABAQGAAgABAQGAAgABAQGAAgABAQMAAQEBgAIAAQEDAAEBAYACAAEBAwABDwGAAgABAQGAAgABPwGA
AgABAQGAAgABPwGAAgABAwGAAQEBAAE/AYABAAGAAf8BwAF/AQABPwGAAQABwQH/AeAB/wGAAT8B/wHv
BP8B8wH/Cw==
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAECAAAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8A///////////0bm5ubm5ub/Rs6IjoiEzv9G6Pd4d3Tm/0bP/3f/dM7/Ru/45v905v9Gz/jO/3
TO/0bn/2b/dOb/Rs5///90zv9G5ubm/3Tm/0bPeIf/bs7/Rub///fm5v9Gzs53zs7O/0xsbGxsbGz/RE
RERERERP//////////8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//wAA//8AAP//
</value>
</data>
</root>

@ -0,0 +1,208 @@
namespace HelloTeamcenter.form
{
partial class Search
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Search));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.treeView1 = new System.Windows.Forms.TreeView();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(38, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 13);
this.label1.TabIndex = 0;
this.label1.Text = "名称:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(8, 75);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 13);
this.label2.TabIndex = 1;
this.label2.Text = "零组件 ID";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(38, 114);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(43, 13);
this.label3.TabIndex = 2;
this.label3.Text = "类型:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(26, 153);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(55, 13);
this.label4.TabIndex = 3;
this.label4.Text = "创建者:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(85, 29);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(166, 20);
this.textBox1.TabIndex = 4;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(85, 67);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(166, 20);
this.textBox2.TabIndex = 5;
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Items.AddRange(new object[] {
"*"});
this.comboBox1.Location = new System.Drawing.Point(85, 108);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(166, 21);
this.comboBox1.TabIndex = 6;
//
// comboBox2
//
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Items.AddRange(new object[] {
"*"});
this.comboBox2.Location = new System.Drawing.Point(85, 147);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(166, 21);
this.comboBox2.TabIndex = 7;
this.comboBox2.Click += new System.EventHandler(this.comboBox2_Click);
//
// treeView1
//
this.treeView1.ImageIndex = 7;
this.treeView1.ImageList = this.imageList1;
this.treeView1.Location = new System.Drawing.Point(280, 1);
this.treeView1.Name = "treeView1";
this.treeView1.SelectedImageIndex = 0;
this.treeView1.Size = new System.Drawing.Size(401, 356);
this.treeView1.TabIndex = 8;
this.treeView1.NodeMouseDoubleClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeView1_NodeMouseDoubleClick);
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "autocad_01.ico");
this.imageList1.Images.SetKeyName(1, "FOLDER.ICO");
this.imageList1.Images.SetKeyName(2, "FOLDEROP.ICO");
this.imageList1.Images.SetKeyName(3, "item.ico");
this.imageList1.Images.SetKeyName(4, "itemrev.ico");
this.imageList1.Images.SetKeyName(5, "mail.ico");
this.imageList1.Images.SetKeyName(6, "Newstuff_Folder.png");
this.imageList1.Images.SetKeyName(7, "tai.ico");
//
// button1
//
this.button1.Location = new System.Drawing.Point(59, 233);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 25);
this.button1.TabIndex = 9;
this.button1.Text = "查找";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(162, 233);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 25);
this.button2.TabIndex = 10;
this.button2.Text = "打开";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Search
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(693, 371);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.treeView1);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Search";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "搜索";
this.TopMost = true;
this.Load += new System.EventHandler(this.Search_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public System.Windows.Forms.Label label1;
public System.Windows.Forms.Label label2;
public System.Windows.Forms.Label label3;
public System.Windows.Forms.Label label4;
public System.Windows.Forms.TextBox textBox1;
public System.Windows.Forms.TextBox textBox2;
public System.Windows.Forms.ComboBox comboBox1;
public System.Windows.Forms.ComboBox comboBox2;
public System.Windows.Forms.TreeView treeView1;
public System.Windows.Forms.Button button1;
public System.Windows.Forms.Button button2;
public System.Windows.Forms.ImageList imageList1;
}
}

@ -0,0 +1,481 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Teamcenter.Hello;
using Teamcenter.Soa.Client;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Teamcenter.Services.Strong.Query;
using Teamcenter.Services.Strong.Core._2007_06.DataManagement;
using Teamcenter.Services.Strong.Core._2006_03.Reservation;
using Teamcenter.Services.Strong.Core._2006_03.FileManagement;
using Teamcenter.Soa.Internal.Client.Model;
using Teamcenter.Soa.Internal.Client;
using HelloTeamcenter.hello;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
using DataSet = Teamcenter.Soa.Client.Model.Strong.Dataset;
using SavedQueryResults = Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults;
using ImanFile = Teamcenter.Soa.Client.Model.Strong.ImanFile;
namespace HelloTeamcenter.form
{
public partial class Search : Form
{
public Search()
{
InitializeComponent();
}
public List<ALLOBJECT> folderlist = new List<ALLOBJECT>();
public List<ALLOBJECT> itemlist = new List<ALLOBJECT>();
public List<ALLOBJECT> itemvisionlist = new List<ALLOBJECT>();
public List<ALLOBJECT> datasetlist = new List<ALLOBJECT>();
public Document appdoc;
public User user;
public Editor ed;
public bool hasRight = true;
public Hashtable itemtypetable;
public string xmlpath = "";
private void Search_Load(object sender, EventArgs e)
{
this.textBox1.Text = "";
this.textBox2.Text = "";
//读取Item类型.xml信息
OriginItemType originitemtype = new OriginItemType();
originitemtype.getType(this.xmlpath);
this.itemtypetable = originitemtype.Itemtypetable;
foreach (DictionaryEntry de in itemtypetable)
{
this.comboBox1.Items.Add(de.Key.ToString());
}
}
private void comboBox2_Click(object sender, EventArgs e)
{
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
this.comboBox2.Items.Clear();
OriginTool tool = new OriginTool();
SavedQueryResults found = tool.getSearchUser();
if (found != null && found.NumOfObjects > 0)
{
for (int i = 0; i < found.NumOfObjects; i++)
{
User userobj = found.Objects[i] as User;
ModelObject[] objects = { userobj };
String[] attributes = { "User ID", "Name" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string userid = userobj.User_id;
string username = userobj.User_name;
string tempname = userid + "(" + username + ")";
if (this.comboBox2.Items.Contains(tempname))
continue;
else
this.comboBox2.Items.Add(tempname);
}
}
}
private void button1_Click(object sender, EventArgs e)
{
string name = textBox1.Text;
string item_id = textBox2.Text;
string type = comboBox1.Text;
//ed.WriteMessage("选择类型:"+ type +"\n");
string owner = comboBox2.Text;
//ed.WriteMessage("选择用户:" + owner + "\n");
if (name == "")
{
name = "*";
}
if (item_id == "")
{
item_id = "*";
}
if (type == "")
{
type = "*";
}
if (owner == "")
{
owner = "*";
}
else
{
int pos = owner.IndexOf('(');
owner = owner.Substring(0, pos);
//ed.WriteMessage("用户" + owner+"\n");
}
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
OriginTool tool = new OriginTool();
SavedQueryResults found = tool.getSearchItem(item_id, name, type, owner);
if (found != null && found.NumOfObjects > 0)
{
this.treeView1.Nodes.Clear();
for (int i = 0; i < found.NumOfObjects; i++)
{
Item item = found.Objects[i] as Item;
ModelObject[] objects = { item };
String[] attributes = { "object_string"};
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string inname = item.Object_string;
TreeNode childnode = new TreeNode(inname, 3, 3);
this.treeView1.Nodes.Add(childnode);
ALLOBJECT perobject = new ALLOBJECT();
perobject.workobject = item;
perobject.treenode = childnode;
itemlist.Add(perobject);
}
foreach (TreeNode ch in treeView1.Nodes)
{
ch.EnsureVisible();
}
}
}
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
TreeNode nownode = this.treeView1.SelectedNode;
getChild(nownode);
foreach (TreeNode ch in nownode.Nodes)
{
ch.EnsureVisible();
}
}
private void getChild(TreeNode nownode)
{
nownode.Nodes.Clear();
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
WorkspaceObject[] contents = null;
string nodetext = nownode.Text;
int imageindex = nownode.SelectedImageIndex;
if (imageindex == 3)
{
foreach (ALLOBJECT perobject in itemlist)
{
if (perobject.treenode.Equals(nownode))
{
Item item = perobject.workobject as Item;
ModelObject[] itemrevisionlist = null;
ModelObject[] objects = { item };
String[] attributes = { "revision_list" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
itemrevisionlist = item.Revision_list;
for (int i = 0; i < itemrevisionlist.Length; i++)
{
ItemRevision itemrevision = itemrevisionlist[i] as ItemRevision;
ModelObject[] objects1 = { itemrevision };
String[] attributes1 = { "object_string", "object_type" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
string name = itemrevision.Object_string;
string type = itemrevision.Object_type;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = itemrevision;
TreeNode childnode = new TreeNode(name, 4, 4);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
itemvisionlist.Add(inperobject);
}
break;
}
}
}
else if (imageindex == 4)
{
foreach (ALLOBJECT perobject in itemvisionlist)
{
if (perobject.treenode.Equals(nownode))
{
ItemRevision itemrevision = perobject.workobject as ItemRevision;
ExpandGRMRelationsPref myPref = new ExpandGRMRelationsPref();
RelationAndTypesFilter2 myFilter = new RelationAndTypesFilter2();
myFilter.RelationName = "IMAN_specification";
String[] typeVec = { "D5DWG", "Folder" };
myFilter.ObjectTypeNames = typeVec;
myPref.ExpItemRev = false;
RelationAndTypesFilter2[] myfilter = { myFilter };
myPref.Info = myfilter;
ModelObject[] objects1 = { itemrevision };
ExpandGRMRelationsResponse myResp = dmService.ExpandGRMRelationsForPrimary(objects1, myPref);
ExpandGRMRelationsOutput[] myoutput = myResp.Output;
for (int i = 0; i < myoutput.Length; i++)
{
ExpandGRMRelationsOutput one_out = myoutput[i];
for (int j = 0; j < one_out.OtherSideObjData.Length; j++)
{
ExpandGRMRelationsData otherSideData = one_out.OtherSideObjData[j];
for (int k = 0; k < otherSideData.OtherSideObjects.Length; k++)
{
Type typeinfo = otherSideData.OtherSideObjects[k].GetType();
string typename = typeinfo.Name;
if (typename == "Folder")
{
Folder infold = otherSideData.OtherSideObjects[k] as Folder;
ModelObject[] objects = { infold };
String[] attributes = { "object_string", "object_type" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = infold.Object_string;
string type = infold.Object_type;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = infold;
TreeNode childnode = new TreeNode(name, 1, 1);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
folderlist.Add(inperobject);
}
else
{
DataSet dateset = otherSideData.OtherSideObjects[k] as DataSet;
ModelObject[] objects = { dateset };
String[] attributes = { "object_string" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
string name = dateset.Object_string;
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = dateset;
inperobject.name = name;
TreeNode childnode = new TreeNode(name, 0, 0);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
datasetlist.Add(inperobject);
}
}
}
}
break;
}
}
}
else if (imageindex == 1)
{
foreach (ALLOBJECT perobject in folderlist)
{
if (perobject.treenode.Equals(nownode))
{
Folder fl = perobject.workobject as Folder;
ModelObject[] objects = { fl };
String[] attributes = { "contents" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
contents = fl.Contents;
for (int i = 0; i < contents.Length; i++)
{
WorkspaceObject childobj = contents[i];
ModelObject[] objects1 = { childobj };
String[] attributes1 = { "object_string", "object_type" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
string name = childobj.Object_string;
string type = childobj.Object_type;
if (type == "Folder" || type == "Newstuff Folder" || type == "Mail Folder")
{
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = childobj;
Folder infl = childobj as Folder;
if (type == "Folder")
{
TreeNode childnode = new TreeNode(name, 1, 1);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
else if (type == "Newstuff Folder")
{
TreeNode childnode = new TreeNode(name, 6, 6);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
else if (type == "Mail Folder")
{
TreeNode childnode = new TreeNode(name, 5, 5);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
}
folderlist.Add(inperobject);
}
else if (type == "Item" || this.itemtypetable.ContainsValue(type))
{
ALLOBJECT inperobject = new ALLOBJECT();
inperobject.workobject = childobj;
Item item = childobj as Item;
TreeNode childnode = new TreeNode(name, 3, 3);
inperobject.treenode = childnode;
nownode.Nodes.Add(childnode);
itemlist.Add(inperobject);
}
}
break;
}
}
}
}
private void button2_Click(object sender, EventArgs e)
{
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
Reservation res = ReservationService.getService(Session.getConnection());
TreeNode nownode = this.treeView1.SelectedNode;
if (nownode.SelectedImageIndex == 0)
{
foreach (ALLOBJECT perobject in this.datasetlist)
{
if (perobject.treenode.Equals(nownode))
{
DialogResult isopen = MessageBox.Show("您是否确定打开该图纸?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (isopen == DialogResult.None || isopen == DialogResult.No)
{
return;
}
DataSet mydateset = perobject.workobject as DataSet;
ModelObject[] objects = { mydateset };
String[] attributes = { "is_modifiable", "checked_out", "ref_list" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
if (mydateset.Is_modifiable == false)
{
DialogResult result = MessageBox.Show("您没有修改权限,是否以只读方式打开?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
hasRight = false;
}
else
{
return;
}
}
if (mydateset.Is_modifiable)
{
DialogResult result = MessageBox.Show("是否签出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
if (mydateset.Checked_out == "Y")
{
MessageBox.Show("对不起,文件已签出!请确认文件签入后执行此操作");
return;
}
else
{
ModelObject[] dataobj = { mydateset };
res.Checkout(dataobj, "", "");
//ed.WriteMessage("文件已签出");
//ed.WriteMessage("\n");
}
}
}
ModelObject[] dsfilevec = mydateset.Ref_list;
//ed.WriteMessage("长度:" + dsfilevec.Length);
//ed.WriteMessage(dsfilevec[0].GetType().ToString());
ImanFile dsfile = dsfilevec[0] as ImanFile;
ModelObject[] objects1 = { dsfile };
String[] attributes1 = { "relative_directory_path", "original_file_name" };
dmService.RefreshObjects(objects1);
dmService.GetProperties(objects1, attributes1);
//ed.WriteMessage("路径:" + dsfile.Relative_directory_path + "\n");
//ed.WriteMessage("文件名:" + dsfile.Original_file_name + "\n");
string newfilename = dsfile.Original_file_name;
string tempdir = System.Environment.GetEnvironmentVariable("TEMP").ToString();
//ed.WriteMessage("TEMP:" + tempdir.ToString() + "\n");
FileManagementService fmService = FileManagementService.getService(Teamcenter.ClientX.Session.getConnection());
ImanFile[] objects2 = { dsfile };
FileTicketsResponse tickets = fmService.GetFileReadTickets(objects2);
//ed.WriteMessage("tickets : " + tickets.Tickets.Count + "\n");
//foreach (System.Collections.DictionaryEntry ticket in tickets.Tickets)
//{
// ed.WriteMessage("键:" + ticket.Key + "\n" + "值:" + ticket.Value + "\n");
//}
Teamcenter.Soa.Client.FileManagementUtility fmu = new Teamcenter.Soa.Client.FileManagementUtility(Teamcenter.ClientX.Session.getConnection());
Teamcenter.Soa.Client.GetFileResponse getFileResponse = fmu.GetFiles(dsfilevec);
FileInfo[] fileinfovec = getFileResponse.GetFiles();
//ed.WriteMessage("文件个数:" + fileinfovec.Length + "\n");
FileInfo file = fileinfovec[0];
string newtempfile = tempdir + "\\" + newfilename;
System.IO.File.Copy(file.FullName, newtempfile, true);
System.IO.File.SetAttributes(newtempfile, FileAttributes.Normal);
DocumentCollection acdocmgr = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;
if (File.Exists(newtempfile))
{
acdocmgr.Open(newtempfile,false);
//Object pdata = newtempfile;
//acdocmgr.ExecuteInApplicationContext(c_back, pdata);
//acdocmgr.Add(newtempfile);
}
else
{
MessageBox.Show("对不起,用户临时目录下不存在此文件\n");
}
this.Hide();
this.Dispose();
break;
}
}
}
else
{
//ed.WriteMessage("请选择正确的数据集类型\n");
MessageBox.Show("请选择正确的数据集类型");
return;
}
}
//private void c_back(Object data)
//{
// DocumentCollection acdocmgr = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager;
// if (acdocmgr.IsApplicationContext)
// {
// acdocmgr.Open(Convert.ToString(data));
// }
//}
}
}

@ -0,0 +1,212 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABq
EAAAAk1TRnQBSQFMAgEBCAEAARwBAAEcAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD//8A/wD/AP8AFQAQ/ycA
AZoCGgHwBQAQ/wMAAvANAAEEEAABGgHwARoBmgHlAVkBUgF5AfAEABD/AgABtAGtAc8BtQHvAgcBvAgA
AuwCBwEAAQMB+wEAAwcEAAIaAcMBGgLDAaABeQFZATIBmQGYAbwB8AEAAf8OAAH/AgABzweLAa4B9wHv
AQcEAALsAv8BAAEDAfsBAAL/AQcEAAGaAsMBGgL2AcMBeQI4AVgBVgFQAZgB8AH/DewBAAH/AgABzwGL
CYoBkgQAAuwC/wEAAQMB+wEAAv8BBwQAAXoDoAEaAvYBmgJZAVgBeAJQAfAB/wHsCwcB7AEAAf8CAAHP
ArIBrAeKAa4EAALsAv8BAAEDAfsBAAL/AQcEAAF6AuUBegJSAZkBGgGaAVkBmQGYAVYBUAHwAf8B7AED
AwcDAwMHAQMB7AEAAf8CAAHPAawFsgSKAZEBvAMAAQQB7AL/BAAC/wEHAwAB8AGaAXoB5QF6ATECUgEc
AZkBmgEaAZgBVwFWAfAB/wHsAfsBAwEHAQMDAAEDAQcBAwEHAewBAAH/AgABtQGtBbMDsgGzAa4BBwQA
AewI/wHsAwAB8AHDAfYBwwF6AVkBOAFYAngBHAGYAZkBmAF4AfAB/wHsAv8BAwEAAv8B+wEAAQMCBwHs
AQAB/wIAAbUBtAG7AroGswGRAQcEAAEDAQAG/wHsAgMCAAHwAZoCwwF6AjgBWAFXAVABSgFyAXMBHAGZ
AfAB/wHsAfsBBwEAAf8B+wP/AQABAwEHAewBAAH/AgABBwG0Aa0CtAEJAbsEugG0Ae8FAAEDAQAE/wHs
AgMB7AIAAfABmgF6AZoBegJZAnkBVgFQAXIBBwMAAf8B7AEHAQAB+wP/AfsC/wEAAQMB7AEAAf8CAAG1
AZkBkAGYAbMBtAEJAhkCCQG1AQcGAAEDAQAC/wHsAgMEAAHwARoBegF5AZkBoAFYAVkBmQJWARwEAAH/
AewBAAP/AfsD/wH7Af8BAAHsAQAB/wEAAbsBtAF5AZkBeQG0AgkEtAG1CAABAwIAAgMHAAHwArwBmQF5
AZkBeAJWAXgEAAH/AewC/wH7A/8B+wP/AfsCAAH/AgAB7wF+AV4BWAEcA7QB1gIJAQcJAAMDAewBAQcA
AbwB8AEIAZgBeAKYAZkBBwQAAf8N7AEAAf8CAAKZAnkBtQHvAwACtQEHDQABAQcAAfABvALwAbwBBwK8
BQAQ/wIAAQcBGgGRArwRAAEEAgABAQgABLwB8AcAEP8EAAHvHAAO8CoAARoB8AG8AfAEAAHvCYEB/wOB
AfAmAAGZARoBegFTAVkBUgF0AQcDAAGyAbkD2gO5AdoBuQH0AtoBuQG8IwACkwFMAXoDoAHlATEBMgFS
AZkCAAGyAtoCswLZAbMBiwGzAfQBswHUAbkBvA7sBAAM7AIAAfACmQEbAf8BmgH2AsMCoAExATgBMgF0
AgABsgOzBtkB9AHZArMBvAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewEAAHsAf8B+wEHAfsBBwH7
AQcB+wEHAfsB7AIAAbwBGgHDAv8BmQH/AvYCwwE3AjgBeQIAAbIBswGyAtkBuAHbAbkB2wGyAfQB2QGy
AbkBvAHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB+wEHAewDAAHsAf8B+wEHAfsBBwH7AQcB+wEHAfsBBwEA
AewBAAG8AZoBoALDAZoB9gP/AfYBNwI4AXkCAAGyAdkBsgG4AbIBuAGKAbIBgQGyAfQB2QGyAbkBvAHs
Af8B+wEHAfsBBwH7AQcB+wEHAfsBBwH7AewDAAHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB7AEAAewBAAG8
AXkDoAFSAZkCwwEaAZoBegI4AXkCAAGyAdkBuAK5AbgB2QGyAYoB2QH0AdkBsgG5AbwB7AH/AQcB+wEH
AfsBBwH7AQcB+wEHAfsBBwHsAgAB7AH/AQcB+wEHAfsBBwH7AQcB+wEHAfsBAALsAQAB8AF6AuUBegFT
AVIBcwF0AbwB9AH2AXoBWQGZAgABsgLaAbMC3AG5AbgB2QG7Af8BuwGzAdoBvAHsAf8B+wEHAfsBBwH7
AQcB+wEHAfsBBwH7AewCAAHsCv8B7AEAAQcB7AEAARoBmQN6AVkBMQErAUsBUgKZAZoCegIAAYEDswGQ
AYoBgQKzAbsBigG6ArMBBwHsAf8BBwH7AQcB+wEHAfsBBwH7AQcB+wEHAewCAA3sAfsB7AEAAXQBwwH2
AsMBegFZATgBMgFMAZkBGgUAAboB2wK6AdoBugKRAdoBuwS6AQcB7AH/AfsBBwH7AQcB+wEHAfsBBwH7
AQcB+wHsAwAB7AH/AQcB+wEHAfsBBwH7AQcB+wEHAfsBBwHsAQABdAHDAfYC/wGaAzgBUgcAAbkC2wGz
BNkBuAHyAf8B8gHbAdoBvAHsDP8B7AMAAewB/wH7AQcB+wEHAfsBBwX/AewBAAF6AsMC9gEaAfsCOAFS
BwABswTbAQkC3AIJAfQC2wHaAbwB7AEHAfsBBwH7AQcB+wEHBuwDAAHsAf8BBwH7AQcB+wEHAf8G7AEA
AnoCoAJ6AVkB+wE4AXkHAAGzAdsB3AcJAfQBCQHcAdsBvAEAAewBBwH7AQcB+wEHAewKAAHsBf8B7AcA
AnoBWQLlAcMBegJZAZkHAAG5CRkB9AMZAfACAAXsDAAF7AkAAfABGgFSAlkCegFTAXkRAAHwKAAC8AoA
AUIBTQE+BwABPgMAASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD/4EAAv8CAAT/Af4BHwIAAecB/wHA
AQMB4AEPAgABwAE/AcABAwGAAQECAAHAAQMBwAEDAYADAAHAAQMBwAEDAYADAAHAAQMBwAEDAYADAAHA
AQEBwAEDBAABwAEBAYABAQQAAcABAQHAAQEEAAHAAQEB4AEDAQABBwIAAcABAQHwAQcBAAEPAgABgAED
AfgBBwHAAQ8CAAHAAQMB/AEHAeABDwIAAcAB4wH+AScB4AEfAgABwQL/AWcB8AF/AgAB9wP/AYABAQX/
AYcBgAEABP8B/AEDAYABAAGAAQEB4AEAAeABAQGAAgABAQHAAgABAQGAAgABAQHAAgABAQGAAgABAQGA
AgABAQGAAgABAQGAAgABAQGAAgABAQMAAQEBgAIAAQEDAAEBAYACAAEBAwABDwGAAgABAQGAAgABPwGA
AgABAQGAAgABPwGAAgABAwGAAQEBAAE/AYABAAGAAf8BwAF/AQABPwGAAQABwQH/AeAB/wGAAT8B/wHv
BP8B8wH/Cw==
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAECAAAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//
AAD///8A///////////0bm5ubm5ub/Rs6IjoiEzv9G6Pd4d3Tm/0bP/3f/dM7/Ru/45v905v9Gz/jO/3
TO/0bn/2b/dOb/Rs5///90zv9G5ubm/3Tm/0bPeIf/bs7/Rub///fm5v9Gzs53zs7O/0xsbGxsbGz/RE
RERERERP//////////8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA
//8AAP//AAD//wAA//8AAP//
</value>
</data>
</root>

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace HelloTeamcenter.hello
{
public class BTLClass
{
private string item_id;
public string Item_id
{
get { return item_id; }
set { item_id = value; }
}
private string item_name;
public string Item_name
{
get { return item_name; }
set { item_name = value; }
}
private string partnumber;
public string Partnumber
{
get { return partnumber; }
set { partnumber = value; }
}
private string projectname;
public string Projectname
{
get { return projectname; }
set { projectname = value; }
}
private string proportion;
public string Proportion
{
get { return proportion; }
set { proportion = value; }
}
private string mapsheet;
public string Mapsheet
{
get { return mapsheet; }
set { mapsheet = value; }
}
private string item_revision_id;
public string Item_revision_id
{
get { return item_revision_id; }
set { item_revision_id = value; }
}
private string weight;
public string Weight
{
get { return weight; }
set { weight = value; }
}
private string materialgrade;
public string Materialgrade
{
get { return materialgrade; }
set { materialgrade = value; }
}
private string allpage;
public string Allpage
{
get { return allpage; }
set { allpage = value; }
}
private string pagenumber = "1";
public string Pagenumber
{
get { return pagenumber; }
set { pagenumber = value; }
}
private string productType;
public string ProductType
{
get { return productType; }
set { productType = value; }
}
}
}

@ -0,0 +1,379 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using System.Collections;
using Teamcenter.ClientX;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
// Include the Data Management Service Interface
using Teamcenter.Services.Strong.Core;
// Input and output structures for the service operations
// Note: the different namespace from the service interface
using Teamcenter.Services.Strong.Core._2006_03.DataManagement;
using Teamcenter.Services.Strong.Core._2007_01.DataManagement;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
namespace Teamcenter.Hello
{
/**
* Perform different operations in the DataManamentService
*
*/
public class DataManagement
{
/**
* Perform a sequence of data management operations: Create Items, Revise
* the Items, and Delete the Items
*
*/
public void createReviseAndDelete()
{
try
{
int numberOfItems = 3;
// Reserve Item IDs and Create Items with those IDs
ItemIdsAndInitialRevisionIds[] itemIds = generateItemIds(numberOfItems, "Item");
CreateItemsOutput[] newItems = createItems(itemIds, "Item");
// Copy the Item and ItemRevision to separate arrays for further
// processing
Item[] items = new Item[newItems.Length];
ItemRevision[] itemRevs = new ItemRevision[newItems.Length];
for (int i = 0; i < items.Length; i++)
{
items[i] = newItems[i].Item;
itemRevs[i] = newItems[i].ItemRev;
}
// Reserve revision IDs and revise the Items
Hashtable allRevIds = generateRevisionIds(items);
reviseItems(allRevIds, itemRevs);
// Delete all objects created
deleteItems(items);
}
catch (ServiceException e)
{
System.Console.Out.WriteLine(e.Message );
}
}
/**
* Reserve a number Item and Revision Ids
*
* @param numberOfIds Number of IDs to generate
* @param type Type of IDs to generate
*
* @return An array of Item and Revision IDs. The size of the array is equal
* to the input numberOfIds
*
* @throws ServiceException If any partial errors are returned
*/
public ItemIdsAndInitialRevisionIds[] generateItemIds(int numberOfIds, String type)
// throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
GenerateItemIdsAndInitialRevisionIdsProperties[] properties = new GenerateItemIdsAndInitialRevisionIdsProperties[1];
GenerateItemIdsAndInitialRevisionIdsProperties property = new GenerateItemIdsAndInitialRevisionIdsProperties();
property.Count = numberOfIds;
property.ItemType = type;
property.Item = null; // Not used
properties[0] = property;
// *****************************
// Execute the service operation
// *****************************
GenerateItemIdsAndInitialRevisionIdsResponse response = dmService.GenerateItemIdsAndInitialRevisionIds(properties);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.generateItemIdsAndInitialRevisionIds returned a partial error.");
// The return is a map of ItemIdsAndInitialRevisionIds keyed on the
// 0-based index of requested IDs. Since we only asked for IDs for one
// data type, the map key is '0'
Int32 bIkey = 0;
Hashtable allNewIds = response.OutputItemIdsAndInitialRevisionIds;
ItemIdsAndInitialRevisionIds[] myNewIds = (ItemIdsAndInitialRevisionIds[]) allNewIds[bIkey];
return myNewIds;
}
/**
* Create Items
*
* @param itemIds Array of Item and Revision IDs
* @param itemType Type of item to create
*
* @return Set of Items and ItemRevisions
*
* @throws ServiceException If any partial errors are returned
*/
public CreateItemsOutput[] createItems(ItemIdsAndInitialRevisionIds[] itemIds, String itemType)
// throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
// Populate form type
GetItemCreationRelatedInfoResponse relatedResponse = dmService.GetItemCreationRelatedInfo(itemType, null);
String[] formTypes = new String[0];
if ( relatedResponse.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.getItemCretionRelatedInfo returned a partial error.");
formTypes = new String[relatedResponse.FormAttrs.Length];
for ( int i = 0; i < relatedResponse.FormAttrs.Length; i++ )
{
FormAttributesInfo attrInfo = relatedResponse.FormAttrs[i];
formTypes[i] = attrInfo.FormType;
}
ItemProperties[] itemProps = new ItemProperties[itemIds.Length];
for (int i = 0; i < itemIds.Length; i++)
{
// Create form in cache for form property population
ModelObject[] forms = createForms(itemIds[i].NewItemId, formTypes[0],
itemIds[i].NewRevId, formTypes[1],
null, false);
ItemProperties itemProperty = new ItemProperties();
itemProperty.ClientId = "AppX-Test";
itemProperty.ItemId = itemIds[i].NewItemId;
itemProperty.RevId = itemIds[i].NewRevId;
itemProperty.Name = "AppX-Test";
itemProperty.Type = itemType;
itemProperty.Description = "Test Item for the SOA AppX sample application.";
itemProperty.Uom = "";
// Retrieve one of form attribute value from Item master form.
ServiceData serviceData = dmService.GetProperties(forms, new String[]{"project_id"});
if ( serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.getProperties returned a partial error.");
Property property = null;
try
{
property= forms[0].GetProperty("project_id");
}
catch ( NotLoadedException /*ex*/){}
// Only if value is null, we set new value
if ( property == null || property.StringValue == null || property.StringValue.Length == 0)
{
itemProperty.ExtendedAttributes = new ExtendedAttributes[1];
ExtendedAttributes theExtendedAttr = new ExtendedAttributes();
theExtendedAttr.Attributes = new Hashtable();
theExtendedAttr.ObjectType = formTypes[0];
theExtendedAttr.Attributes["project_id"] = "project_id";
itemProperty.ExtendedAttributes[0] = theExtendedAttr;
}
itemProps[i] = itemProperty;
}
// *****************************
// Execute the service operation
// *****************************
CreateItemsResponse response = dmService.CreateItems(itemProps, null, "");
// before control is returned the ChangedHandler will be called with
// newly created Item and ItemRevisions
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.createItems returned a partial error.");
return response.Output;
}
/**
* Reserve Revision IDs
*
* @param items Array of Items to reserve Ids for
*
* @return Map of RevisionIds
*
* @throws ServiceException If any partial errors are returned
*/
public Hashtable generateRevisionIds(Item[] items) //throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
GenerateRevisionIdsResponse response = null;
GenerateRevisionIdsProperties[] input = null;
input = new GenerateRevisionIdsProperties[items.Length];
for (int i = 0; i < items.Length; i++)
{
GenerateRevisionIdsProperties property = new GenerateRevisionIdsProperties();
property.Item = items[i];
property.ItemType = "";
input[i] = property;
}
// *****************************
// Execute the service operation
// *****************************
response = dmService.GenerateRevisionIds(input);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.generateRevisionIds returned a partial error.");
return response.OutputRevisionIds;
}
/**
* Revise Items
*
* @param revisionIds Map of Revsion IDs
* @param itemRevs Array of ItemRevisons
*
* @return Map of Old ItemRevsion(key) to new ItemRevision(value)
*
* @throws ServiceException If any partial errors are returned
*/
public Hashtable reviseItems(Hashtable revisionIds, ItemRevision[] itemRevs) //throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
Hashtable revs = new Hashtable();
for (int i = 0; i < itemRevs.Length; i++)
{
RevisionIds rev = (RevisionIds) revisionIds[i];
ReviseProperties revProps = new ReviseProperties();
revProps.RevId = rev.NewRevId;
revProps.Name = "testRevise";
revProps.Description = "describe testRevise";
Hashtable attrs = new Hashtable();
attrs["project_id"] = "project_id_val";
revProps.ExtendedAttributes = attrs;
revs[itemRevs[i]]= revProps;
}
// *****************************
// Execute the service operation
// *****************************
ReviseResponse revised = dmService.Revise(revs);
// before control is returned the ChangedHandler will be called with
// newly created Item and ItemRevisions
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (revised.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.revise returned a partial error.");
return revised.OldItemRevToNewItemRev;
}
/**
* Delete the Items
*
* @param items Array of Items to delete
*
* @throws ServiceException If any partial errors are returned
*/
public void deleteItems(Item[] items) //throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
// *****************************
// Execute the service operation
// *****************************
ServiceData serviceData = dmService.DeleteObjects(items);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.deleteObjects returned a partial error.");
}
/**
* Create ItemMasterForm and ItemRevisionMasterForm
*
* @param IMFormName Name of ItemMasterForm
* @param IMFormType Type of ItemMasterForm
* @param IRMFormName Name of ItemRevisionMasterForm
* @param IRMFormType Type of ItemRevisionMasterForm
* @param parent The container object that two
* newly-created forms will be added into.
* @return ModelObject[] Array of forms
*
* @throws ServiceException If any partial errors are returned
*/
public ModelObject[] createForms ( String IMFormName, String IMFormType,
String IRMFormName, String IRMFormType,
ModelObject parent, bool saveDB ) //throws ServiceException
{
//Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
FormInfo[] inputs = new FormInfo[2];
inputs[0] = new FormInfo();
inputs[0].ClientId = "1";
inputs[0].Description="";
inputs[0].Name = IMFormName;
inputs[0].FormType=IMFormType;
inputs[0].SaveDB = saveDB;
inputs[0].ParentObject = parent ;
inputs[1] = new FormInfo();
inputs[1].ClientId = "2";
inputs[1].Description="";
inputs[1].Name = IRMFormName;
inputs[1].FormType=IRMFormType;
inputs[1].SaveDB = saveDB;
inputs[1].ParentObject = parent;
CreateOrUpdateFormsResponse response = dmService.CreateOrUpdateForms(inputs);
if ( response.ServiceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.createForms returned a partial error.");
ModelObject[] forms = new ModelObject [inputs.Length];
for (int i=0; i<inputs.Length; ++i)
{
forms[i] = response.Outputs[i].Form;
}
return forms;
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,79 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
namespace Teamcenter.Hello
{
public class HomeFolder
{
/**
* List the contents of the Home folder.
*
*/
public void listHomeFolder(User user)
{
Folder home = null;
WorkspaceObject[] contents = null;
// Get the service stub
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
try
{
// User was a primary object returned from the login command
// the Object Property Policy should be configured to include the
// 'home_folder' property. However the actuall 'home_folder' object
// was a secondary object returned from the login request and
// therefore does not have any properties associated with it. We will need to
// get those properties explicitly with a 'getProperties' service request.
home = user.Home_folder;
}
catch (NotLoadedException e)
{
Console.Out.WriteLine(e.Message);
Console.Out.WriteLine("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
return;
}
try
{
ModelObject[] objects = { home };
String[] attributes = { "contents" };
// *****************************
// Execute the service operation
// *****************************
dmService.GetProperties(objects, attributes);
// The above getProperties call returns a ServiceData object, but it
// just has pointers to the same object we passed into the method, so the
// input object have been updated with new property values
contents = home.Contents;
}
// This should never be thrown, since we just explicitly asked for this
// property
catch (NotLoadedException /*e*/){}
Console.Out.WriteLine("");
Console.Out.WriteLine("Home Folder:");
Session.printObjects( contents );
}
}
}

@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace HelloTeamcenter.hello
{
public class MXLClass
{
private string index;
public string Index
{
get { return index; }
set { index = value; }
}
private string item_id;
public string Item_id
{
get { return item_id; }
set { item_id = value; }
}
private string partnumber;
public string Partnumber
{
get { return partnumber; }
set { partnumber = value; }
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private string object_desc;
public string Object_desc
{
get { return object_desc; }
set { object_desc = value; }
}
private string count;
public string Count
{
get { return count; }
set { count = value; }
}
private string material;
public string Material
{
get { return material; }
set { material = value; }
}
private string tolweight;
public string Tolweight
{
get { return tolweight; }
set { tolweight = value; }
}
private string perweight;
public string Perweight
{
get { return perweight; }
set { perweight = value; }
}
private string memo;
public string Memo
{
get { return memo; }
set { memo = value; }
}
private string itemtype;
public string Itemtype
{
get { return itemtype; }
set { itemtype = value; }
}
private int index_num;
public int Index_num
{
get { return index_num; }
set { index_num = value; }
}
private string producttype;
public string Producttype
{
get { return producttype; }
set { producttype = value; }
}
}
}

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Windows;
namespace HelloTeamcenter.hello
{
class MyExtension:Autodesk.AutoCAD.Runtime.IExtensionApplication
{
public void Initialize()
{
}
public void Terminate()
{
}
}
}

@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
namespace HelloTeamcenter.hello
{
public class OriginBTL
{
private Hashtable btlinfotable = null; // 块参照上所有信息<CAD属性名,CAD属性值>
public Hashtable Btlinfotable
{
get { return btlinfotable; }
set { btlinfotable = value; }
}
public OriginBTL()
{
this.btlname = "";
this.btlinfotable = new Hashtable();
this.btldatatable = new Hashtable();
this.btltctable = new Hashtable();
this.btltypetable = new Hashtable();
this.btlwritetable = new Hashtable();
this.Btlupdatetable = new Hashtable();
this.Btlfromtctable = new Hashtable();
}
private string btlname; //标题栏块参照名
public string Btlname
{
get { return btlname; }
set { btlname = value; }
}
private Hashtable btldatatable = null; // <CAD属性名,CAD属性值>
public Hashtable Btldatatable
{
get { return btldatatable; }
set { btldatatable = value; }
}
private Hashtable btltctable = null; // <CAD属性名,TC属性名>
public Hashtable Btltctable
{
get { return btltctable; }
set { btltctable = value; }
}
private Hashtable btltypetable = null; // <CAD属性名,TC类型名>
public Hashtable Btltypetable
{
get { return btltypetable; }
set { btltypetable = value; }
}
private Hashtable btlwritetable = null; // <CAD属性名writeable值>
public Hashtable Btlwritetable
{
get { return btlwritetable; }
set { btlwritetable = value; }
}
private Hashtable btlupdatetable = null; // <CAD属性名updateable值>
public Hashtable Btlupdatetable
{
get { return btlupdatetable; }
set { btlupdatetable = value; }
}
private Hashtable btlfromtctable = null; //<CAD属性名fromtc值>
public Hashtable Btlfromtctable
{
get { return btlfromtctable; }
set { btlfromtctable = value; }
}
}
}

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace HelloTeamcenter.hello
{
class OriginDataSet
{
private string datatype = null;
public string Datatype
{
get { return datatype; }
set { datatype = value; }
}
private string refname = null;
public string Refname
{
get { return refname; }
set { refname = value; }
}
private string separator = null;
public string Separator
{
get { return separator; }
set { separator = value; }
}
private string ds_name = null;
public string Ds_name
{
get { return ds_name; }
set { ds_name = value; }
}
public OriginDataSet()
{
this.datatype = "";
this.refname = "";
this.separator = "";
this.ds_name = "";
this.dsnametable = new Hashtable();
}
private Hashtable dsnametable = null;
public Hashtable Dsnametable
{
get { return dsnametable; }
set { dsnametable = value; }
}
}
}

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace HelloTeamcenter.hello
{
class OriginItemType
{
private Hashtable itemtypetable = null; //记录Item类型.xml文件的信息 <cad,tc>
public Hashtable Itemtypetable
{
get { return itemtypetable; }
set { itemtypetable = value; }
}
public OriginItemType()
{
itemtypetable = new Hashtable();
}
public void getType(string xmlpath)
{
OriginReadXml originreadxml = new OriginReadXml();
itemtypetable = originreadxml.OriginReadTypeXML(xmlpath, itemtypetable);
}
}
}

@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
namespace HelloTeamcenter.hello
{
public class OriginMXL
{
public OriginMXL()
{
this.mxlname = "";
this.Mxlinfotable = new Hashtable();
this.Mxldatatable = new Hashtable();
this.Mxltctable = new Hashtable();
this.Mxlisbomtable = new Hashtable();
this.Mxlupdatetable = new Hashtable();
this.Mxltypetable = new Hashtable();
}
private string mxlname; //明细栏块参照名
public string Mxlname
{
get { return mxlname; }
set { mxlname = value; }
}
private Hashtable mxlinfotable = null; //块参照上所有信息<CAD属性名,CAD属性值>
public Hashtable Mxlinfotable
{
get { return mxlinfotable; }
set { mxlinfotable = value; }
}
private Hashtable mxldatatable = null; // <CAD属性名,CAD属性值>
public Hashtable Mxldatatable
{
get { return mxldatatable; }
set { mxldatatable = value; }
}
private Hashtable mxltctable = null; // <CAD属性名,TC属性名>
public Hashtable Mxltctable
{
get { return mxltctable; }
set { mxltctable = value; }
}
private Hashtable mxlisbomtable = null; // <CAD属性名,是否是bomline属性>
public Hashtable Mxlisbomtable
{
get { return mxlisbomtable; }
set { mxlisbomtable = value; }
}
private Hashtable mxlupdatetable = null;// <CAD属性名,是否是需要更新的bomline属性>
public Hashtable Mxlupdatetable
{
get { return mxlupdatetable; }
set { mxlupdatetable = value; }
}
private Hashtable mxltypetable = null; //<CAD属性名,TC类型名>
public Hashtable Mxltypetable
{
get { return mxltypetable; }
set { mxltypetable = value; }
}
}
}

@ -0,0 +1,622 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Xml;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
namespace HelloTeamcenter.hello
{
class OriginReadXml
{
private Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
public OriginBTL OriginReadBTL(string filepath,string btlname)
{
OriginBTL btlinfo = new OriginBTL();
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点title
XmlNodeList xmltitlelist = xmldocument.SelectSingleNode("Titles").ChildNodes;
OriginTool origintool = new OriginTool();
foreach (XmlNode title in xmltitlelist)
{
//获得一个title
XmlElement xeonetitle = (XmlElement)title;
if (xeonetitle.HasAttribute("blockname"))
{
ed.WriteMessage("标题栏块名称:" + xeonetitle.GetAttribute("blockname").ToString() + "\n");
}
else
{
ed.WriteMessage("请确认标题栏.xml文件配置含有blockname属性\n");
return null;
}
string tempbtlname = xeonetitle.GetAttribute("blockname").ToString();
ed.WriteMessage("标题栏块名称:" + tempbtlname + "\n");
if (tempbtlname == btlname)
{
//获得title子节点
XmlNodeList onetitleinfo = xeonetitle.ChildNodes;
btlinfo.Btlname = btlname;
foreach (XmlNode node in onetitleinfo)
{
XmlElement xeone = (XmlElement)node;
string titletype = "";
string titlecad = "";
string titletc = "";
string titlewriteable = "";
string titleupdateable = "";
string titlefromtc = "";
if (xeone.HasAttribute("type"))
{
titletype = xeone.GetAttribute("type").ToString();
}
if (xeone.HasAttribute("cad"))
{
titlecad = xeone.GetAttribute("cad").ToString();
}
if (xeone.HasAttribute("tc"))
{
titletc = xeone.GetAttribute("tc").ToString();
}
if (xeone.HasAttribute("writeable"))
{
titlewriteable = xeone.GetAttribute("writeable").ToString();
}
if (xeone.HasAttribute("updateable"))
{
titleupdateable = xeone.GetAttribute("updateable").ToString();
}
if (xeone.HasAttribute("fromtc"))
{
titlefromtc = xeone.GetAttribute("fromtc").ToString();
}
/*ed.WriteMessage(xeone.GetAttribute("type").ToString() + " " +
xeone.GetAttribute("cad").ToString() + " " +
xeone.GetAttribute("tc").ToString() +"\n");*/
btlinfo.Btldatatable = origintool.TableHasKey(btlinfo.Btldatatable, titlecad, "");
btlinfo.Btltctable = origintool.TableHasKey(btlinfo.Btltctable, titlecad, titletc);
btlinfo.Btltypetable = origintool.TableHasKey(btlinfo.Btltypetable, titlecad, titletype);
btlinfo.Btlwritetable = origintool.TableHasKey(btlinfo.Btlwritetable, titlecad, titlewriteable);
btlinfo.Btlupdatetable = origintool.TableHasKey(btlinfo.Btlupdatetable, titlecad, titleupdateable);
btlinfo.Btlfromtctable = origintool.TableHasKey(btlinfo.Btlfromtctable,titlecad,titlefromtc);
}
}
}
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message + "\n");
}
finally
{
xmlreader.Close();
}
return btlinfo;
}
//获取标题栏.XML信息将信息与OriginBTL对应
public ArrayList OriginReadBTLXML(string filepath)
{
ArrayList listbtl = new ArrayList();
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
filepath = filepath + "标题栏.xml";
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点title
XmlNodeList xmltitlelist = xmldocument.SelectSingleNode("Titles").ChildNodes;
OriginTool origintool = new OriginTool();
foreach (XmlNode title in xmltitlelist)
{
//获得一个title
XmlElement xeonetitle = (XmlElement)title;
if (xeonetitle.HasAttribute("blockname"))
{
ed.WriteMessage("标题栏块名称:" + xeonetitle.GetAttribute("blockname").ToString() + "\n");
}
else
{
ed.WriteMessage("请确认标题栏.xml文件配置含有blockname属性\n");
return listbtl;
}
string btlname = xeonetitle.GetAttribute("blockname").ToString();
ed.WriteMessage("标题栏块名称:" + btlname + "\n");
OriginBTL btlinfo = origintool.GetTitleInfo(filepath, btlname);
if (btlinfo != null)
listbtl.Add(btlinfo);
}
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message+"\n");
}
finally
{
xmlreader.Close();
}
return listbtl;
}
public OriginMXL OriginReadMXL(string filepath)
{
OriginMXL mxlinfo = new OriginMXL();
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点bomline
XmlNodeList xmlmxllist = xmldocument.SelectSingleNode("BomLines").ChildNodes;
OriginTool origintool = new OriginTool();
foreach (XmlNode bomline in xmlmxllist)
{
//获得一个bomline
XmlElement xeonebomline = (XmlElement)bomline;
if (xeonebomline.HasAttribute("blockname"))
{
ed.WriteMessage("明细栏块名称:" + xeonebomline.GetAttribute("blockname").ToString() + "\n");
}
else
{
ed.WriteMessage("请确认明细表.xml文件配置含有blockname属性\n");
return null;
}
//获得bomline子节点
XmlNodeList onebomlineinfo = xeonebomline.ChildNodes;
mxlinfo.Mxlname = xeonebomline.GetAttribute("blockname").ToString();
foreach (XmlNode node in onebomlineinfo)
{
XmlElement xeone = (XmlElement)node;
/*ed.WriteMessage(xeone.GetAttribute("cad").ToString() + " " +
xeone.GetAttribute("tc").ToString() + " " +
xeone.GetAttribute("is_bomline").ToString() + " " +
xeone.GetAttribute("overwrite").ToString() + "\n");*/
string bomlinetype = "";
string bomlinecad = "";
string bomlinetc = "";
string isbomline = "";
string updatebomline = "";
if (xeone.HasAttribute("type"))
{
bomlinetype = xeone.GetAttribute("type").ToString();
}
if (xeone.HasAttribute("cad"))
{
bomlinecad = xeone.GetAttribute("cad").ToString();
}
if (xeone.HasAttribute("tc"))
{
bomlinetc = xeone.GetAttribute("tc").ToString();
}
if (xeone.HasAttribute("is_bomline"))
{
isbomline = xeone.GetAttribute("is_bomline").ToString();
}
if (xeone.HasAttribute("overwrite"))
{
updatebomline = xeone.GetAttribute("overwrite").ToString();
}
mxlinfo.Mxltypetable = origintool.TableHasKey(mxlinfo.Mxltypetable, bomlinecad, bomlinetype);
mxlinfo.Mxldatatable = origintool.TableHasKey(mxlinfo.Mxldatatable, bomlinecad, "");
mxlinfo.Mxltctable = origintool.TableHasKey(mxlinfo.Mxltctable, bomlinecad, bomlinetc);
mxlinfo.Mxlisbomtable = origintool.TableHasKey(mxlinfo.Mxlisbomtable, bomlinecad, isbomline);
mxlinfo.Mxlupdatetable = origintool.TableHasKey(mxlinfo.Mxlupdatetable, bomlinecad, updatebomline);
ed.WriteMessage("==================================\n");
}
}
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message + "\n");
}
finally
{
xmlreader.Close();
}
return mxlinfo;
}
//获取明细表.XML信息将信息与OriginMXL对应
public List<OriginMXL> OriginReadMXLXML(string filepath)
{
List<OriginMXL> listmxl = new List<OriginMXL>();
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
filepath = filepath + "明细表.xml";
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点bomline
XmlNodeList xmlmxllist = xmldocument.SelectSingleNode("BomLines").ChildNodes;
OriginTool origintool = new OriginTool();
string mxlname = "";
foreach (XmlNode bomline in xmlmxllist)
{
//获得一个bomline
XmlElement xeonebomline = (XmlElement)bomline;
if (xeonebomline.HasAttribute("blockname"))
{
ed.WriteMessage("明细栏块名称:" + xeonebomline.GetAttribute("blockname").ToString() + "\n");
mxlname = xeonebomline.GetAttribute("blockname").ToString();
}
else
{
ed.WriteMessage("请确认明细表.xml文件配置含有blockname属性\n");
return null;
}
}
listmxl = origintool.GetMXLInfo(filepath, mxlname);
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message + "\n");
}
finally
{
xmlreader.Close();
}
return listmxl;
}
//获取Item类型.xml文件信息
public Hashtable OriginReadTypeXML(string filepath,Hashtable itemtypetable)
{
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
filepath = filepath + "Item类型.xml";
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点ItemTypes
XmlNodeList xmltypelist = xmldocument.SelectSingleNode("ItemTypes").ChildNodes;
OriginTool origintool = new OriginTool();
foreach (XmlNode onetype in xmltypelist)
{
//获得一个ItemType
XmlElement xeonetype = (XmlElement)onetype;
//获得ItemType子节点
XmlNodeList onetypeinfo = xeonetype.ChildNodes;
foreach (XmlNode node in onetypeinfo)
{
XmlElement xeone = (XmlElement)node;
//string typecad = "";
string typetc = "";
//if (xeone.HasAttribute("cad"))
//{
// typecad = xeone.GetAttribute("cad").ToString();
//}
//else
// ed.WriteMessage("Item类型.xml文件配置不符合规范\n");
if (xeone.HasAttribute("tc"))
{
typetc = xeone.GetAttribute("tc").ToString();
}
else
ed.WriteMessage("Item类型.xml文件配置不符合规范\n");
/*ed.WriteMessage(xeone.GetAttribute("type").ToString() + " " +
xeone.GetAttribute("cad").ToString() + " " +
xeone.GetAttribute("tc").ToString() +"\n");*/
itemtypetable = origintool.TableHasKey(itemtypetable, typetc, typetc);
}
}
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message + "\n");
}
finally
{
xmlreader.Close();
}
return itemtypetable;
}
//获取Item类型.xml文件信息
public OriginDataSet OriginReadDataSetXML(string filepath)
{
OriginDataSet dataset = new OriginDataSet();
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
filepath = filepath + "数据集.xml";
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点ItemTypes
XmlNodeList xmldatalist = xmldocument.SelectSingleNode("DataSets").ChildNodes;
OriginTool origintool = new OriginTool();
foreach (XmlNode onedata in xmldatalist)
{
//获得一个data
XmlElement xeonedata = (XmlElement)onedata;
if (xeonedata.HasAttribute("type") && xeonedata.HasAttribute("refname") && xeonedata.HasAttribute("separator"))
{
dataset.Datatype = xeonedata.GetAttribute("type").ToString();
dataset.Refname = xeonedata.GetAttribute("refname").ToString();
dataset.Separator = xeonedata.GetAttribute("separator").ToString();
ed.WriteMessage(dataset.Datatype + "\t" + dataset.Refname + "\t" + dataset.Separator + "\n");
}
else
{
ed.WriteMessage("数据集.xml文件配置有误请确认\n");
return null;
}
//获得dataset子节点
XmlNodeList onedatainfo = xeonedata.ChildNodes;
foreach (XmlNode node in onedatainfo)
{
XmlElement xeone = (XmlElement)node;
if (xeone.HasAttribute("seq") && xeone.HasAttribute("from"))
{
int seq = Convert.ToInt32(xeone.GetAttribute("seq").ToString());
string from = xeone.GetAttribute("from").ToString();
dataset.Dsnametable = origintool.TableHasKey(dataset.Dsnametable, seq, from);
ed.WriteMessage(seq+"\t"+from+"\n");
}
}
}
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message + "\n");
}
finally
{
xmlreader.Close();
}
return dataset;
}
//获取规则.xml文件信息
public OriginTypeRule OriginReadRuleXML(string filepath)
{
OriginTypeRule origintyperule = new OriginTypeRule();
XmlReaderSettings settings = null;
XmlDocument xmldocument = null;
XmlReader xmlreader = null;
filepath = filepath + "规则.xml";
try
{
ed.WriteMessage("XML路径" + filepath + "\n");
settings = new XmlReaderSettings();
settings.IgnoreComments = true; ;//忽略文档里面的注释
xmldocument = new XmlDocument();
xmlreader = XmlReader.Create(filepath, settings);
xmldocument.Load(xmlreader);
//得到根节点的子节点Rule
XmlNodeList xmlrulelist = xmldocument.SelectSingleNode("Rules").ChildNodes;
OriginTool origintool = new OriginTool();
foreach (XmlNode onerule in xmlrulelist)
{
//获得一个rule
XmlElement xeonerule = (XmlElement)onerule;
if (xeonerule.HasAttribute("default"))
{
origintyperule.Defaulttype = xeonerule.GetAttribute("default").ToString();
ed.WriteMessage("默认类型:"+origintyperule.Defaulttype + "\n");
}
else
{
origintyperule.Defaulttype = "Item";
}
//获得rule子节点
XmlNodeList oneruleinfo = xeonerule.ChildNodes;
foreach (XmlNode node in oneruleinfo)
{
XmlElement xeone = (XmlElement)node;
if (xeone.HasAttribute("seq"))
{
int seq = Convert.ToInt32(xeone.GetAttribute("seq").ToString());
ed.WriteMessage("序号" + seq + "\n");
}
else
{
ed.WriteMessage("规则.xml文件中没有配置seq属性列请检查配置\n");
return null;
}
string seqstring = xeone.GetAttribute("seq").ToString();
if (xeone.HasAttribute("source"))
{
string sourcestring = xeone.GetAttribute("source").ToString();
ed.WriteMessage("序号:"+seqstring+"要处理的对象:" + sourcestring + "\n");
origintyperule.Sourcetable = origintool.TableHasKey(origintyperule.Sourcetable, seqstring, sourcestring);
}
else
origintyperule.Sourcetable = origintool.TableHasKey(origintyperule.Sourcetable, seqstring, "");
if (xeone.HasAttribute("startwith"))
{
string startstring = xeone.GetAttribute("startwith").ToString();
ed.WriteMessage("序号:" + seqstring + "startwith" + startstring + "\n");
origintyperule.Starttable = origintool.TableHasKey(origintyperule.Starttable, seqstring, startstring);
}
else
origintyperule.Starttable = origintool.TableHasKey(origintyperule.Starttable, seqstring, "");
if (xeone.HasAttribute("endwith"))
{
string endstring = xeone.GetAttribute("endwith").ToString();
ed.WriteMessage("序号:" + seqstring + "endwith" + endstring + "\n");
origintyperule.Endtable = origintool.TableHasKey(origintyperule.Endtable, seqstring, endstring);
}
else
origintyperule.Endtable = origintool.TableHasKey(origintyperule.Endtable, seqstring, "");
if (xeone.HasAttribute("contain"))
{
string containstring = xeone.GetAttribute("contain").ToString();
ed.WriteMessage("序号:" + seqstring + "contain" + containstring + "\n");
origintyperule.Containtable = origintool.TableHasKey(origintyperule.Containtable,seqstring,containstring);
}
else
origintyperule.Containtable = origintool.TableHasKey(origintyperule.Containtable, seqstring, "");
if (xeone.HasAttribute("equal"))
{
string equalstring = xeone.GetAttribute("equal").ToString();
ed.WriteMessage("序号:" + seqstring + "equal" + equalstring + "\n");
origintyperule.Equaltable = origintool.TableHasKey(origintyperule.Equaltable,seqstring,equalstring);
}
else
origintyperule.Equaltable = origintool.TableHasKey(origintyperule.Equaltable, seqstring, "");
if (xeone.HasAttribute("type"))
{
string typestring = xeone.GetAttribute("type").ToString();
ed.WriteMessage("序号:" + seqstring + "type" + typestring + "\n");
origintyperule.Typetable = origintool.TableHasKey(origintyperule.Typetable,seqstring,typestring);
}
else
origintyperule.Typetable = origintool.TableHasKey(origintyperule.Typetable, seqstring, "");
if (xeone.HasAttribute("true"))
{
string truestring = xeone.GetAttribute("true").ToString();
ed.WriteMessage("序号:" + seqstring + "true" + truestring + "\n");
origintyperule.Truetable = origintool.TableHasKey(origintyperule.Truetable,seqstring,truestring);
}
else
origintyperule.Truetable = origintool.TableHasKey(origintyperule.Truetable, seqstring, "");
if (xeone.HasAttribute("false"))
{
string falsestring = xeone.GetAttribute("false").ToString();
ed.WriteMessage("序号:" + seqstring + "false" + falsestring + "\n");
origintyperule.Falsetable = origintool.TableHasKey(origintyperule.Falsetable,seqstring,falsestring);
}
else
origintyperule.Falsetable = origintool.TableHasKey(origintyperule.Falsetable, seqstring, "");
}
}
}
catch (System.Exception ex)
{
xmlreader.Close();
ed.WriteMessage(ex.Message + "\n");
}
finally
{
xmlreader.Close();
}
return origintyperule;
}
}
}

@ -0,0 +1,801 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;
using System.Data;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Teamcenter.Services.Strong.Query._2007_06.SavedQuery;
using Teamcenter.Hello;
using Teamcenter.Soa.Client;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Teamcenter.Services.Strong.Query;
using Teamcenter.Services.Strong.Core._2007_06.DataManagement;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Services.Strong.Query._2006_03.SavedQuery;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using ImanFile = Teamcenter.Soa.Client.Model.Strong.ImanFile;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
using DataSet = Teamcenter.Soa.Client.Model.Strong.Dataset;
using SavedQueryResults = Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults;
namespace HelloTeamcenter.hello
{
public class SortMXL1 : IComparer<OriginMXL>
{
public int Compare(OriginMXL one, OriginMXL two)
{
return (Convert.ToInt32(one.Mxldatatable["序号"].ToString())).CompareTo((Convert.ToInt32(two.Mxldatatable["序号"].ToString())));
}
}
class OriginTool
{
private Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
private static User loginuser;
public static User Loginuser
{
get { return OriginTool.loginuser; }
set { OriginTool.loginuser = value; }
}
//获取标题栏信息
public OriginBTL GetTitleInfo(string filepath,string btlname)
{
//OriginTool origintool = new OriginTool();
OriginBTL btlinfo = new OriginBTL();
OriginReadXml originreadxml = new OriginReadXml();
btlinfo = originreadxml.OriginReadBTL(filepath,btlname);
if(btlinfo ==null)
return null;
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable blt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
if (blt.Has(btlname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForRead) as Entity;
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
if (bref.Name == btlname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForRead);
if (btlinfo.Btldatatable.ContainsKey(aRef.Tag))
{
btlinfo.Btldatatable = this.TableHasKey(btlinfo.Btldatatable, aRef.Tag, aRef.TextString);
}
btlinfo.Btlinfotable = this.TableHasKey(btlinfo.Btlinfotable, aRef.Tag, aRef.TextString);
}
}
}
}
}
}
tran.Commit();
}
return btlinfo;
}
public void SetTitleInfo(string btlname, Hashtable tempvaluetable)
{
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable blt = tran.GetObject(db.BlockTableId, OpenMode.ForWrite) as BlockTable;
if (blt.Has(btlname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForWrite) as Entity;
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
if (bref.Name == btlname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForWrite);
if (tempvaluetable.Contains(aRef.Tag.ToString()))
{
ed.WriteMessage("设置" + aRef.Tag.ToString() + "\t" + tempvaluetable[aRef.Tag.ToString()].ToString() + "\n");
aRef.TextString = tempvaluetable[aRef.Tag.ToString()].ToString();
}
}
}
}
}
}
}
tran.Commit();
}
}
//判断当前table是否还有指定key值如果有则用新的value值替换
public Hashtable TableHasKey(Hashtable target, object key, object value)
{
if(target.Contains(key))
{
target.Remove(key);
}
target.Add(key, value);
return target;
}
//获取明细栏信息
public List<OriginMXL> GetMXLInfo(string filepath, string mxlname)
{
//OriginTool origintool = new OriginTool();
List<OriginMXL> mxllist = new List<OriginMXL>();
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable blt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
//string mxlname = mxlinfo.Mxlname;
if (blt.Has(mxlname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForRead) as Entity;
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
if (bref.Name == mxlname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
OriginMXL onemxlinfo = new OriginMXL();
OriginReadXml originreadxml = new OriginReadXml();
onemxlinfo = originreadxml.OriginReadMXL(filepath);
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForRead);
if (onemxlinfo.Mxldatatable.ContainsKey(aRef.Tag))
{
onemxlinfo.Mxldatatable = this.TableHasKey(onemxlinfo.Mxldatatable, aRef.Tag, aRef.TextString);
}
onemxlinfo.Mxlinfotable = this.TableHasKey(onemxlinfo.Mxlinfotable, aRef.Tag, aRef.TextString);
}
mxllist.Add(onemxlinfo);
}
}
}
}
}
tran.Commit();
}
return mxllist;
}
//获取指定块参照名称中对应的属性值
public string GetValueByBlock(string blockname,string attributename)
{
string attrvalue = "";
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable block = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
//string mxlname = mxlinfo.Mxlname;
if (block.Has(blockname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForRead) as Entity;
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
if (bref.Name == blockname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForRead);
if (aRef.Tag.ToString() == attributename)
{
attrvalue = aRef.TextString;
return attrvalue;
}
}
}
}
}
}
}
tran.Commit();
}
return attrvalue;
}
//获取数据集.xml文件配置信息
public OriginDataSet GetDataSetInfo(OriginDataSet dataset, OriginBTL btlinfo)
{
string ds_name = "";
for (int i = 1; i < dataset.Dsnametable.Count+1; i++)
{
string[] tempstring = dataset.Dsnametable[i].ToString().Split('.');
string blockname = tempstring[0];
string attributename = tempstring[1];
if (blockname == btlinfo.Btlname)
{
if (btlinfo.Btlinfotable.ContainsKey(attributename))
{
ds_name = ds_name + btlinfo.Btlinfotable[attributename].ToString();
}
}
else
{
ds_name = ds_name + this.GetValueByBlock(blockname, attributename);
}
}
ed.WriteMessage(ds_name+"\n");
dataset.Ds_name = ds_name;
return dataset;
}
//对bomline进行排序
public List<OriginMXL> sortbomlist(List<OriginMXL> sortbomlist)
{
sortbomlist.Sort(new SortMXL1());
return sortbomlist;
}
//根据item_id搜索
public SavedQueryResults getSearchItem(string item_id)
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("OriginSearchItemID"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'OriginSearchItemID' query.\n");
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "Item ID" };
savedQueryInput[0].Entries = new String[] { "零组件 ID" };
savedQueryInput[0].Values = new String[1];
savedQueryInput[0].Values[0] = item_id;
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Items:" + found.NumOfObjects + "\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
//根据item_id,name,type,owner搜索
public SavedQueryResults getSearchItem(string item_id, string name, string type, string owner)
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("OriginSearchForItem"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'OriginSearchForItem' query.\n");
}
try
{
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "Name", "Item ID", "Type", "Owning User" };
savedQueryInput[0].Entries = new String[] { "名称", "零组件 ID", "类型", "所有权用户" };
savedQueryInput[0].Values = new String[4];
savedQueryInput[0].Values[0] = name;
savedQueryInput[0].Values[1] = item_id;
savedQueryInput[0].Values[2] = type;
savedQueryInput[0].Values[3] = owner;
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Items:" + found.NumOfObjects + "\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
//查询所有用户
public SavedQueryResults getSearchUser()
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("OriginSearchForUser"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'OriginSearchForUser' query.\n");
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "User Id" };
savedQueryInput[0].Entries = new String[] { "用户 ID" };
savedQueryInput[0].Values = new String[1];
savedQueryInput[0].Values[0] = "*";
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Users:" + found.NumOfObjects + "\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
//获得指定名称首选项:站点类型
public Hashtable getTCPreferences(string prefername)
{
Hashtable prefValues = new Hashtable();
SessionService sessionservice = SessionService.getService(Session.getConnection());
Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames[] prefNames = new Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames[1];
Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames scopedPref = new Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames();
scopedPref.Names = new String[] { prefername };
scopedPref.Scope = "site";
prefNames[0] = scopedPref;
Teamcenter.Services.Strong.Core._2007_01.Session.MultiPreferencesResponse resp = sessionservice.GetPreferences(prefNames);
Teamcenter.Services.Strong.Core._2007_01.Session.ReturnedPreferences[] preferenceResp = resp.Preferences;
prefValues.Add(preferenceResp[0].Name, preferenceResp[0].Values);
//string temp = preferenceResp[0].Name.ToString();
//string[] value = (string[])prefValues[preferenceResp[0].Name.ToString()];
return prefValues;
}
public bool checkxml(string xmlpath)
{
if (File.Exists(xmlpath + "标题栏.xml"))
ed.WriteMessage("标题栏.xml准备就绪\n");
else
{
ed.WriteMessage("系统路径下不存在标题栏.xml文件\n");
return false;
}
if (File.Exists(xmlpath + "明细表.xml"))
ed.WriteMessage("明细表.xml准备就绪\n");
else
{
ed.WriteMessage("系统路径下不存在明细表.xml文件\n");
return false;
}
if (File.Exists(xmlpath + "Item类型.xml"))
ed.WriteMessage("Item类型.xml准备就绪\n");
else
{
ed.WriteMessage("系统路径下不存在Item类型.xml文件\n");
return false;
}
if (File.Exists(xmlpath + "数据集.xml"))
ed.WriteMessage("数据集.xml准备就绪\n");
else
{
ed.WriteMessage("系统路径下不存在数据集.xml文件\n");
return false;
}
if (File.Exists(xmlpath + "规则.xml"))
ed.WriteMessage("规则.xml准备就绪\n");
else
{
ed.WriteMessage("系统路径下不存在规则.xml文件\n");
return false;
}
return true;
}
//通过value值找key值
public object getKeyFromValue(Hashtable table,object value)
{
if (table.ContainsValue(value))
{
foreach (DictionaryEntry de in table)
{
if (de.Value.Equals(value))
{
return de.Key;
}
}
}
return null;
}
//获得标题栏Item类型
public string getItemType(OriginBTL btlinfo, OriginTypeRule origintyperule)
{
if (origintyperule == null)
return "Item";
this.itemtype = origintyperule.Defaulttype.ToString();
this.getTypeByRule(btlinfo.Btlinfotable, origintyperule, "1", "");
return this.itemtype;
}
private string itemtype = "";
//获得明细栏Item类型
public string getItemType(OriginMXL mxlinfo, OriginTypeRule origintyperule)
{
if (origintyperule == null)
return "Item";
this.itemtype = origintyperule.Defaulttype.ToString();
this.getTypeByRule(mxlinfo.Mxlinfotable, origintyperule, "1","");
return this.itemtype;
}
//通过规则获得需要的Item类型
private void getTypeByRule(Hashtable infotable, OriginTypeRule origintyperule,
string pos,string usestringvalue)
{
ed.WriteMessage("当前source" + usestringvalue + "\n");
ed.WriteMessage("当前pos" + pos + "\n");
//获得source对应的数据
string sourcestring = origintyperule.Sourcetable[pos].ToString();
string sourcevalue = "";
if (sourcestring == "")
{
sourcevalue = usestringvalue;
}
else
{
ed.WriteMessage("source值"+sourcestring+"\n");
sourcevalue = infotable[sourcestring].ToString();
}
//检查是否存在type如果有则直接返回
string typestring = origintyperule.Typetable[pos].ToString();
if (typestring != "")
{
this.itemtype = typestring;
return;
}
//处理判断条件
string startstring = origintyperule.Starttable[pos].ToString();
string endstring = origintyperule.Endtable[pos].ToString();
string containstring = origintyperule.Containtable[pos].ToString();
string equalstring = origintyperule.Equaltable[pos].ToString();
if (startstring != "")
{
if (sourcevalue.StartsWith(startstring))
{
string truestring = origintyperule.Truetable[pos].ToString();
if (truestring != "")
{
this.getTypeByRule(infotable, origintyperule, truestring, sourcevalue);
}
}
else
{
string falsestring = origintyperule.Falsetable[pos].ToString();
if (falsestring != "")
{
this.getTypeByRule(infotable, origintyperule, falsestring, sourcevalue);
}
}
}
else if (endstring != "")
{
if (sourcevalue.EndsWith(endstring))
{
string truestring = origintyperule.Truetable[pos].ToString();
if (truestring != "")
{
this.getTypeByRule(infotable, origintyperule, truestring, sourcevalue);
}
}
else
{
string falsestring = origintyperule.Falsetable[pos].ToString();
if (falsestring != "")
{
this.getTypeByRule(infotable, origintyperule, falsestring, sourcevalue);
}
}
}
else if (containstring != "")
{
if (sourcevalue.Contains(containstring))
{
string truestring = origintyperule.Truetable[pos].ToString();
if (truestring != "")
{
this.getTypeByRule(infotable, origintyperule, truestring, sourcevalue);
}
}
else
{
string falsestring = origintyperule.Falsetable[pos].ToString();
if (falsestring != "")
{
this.getTypeByRule(infotable, origintyperule, falsestring, sourcevalue);
}
}
}
else if (equalstring !="")
{
if (sourcevalue.Equals(equalstring))
{
string truestring = origintyperule.Truetable[pos].ToString();
if (truestring != "")
{
this.getTypeByRule(infotable, origintyperule, truestring, sourcevalue);
}
}
else
{
string falsestring = origintyperule.Falsetable[pos].ToString();
if (falsestring != "")
{
this.getTypeByRule(infotable, origintyperule, falsestring, sourcevalue);
}
}
}
}
//分割字符串取出对应xml文件的的Item的ID
public List<string> getCorrespondItemID(string[] tempprevalues)
{
List<string> itemidlist = new List<string>();
Hashtable temptable = new Hashtable();
for (int i = 0; i < tempprevalues.Length; i++)
{
string tempvalueline = tempprevalues[i];
string[] tempvalue = tempvalueline.Split('=');
itemidlist.Add(tempvalue[1].ToString());
}
return itemidlist;
}
public bool downloadfile(Item DMTItem,string xmlpath)
{
bool result = false;
string DMTFilepath = "";
DataManagementService dmService = DataManagementService.getService(Session.getConnection());
Editor ed1 = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
ModelObject[] itemrevisionlist = null;
ModelObject[] objects = { DMTItem };
String[] attributes = { "revision_list" };
dmService.RefreshObjects(objects);
dmService.GetProperties(objects, attributes);
itemrevisionlist = DMTItem.Revision_list;
ItemRevision itemrevision = itemrevisionlist[itemrevisionlist.Length - 1] as ItemRevision;
ExpandGRMRelationsPref myPref = new ExpandGRMRelationsPref();
RelationAndTypesFilter2 myFilter = new RelationAndTypesFilter2();
myFilter.RelationName = "IMAN_specification";
String[] typeVec = { "Text" };
myFilter.ObjectTypeNames = typeVec;
myPref.ExpItemRev = false;
RelationAndTypesFilter2[] myfilter = { myFilter };
myPref.Info = myfilter;
ModelObject[] objects1 = { itemrevision };
ExpandGRMRelationsResponse myResp = dmService.ExpandGRMRelationsForPrimary(objects1, myPref);
ExpandGRMRelationsOutput[] myoutput = myResp.Output;
for (int i = 0; i < myoutput.Length; i++)
{
ExpandGRMRelationsOutput one_out = myoutput[i];
for (int j = 0; j < one_out.OtherSideObjData.Length; j++)
{
ExpandGRMRelationsData otherSideData = one_out.OtherSideObjData[j];
for (int k = 0; k < otherSideData.OtherSideObjects.Length; k++)
{
Type typeinfo = otherSideData.OtherSideObjects[k].GetType();
string typename = typeinfo.Name;
if (typename == "Text")
{
DataSet dateset = otherSideData.OtherSideObjects[k] as DataSet;
ModelObject[] objects2 = { dateset };
String[] attributes2 = { "is_modifiable", "checked_out", "ref_list" };
dmService.RefreshObjects(objects2);
dmService.GetProperties(objects2, attributes2);
ModelObject[] dsfilevec = dateset.Ref_list;
ImanFile dsfile = dsfilevec[0] as ImanFile;
ModelObject[] objects3 = { dsfile };
String[] attributes3 = { "relative_directory_path", "original_file_name" };
dmService.RefreshObjects(objects3);
dmService.GetProperties(objects3, attributes3);
string newfilename = dsfile.Original_file_name;
ed1.WriteMessage("Original_file_name : " + newfilename + "\n");
//string tempdir = System.Environment.GetEnvironmentVariable("TEMP").ToString();
//ed1.WriteMessage("TEMP:" + tempdir.ToString() + "\n");
Teamcenter.Soa.Client.FileManagementUtility fmu = new Teamcenter.Soa.Client.FileManagementUtility(Teamcenter.ClientX.Session.getConnection());
Teamcenter.Soa.Client.GetFileResponse getFileResponse = fmu.GetFiles(dsfilevec);
FileInfo[] fileinfovec = getFileResponse.GetFiles();
FileInfo file = fileinfovec[0];
DMTFilepath = xmlpath + newfilename;
ed1.WriteMessage("拷贝路径:" + DMTFilepath + "\n");
System.IO.File.Copy(file.FullName, DMTFilepath, true);
System.IO.File.SetAttributes(DMTFilepath, FileAttributes.Normal);
if (DMTFilepath != "")
result = true;
}
}
}
}
return result;
}
}
}

@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace HelloTeamcenter.hello
{
class OriginTypeRule
{
private string defaulttype = ""; //属性default
public string Defaulttype
{
get { return defaulttype; }
set { defaulttype = value; }
}
private Hashtable sourcetable = null; //<seq,source>用于存放需要的cad图纸信息
public Hashtable Sourcetable
{
get { return sourcetable; }
set { sourcetable = value; }
}
private Hashtable starttable = null; //<seq,startwith>用于存放startwith判断条件
public Hashtable Starttable
{
get { return starttable; }
set { starttable = value; }
}
private Hashtable endtable = null; //<seq,endwith>用于存放endwith判断条件
public Hashtable Endtable
{
get { return endtable; }
set { endtable = value; }
}
private Hashtable containtable = null; //<seq,contain>用于存放contain的判断条件
public Hashtable Containtable
{
get { return containtable; }
set { containtable = value; }
}
private Hashtable equaltable = null; //<seq,equal>用于存放equal的判断条件
public Hashtable Equaltable
{
get { return equaltable; }
set { equaltable = value; }
}
private Hashtable truetable = null; //<seq,true>用于存放判断后成功走向
public Hashtable Truetable
{
get { return truetable; }
set { truetable = value; }
}
private Hashtable falsetable = null;//<seq,false>用于存放判断后失败走向
public Hashtable Falsetable
{
get { return falsetable; }
set { falsetable = value; }
}
private Hashtable typetable = null; //<seq,type>用于存放返回的type类型
public Hashtable Typetable
{
get { return typetable; }
set { typetable = value; }
}
public OriginTypeRule()
{
this.defaulttype = "";
this.sourcetable = new Hashtable();
this.starttable = new Hashtable();
this.endtable = new Hashtable();
this.containtable = new Hashtable();
this.equaltable = new Hashtable();
this.truetable = new Hashtable();
this.falsetable = new Hashtable();
this.typetable = new Hashtable();
}
}
}

@ -0,0 +1,112 @@
//==================================================
//
// @<COPYRIGHT>@
//
//==================================================
using System;
using Teamcenter.ClientX;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
//Include the Saved Query Service Interface
using Teamcenter.Services.Strong.Query;
// Input and output structures for the service operations
// Note: the different namespace from the service interface
using Teamcenter.Services.Strong.Query._2006_03.SavedQuery;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
namespace Teamcenter.Hello
{
public class Query
{
/**
* Perform a simple query of the database
*
*/
public void queryItems()
{
ImanQuery query = null;
// Get the service stub
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
// *****************************
// Execute the service operation
// *****************************
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
Console.Out.WriteLine("There are no saved queries in the system.");
return;
}
// Find one called 'Item Name'
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("Item Name"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
Console.Out.WriteLine("GetSavedQueries service request failed.");
Console.Out.WriteLine(e.Message);
return;
}
if (query == null)
{
Console.WriteLine("There is not an 'Item Name' query.");
return;
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
savedQueryInput[0].MaxNumToReturn = 25;
savedQueryInput[0].LimitListCount = 0;
savedQueryInput[0].LimitList = new Teamcenter.Soa.Client.Model.ModelObject[0];
savedQueryInput[0].Entries = new String[] { "Item Name" };
savedQueryInput[0].Values = new String[1];
savedQueryInput[0].Values[0] = "*";
savedQueryInput[0].MaxNumToInflate = 25;
//*****************************
//Execute the service operation
//*****************************
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
System.Console.Out.WriteLine("");
System.Console.Out.WriteLine("Found Items:");
Teamcenter.ClientX.Session.printObjects( found.Objects );
}
catch (ServiceException e)
{
Console.Out.WriteLine("ExecuteSavedQuery service request failed.");
Console.Out.WriteLine(e.Message);
return;
}
}
}
}

@ -0,0 +1,691 @@
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Teamcenter.Services.Strong.Query._2007_06.SavedQuery;
using Teamcenter.Hello;
using Teamcenter.Soa.Client;
using Teamcenter.ClientX;
using Teamcenter.Services.Strong.Core;
using Teamcenter.Soa.Client.Model;
using Teamcenter.Soa.Exceptions;
using Teamcenter.Services.Strong.Query;
using Teamcenter.Services.Strong.Core._2007_06.DataManagement;
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
using Teamcenter.Services.Strong.Query._2006_03.SavedQuery;
using User = Teamcenter.Soa.Client.Model.Strong.User;
using Folder = Teamcenter.Soa.Client.Model.Strong.Folder;
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
using Item = Teamcenter.Soa.Client.Model.Strong.Item;
using ItemRevision = Teamcenter.Soa.Client.Model.Strong.ItemRevision;
using ImanQuery = Teamcenter.Soa.Client.Model.Strong.ImanQuery;
using DataSet = Teamcenter.Soa.Client.Model.Strong.Dataset;
using SavedQueryResults = Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults;
namespace HelloTeamcenter.hello
{
public class SortMXL:IComparer<MXLClass>
{
public int Compare(MXLClass one, MXLClass two)
{
return one.Index_num.CompareTo(two.Index_num);
}
}
class Tool
{
private BTLClass btlinfo;
private List<MXLClass> bomlist = new List<MXLClass>();
private static User loginuser;
public static User Loginuser
{
get { return Tool.loginuser; }
set { Tool.loginuser = value; }
}
Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
public BTLClass getBTL(string btlname)
{
btlinfo = new BTLClass();
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable blt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
//ed.WriteMessage("名称"+blt.GetType().Name);
if (blt.Has(btlname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForRead) as Entity;
//ed.WriteMessage(ent.GetType().Name + "\n");
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
//ed.WriteMessage(bref.GetType().Name + "====\n");
//ed.WriteMessage(bref.Name + "====\n");
if (bref.Name == btlname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForRead);
//ed.WriteMessage("属性:" + aRef.Tag + "属性值:" + aRef.TextString + "\n");
if(aRef.Tag == "图号")
{
btlinfo.Item_id = aRef.TextString;
}
else if (aRef.Tag == "零/部件名称")
{
btlinfo.Item_name = aRef.TextString;
}
else if (aRef.Tag == "项目-产品名称")
{
btlinfo.Projectname = aRef.TextString;
}
else if (aRef.Tag == "代号")
{
btlinfo.Partnumber = aRef.TextString;
}
else if (aRef.Tag == "比例")
{
btlinfo.Proportion = aRef.TextString;
}
else if (aRef.Tag == "图幅")
{
btlinfo.Mapsheet = aRef.TextString;
}
else if (aRef.Tag == "版本")
{
btlinfo.Item_revision_id = aRef.TextString;
}
else if (aRef.Tag == "重量")
{
btlinfo.Weight = aRef.TextString;
}
else if (aRef.Tag == "材料牌号")
{
btlinfo.Materialgrade = aRef.TextString;
}
else if (aRef.Tag == "共几页")
{
btlinfo.Allpage = aRef.TextString;
if (btlinfo.Allpage == "")
btlinfo.Allpage = "1";
}
else if (aRef.Tag == "第几页")
{
btlinfo.Pagenumber = aRef.TextString;
if (btlinfo.Pagenumber == "")
btlinfo.Pagenumber = "1";
}
}
}
}
}
}
}
tran.Commit();
}
return btlinfo;
}
public string getQZL(string qzlname)
{
string hedao = "";
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable blt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
//ed.WriteMessage("名称"+blt.GetType().Name);
if (blt.Has(qzlname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForRead) as Entity;
//ed.WriteMessage(ent.GetType().Name + "\n");
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
//ed.WriteMessage(bref.GetType().Name + "====\n");
//ed.WriteMessage(bref.Name + "====\n");
if (bref.Name == qzlname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForRead);
//ed.WriteMessage("属性:" + aRef.Tag + "属性值:" + aRef.TextString + "\n");
if (aRef.Tag == "校核")
{
hedao = "非核岛";
}
}
}
}
}
}
}
tran.Commit();
}
return hedao;
}
public List<MXLClass> getMXL(string mxlname)
{
bomlist.Clear();
Database db = HostApplicationServices.WorkingDatabase;
using (Transaction tran = db.TransactionManager.StartTransaction())
{
BlockTable blt = tran.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable;
//ed.WriteMessage("名称"+blt.GetType().Name);
if (blt.Has(mxlname))
{
BlockTableRecord bltr = tran.GetObject(db.CurrentSpaceId, OpenMode.ForRead) as BlockTableRecord;
foreach (ObjectId item in bltr)
{
Entity ent = tran.GetObject(item, OpenMode.ForRead) as Entity;
//ed.WriteMessage(ent.GetType().Name + "\n");
if (ent.GetType().Name == "BlockReference")
{
BlockReference bref = (BlockReference)ent;
//ed.WriteMessage(bref.GetType().Name + "====\n");
//ed.WriteMessage(bref.Name + "====\n");
if (bref.Name == mxlname)
{
ed.WriteMessage("块名称:" + bref.Name + "\n");
if (bref.AttributeCollection.Count != 0)
{
System.Collections.IEnumerator bRefEnum = bref.AttributeCollection.GetEnumerator();
MXLClass mxlinfo = new MXLClass();
while (bRefEnum.MoveNext())
{
ObjectId aId = (ObjectId)bRefEnum.Current;//这一句极其关键
AttributeReference aRef = (AttributeReference)tran.GetObject(aId, OpenMode.ForRead);
//ed.WriteMessage("属性:" + aRef.Tag + "属性值:" + aRef.TextString + "\n");
if (aRef.Tag == "序号")
{
mxlinfo.Index = aRef.TextString;
mxlinfo.Index_num = Convert.ToInt32(mxlinfo.Index);
}
else if (aRef.Tag == "图号")
{
mxlinfo.Item_id = aRef.TextString;
}
else if (aRef.Tag == "代号")
{
mxlinfo.Partnumber = aRef.TextString;
}
else if (aRef.Tag == "名称")
{
mxlinfo.Name = aRef.TextString;
}
else if (aRef.Tag == "DESCRIPTION")
{
mxlinfo.Object_desc = aRef.TextString;
}
else if (aRef.Tag == "数量")
{
mxlinfo.Count = aRef.TextString;
}
else if (aRef.Tag == "材料")
{
mxlinfo.Material = aRef.TextString;
}
else if (aRef.Tag == "单重")
{
mxlinfo.Perweight = aRef.TextString;
}
else if (aRef.Tag == "总重")
{
mxlinfo.Tolweight = aRef.TextString;
}
else if (aRef.Tag == "备注")
{
mxlinfo.Memo = aRef.TextString;
}
}
bomlist.Add(mxlinfo);
}
}
}
}
}
tran.Commit();
}
return bomlist;
}
public List<MXLClass> sortbomlist(List<MXLClass> sortbomlist)
{
for (int i = 0; i < sortbomlist.Count; i++)
{
sortbomlist[i].Itemtype = initItemType(sortbomlist[i].Item_id, sortbomlist[i].Material);
}
sortbomlist.Sort(new SortMXL());
return sortbomlist;
}
public string initItemType(string item_id, string material)
{
string type = "";
int pos = item_id.IndexOf("DR");
ed.WriteMessage("pos: " + pos + "\n");
if (pos >= 0)
{
string sub = item_id.Substring(pos + 2);
ed.WriteMessage("sub :" + sub + "\n");
char[] subchar = sub.ToCharArray();
int i = 0;
if (subchar[i].ToString() == "8")
{
ed.WriteMessage("是否含有CG-" + item_id.Contains("CG-").ToString());
if (item_id.Contains("CG-"))
{
type = "D5PruchasePart";
return type;
}
}
for (; i < subchar.Length; i++)
{
if (subchar[i].ToString() == "0")
continue;
else
{
if (material == "装配件")
{
type = "D5AsmPart";
return type;
}
else
{
type = "D5Part";
return type;
}
}
}
if (material == "装配件" && i == subchar.Length)
{
type = "D5Product";
}
}
else
{
if(item_id.StartsWith("104") || item_id.StartsWith("105"))
type = "D5StdFasteners";
else if(item_id.StartsWith("TC"))
type = "D5CommonParts";
else
type = "D5Part";
}
return type;
}
public string getLOVProductType(string item_id,string itemtype,string hedao)
{
string productTypes = "";
if (itemtype == "D5Product")
{
if (hedao == "非核岛")
productTypes = "117";
else
productTypes = "116";
}
else if (itemtype == "D5AsmPart")
{
if (hedao == "非核岛")
productTypes = "115";
else
productTypes = "114";
}
else if (itemtype == "D5Part")
{
if (hedao == "非核岛")
productTypes = "113";
else
productTypes = "112";
}
else if (itemtype == "D5StdFasteners")
{
if(item_id.StartsWith("104"))
productTypes = "104";
else
productTypes = "105";
}
else if (itemtype == "D5CommonPartss")
{
if (item_id.StartsWith("120"))
productTypes = "120";
else
productTypes = "121";
}//此处需要增加D5PruchasePart类型的核岛判断
return productTypes;
}
public SavedQueryResults getSearchItem(string item_id)
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("D5Item ID"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'D5Item ID' query.\n");
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "Item ID" };
savedQueryInput[0].Entries = new String[] { "零组件 ID" };
savedQueryInput[0].Values = new String[1];
savedQueryInput[0].Values[0] = item_id;
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Items:"+ found.NumOfObjects +"\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
public SavedQueryResults getSearchItem(string item_id,string name,string type,string owner)
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("D5SearchForItem"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'D5SearchForItem' query.\n");
}
try
{
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "Name", "Item ID", "Type", "Owning User" };
savedQueryInput[0].Entries = new String[] { "名称", "零组件 ID", "类型", "所有权用户" };
savedQueryInput[0].Values = new String[4];
savedQueryInput[0].Values[0] = name;
savedQueryInput[0].Values[1] = item_id;
savedQueryInput[0].Values[2] = type;
savedQueryInput[0].Values[3] = owner;
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Items:" + found.NumOfObjects + "\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
public SavedQueryResults getSearchUser()
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("D5SearchForUser"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'D5SearchForUser' query.\n");
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "User Id" };
savedQueryInput[0].Entries = new String[] { "用户 ID" };
savedQueryInput[0].Values = new String[1];
savedQueryInput[0].Values[0] = "*";
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Users:" + found.NumOfObjects + "\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
public SavedQueryResults getSearchType(string d5MaterialGrades)
{
ImanQuery query = null;
SavedQueryService queryService = SavedQueryService.getService(Session.getConnection());
try
{
GetSavedQueriesResponse savedQueries = queryService.GetSavedQueries();
if (savedQueries.Queries.Length == 0)
{
ed.WriteMessage("There are no saved queries in the system.\n");
}
for (int i = 0; i < savedQueries.Queries.Length; i++)
{
if (savedQueries.Queries[i].Name.Equals("D5SearchForType"))
{
query = savedQueries.Queries[i].Query;
break;
}
}
}
catch (ServiceException e)
{
ed.WriteMessage("GetSavedQueries service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
if (query == null)
{
ed.WriteMessage("There is not an 'D5SearchForType' query.\n");
}
try
{
// Search for all Items, returning a maximum of 25 objects
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[] savedQueryInput = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput[1];
savedQueryInput[0] = new Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryInput();
savedQueryInput[0].Query = query;
//savedQueryInput[0].Entries = new String[] { "Name", "Type" };
savedQueryInput[0].Entries = new String[] { "名称", "类型" };
savedQueryInput[0].Values = new String[2];
savedQueryInput[0].Values[0] = d5MaterialGrades;
savedQueryInput[0].Values[1] = "D5MaterialGrade";
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.ExecuteSavedQueries(savedQueryInput);
Teamcenter.Services.Strong.Query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.ArrayOfResults[0];
ed.WriteMessage("Found Type:" + found.NumOfObjects + "\n");
return found;
}
catch (ServiceException e)
{
ed.WriteMessage("ExecuteSavedQuery service request failed.\n");
ed.WriteMessage(e.Message);
return null;
}
}
public Hashtable getTCPreferences(string prefername)
{
Hashtable prefValues = new Hashtable();
SessionService sessionservice = SessionService.getService(Session.getConnection());
Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames[] prefNames = new Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames[1];
Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames scopedPref = new Teamcenter.Services.Strong.Core._2007_01.Session.ScopedPreferenceNames();
scopedPref.Names = new String[]{ prefername };
scopedPref.Scope = "site";
prefNames[0] = scopedPref;
Teamcenter.Services.Strong.Core._2007_01.Session.MultiPreferencesResponse resp = sessionservice.GetPreferences(prefNames);
Teamcenter.Services.Strong.Core._2007_01.Session.ReturnedPreferences[] preferenceResp = resp.Preferences;
prefValues.Add(preferenceResp[0].Name, preferenceResp[0].Values);
//string temp = preferenceResp[0].Name.ToString();
//string[] value = (string[])prefValues[preferenceResp[0].Name.ToString()];
return prefValues;
}
//分割字符串取出对应类型的Item的ID
public string getCorrespondItemID(string type,string[] tempprevalues)
{
string itemid = "";
Hashtable temptable = new Hashtable();
for (int i = 0; i < tempprevalues.Length; i++)
{
string tempvalueline = tempprevalues[i];
string[] tempvalue = tempvalueline.Split('=');
temptable.Add(tempvalue[0].ToString(), tempvalue[1].ToString());
}
if (temptable.Count <= 0)
itemid = "";
else
{
if (temptable.ContainsKey(type))
{
itemid = (string)temptable[type];
}
}
return itemid;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

@ -0,0 +1,409 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5503038E-4D69-4703-9F79-90C8D9061A70}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HelloTeamcenter</RootNamespace>
<AssemblyName>OriginAutocad</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<StartupObject>
</StartupObject>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Program Files\Autodesk\AutoCAD 2014\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="accoremgd">
<HintPath>2016\accoremgd.dll</HintPath>
</Reference>
<Reference Include="AcCui">
<HintPath>..\..\..\Program Files\Autodesk\AutoCAD 2014\AcCui.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="acdbmgd">
<HintPath>2016\acdbmgd.dll</HintPath>
</Reference>
<Reference Include="acmgd">
<HintPath>2016\acmgd.dll</HintPath>
</Reference>
<Reference Include="Aspose.CAD">
<HintPath>..\..\..\..\..\cad批量打开\Aspose.CAD.20.8(dll_only)\Bin\net4.0\Aspose.CAD.dll</HintPath>
</Reference>
<Reference Include="Autodesk.AutoCAD.Interop">
<HintPath>2016\Autodesk.AutoCAD.Interop.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Autodesk.AutoCAD.Interop.Common">
<HintPath>2016\Autodesk.AutoCAD.Interop.Common.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="FCCNetClientProxy40, Version=11.1.0.0, Culture=neutral, PublicKeyToken=0074cebd077fc3ec, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\FCCNetClientProxy40.dll</HintPath>
</Reference>
<Reference Include="FMSNetTicket40, Version=1.0.0.0, Culture=neutral, PublicKeyToken=13154ac4654a9a4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\FMSNetTicket40.dll</HintPath>
</Reference>
<Reference Include="FSCNetClientProxy40, Version=11.1.0.0, Culture=neutral, PublicKeyToken=0074cebd077fc3ec, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\FSCNetClientProxy40.dll</HintPath>
</Reference>
<Reference Include="Gma.QrCodeNet.Encoding.Net35, Version=0.4.0.0, Culture=neutral, PublicKeyToken=e8a75d24b142be49, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\Gma.QrCodeNet.Encoding.Net35.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\log4net.dll</HintPath>
</Reference>
<Reference Include="MyProgressBar, Version=1.0.0.0, Culture=neutral, PublicKeyToken=57aaa27e22f7b107, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\MyProgressBar.dll</HintPath>
</Reference>
<Reference Include="Oracle.ManagedDataAccess">
<HintPath>bin\Debug\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
<Reference Include="PdfSharp">
<HintPath>bin\Debug\PdfSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="TcMemNetBinding40, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcMemNetBinding40.dll</HintPath>
</Reference>
<Reference Include="TcMemNetBindingInterface40, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcMemNetBindingInterface40.dll</HintPath>
</Reference>
<Reference Include="TcServerNetBinding40, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcServerNetBinding40.dll</HintPath>
</Reference>
<Reference Include="TcServerNetBindingInterface40, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcServerNetBindingInterface40.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadBomAlignmentStrong, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCadBomAlignmentStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadBomAlignmentTypes, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCadBomAlignmentTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadStrong, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCadStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCadTypes, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCadTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaClient, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaClient.dll</HintPath>
</Reference>
<Reference Include="TcSoaCommon, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCommon.dll</HintPath>
</Reference>
<Reference Include="TcSoaCoreStrong, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCoreStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaCoreTypes, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaCoreTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaFMS, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaFMS.dll</HintPath>
</Reference>
<Reference Include="TcSoaQueryStrong, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaQueryStrong.dll</HintPath>
</Reference>
<Reference Include="TcSoaQueryTypes, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaQueryTypes.dll</HintPath>
</Reference>
<Reference Include="TcSoaStrongModel, Version=10000.1.0.0, Culture=neutral, PublicKeyToken=0edd5b5ddd601444, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>bin\Debug\TcSoaStrongModel.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="clientx\AppXCredentialManager.cs" />
<Compile Include="clientx\AppXDeletedObjectListener.cs" />
<Compile Include="clientx\AppXExceptionHandler.cs" />
<Compile Include="clientx\AppXPartialErrorListener.cs" />
<Compile Include="clientx\AppXRequestListener.cs" />
<Compile Include="clientx\AppXUpdateObjectListener.cs" />
<Compile Include="clientx\Session.cs" />
<Compile Include="form\ErrMes2.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\ErrMes2.Designer.cs">
<DependentUpon>ErrMes2.cs</DependentUpon>
</Compile>
<Compile Include="form\ErrMessage.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\ErrMessage.Designer.cs">
<DependentUpon>ErrMessage.cs</DependentUpon>
</Compile>
<Compile Include="form\Login.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\Login.Designer.cs">
<DependentUpon>Login.cs</DependentUpon>
</Compile>
<Compile Include="form\OpenFromTC.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\OpenFromTC.Designer.cs">
<DependentUpon>OpenFromTC.cs</DependentUpon>
</Compile>
<Compile Include="form\SaveToTC.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\SaveToTC.Designer.cs">
<DependentUpon>SaveToTC.cs</DependentUpon>
</Compile>
<Compile Include="form\UploadFile.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="form\UploadFile.Designer.cs">
<DependentUpon>UploadFile.cs</DependentUpon>
</Compile>
<Compile Include="hello\BomCreator.cs" />
<Compile Include="hello\KBomUpdater.cs" />
<Compile Include="hello\KSaveToTC.cs" />
<Compile Include="hello\Search.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="hello\Search.Designer.cs">
<DependentUpon>Search.cs</DependentUpon>
</Compile>
<Compile Include="hello\BomMsgBean.cs" />
<Compile Include="hello\BTLClass.cs" />
<Compile Include="hello\CADCommand.cs" />
<Compile Include="hello\DataManagement.cs" />
<Compile Include="hello\Hello.cs" />
<Compile Include="hello\HomeFolder.cs" />
<Compile Include="hello\ItemMsgBean.cs" />
<Compile Include="hello\KHQAtoDB.cs" />
<Compile Include="hello\KUtil.cs" />
<Compile Include="hello\MXLClass.cs" />
<Compile Include="hello\MyExtension.cs" />
<Compile Include="hello\OriginBTL.cs" />
<Compile Include="hello\OriginDataSet.cs" />
<Compile Include="hello\OriginItemType.cs" />
<Compile Include="hello\OriginMXL.cs" />
<Compile Include="hello\OriginReadXml.cs" />
<Compile Include="hello\OriginTool.cs" />
<Compile Include="hello\OriginTypeRule.cs" />
<Compile Include="hello\PrintDwg.cs" />
<Compile Include="hello\QAData.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="hello\QAData.Designer.cs">
<DependentUpon>QAData.cs</DependentUpon>
</Compile>
<Compile Include="hello\Query.cs" />
<Compile Include="hello\RowInfo.cs" />
<Compile Include="hello\SocketUtil.cs" />
<Compile Include="hello\SqlUtil.cs" />
<Compile Include="hello\Tool.cs" />
<Compile Include="hello\KOriginTool.cs" />
<Compile Include="hello\PrintDwg2.cs" />
<Compile Include="hello\PrintDwgWithMultiPageSize.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="upload\BomBean2.cs" />
<Compile Include="upload\ConnorReadFile.cs" />
<Compile Include="upload\ConnorSaveToTC.cs" />
<Compile Include="upload\ConnorUtils.cs" />
<Compile Include="upload\SqlUtil.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config">
<SubType>Designer</SubType>
</None>
<Compile Include="hello\KOriginReadXml.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="form\ErrMes2.resx">
<DependentUpon>ErrMes2.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\ErrMessage.resx">
<DependentUpon>ErrMessage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\Login.resx">
<DependentUpon>Login.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\OpenFromTC.resx">
<DependentUpon>OpenFromTC.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\SaveToTC.resx">
<DependentUpon>SaveToTC.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="form\UploadFile.resx">
<DependentUpon>UploadFile.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="hello\Search.resx">
<DependentUpon>Search.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="hello\QAData.resx">
<DependentUpon>QAData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Aspose.CAD.dll" />
<Content Include="res\autocad_01.ico" />
<Content Include="res\FOLDER.ICO" />
<Content Include="res\FOLDEROP.ICO" />
<Content Include="res\item.ico" />
<Content Include="res\itemrev.ico" />
<Content Include="res\login.bmp" />
<Content Include="res\mail.ico" />
<Content Include="res\Newstuff_Folder.png" />
<Content Include="res\tai.ico" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<ItemGroup>
<COMReference Include="AXDBLib">
<Guid>{AB513495-C0DC-4E03-AD6E-E851E08428D1}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="GEAuto">
<Guid>{182CD095-1366-4625-BDB5-B8F7C3638157}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="SymBBAuto">
<Guid>{866A324D-A67F-4C93-94CD-136183BCDB45}</Guid>
<VersionMajor>2</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>2052</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory>
</InstallUrlHistory>
<SupportUrlHistory>
</SupportUrlHistory>
<UpdateUrlHistory>
</UpdateUrlHistory>
<BootstrapperUrlHistory>
</BootstrapperUrlHistory>
<ErrorReportUrlHistory>
</ErrorReportUrlHistory>
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartProgram>D:\Autodesk\AutoCAD 2014\acad.exe</StartProgram>
</PropertyGroup>
</Project>

@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloTeamcenter", "HelloTeamcenter.csproj", "{5503038E-4D69-4703-9F79-90C8D9061A70}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5503038E-4D69-4703-9F79-90C8D9061A70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Debug|x64.ActiveCfg = Debug|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Debug|x86.ActiveCfg = Debug|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Release|Any CPU.Build.0 = Release|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Release|x64.ActiveCfg = Release|Any CPU
{5503038E-4D69-4703-9F79-90C8D9061A70}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -0,0 +1,41 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Windows;
using HelloTeamcenter.hello;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HelloTeamcenter")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Siemens Product Lifecycle Management Software Inc.")]
[assembly: AssemblyProduct("HelloTeamcenter")]
[assembly: AssemblyCopyright("Copyright 2008 Siemens Product Lifecycle Management Software Inc.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6ce4adbe-4247-464b-8d53-e3ecb88955fd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,143 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace HelloTeamcenter.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HelloTeamcenter.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap autocad_01 {
get {
object obj = ResourceManager.GetObject("autocad_01", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap FOLDER {
get {
object obj = ResourceManager.GetObject("FOLDER", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap FOLDEROP {
get {
object obj = ResourceManager.GetObject("FOLDEROP", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap item {
get {
object obj = ResourceManager.GetObject("item", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap itemrev {
get {
object obj = ResourceManager.GetObject("itemrev", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap login {
get {
object obj = ResourceManager.GetObject("login", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Newstuff_Folder {
get {
object obj = ResourceManager.GetObject("Newstuff_Folder", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap tai {
get {
object obj = ResourceManager.GetObject("tai", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="autocad_01" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\autocad_01.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FOLDER" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\FOLDER.ICO;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FOLDEROP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\FOLDEROP.ICO;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="item" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\item.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="itemrev" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\itemrev.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="login" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\login.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Newstuff_Folder" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\Newstuff_Folder.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="tai" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\res\tai.ico;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

@ -0,0 +1,61 @@
This sample demonstrates the basic functionality of the Teamcenter Services.
Before running the sample application, you must have a Teamcenter Web Tier server
and Pool Manager up and running.
To build this project from Visual Studio 2005(8.0).
1. Load the project
Open the Open dialog ( File --> Open --> Project... )
Browse to .../soa_clients/net/samples/HelloTeamcenter/HelloTeamcenter.csproj
3. Compile the project
4. Execute the client application
To connect to a server other than http://localhost:7001/tc, change this URI
on Project Properties dialog ( Project --> Properties). On the Debug tab
modify the In the 'Command line arguments' field add '-host http://server:port/tc'.
The source file Hello.cxx has the main function for the application. This is the
best place to start browsing the code. There are serveral classes prefixed with
the name AppX (AppXCredentialManager), these classes are implemenations of
Teamcenter Services framework interfaces. Each client application is responsible
for providing an implemenation to these interfaces:
CredentialManager Used by the framework to re-authenticate as user.
ExceptionHandler Provide a mechanism for the client application to
handle low level exception in the communication framework.
PartialErrorListener Optional listener for notification when a service operation
has returned partial errors.
ChangeListener Optional listener for notification when a service operation
has returned ModelObject with updated property values.
DeleteListener Optional listener for notification when a service operation
has returned ModelObject that have been deleted from
the database and from the client data model.
The remaining classes in this sample show the use of a few of the service operations
to demonstrate some basic features of Teamcenter Services.
Session This class shows how to establish a session with the
Teamcenter Server using the SessionService login and
logout methods. A session must be established before
any other service operation are called.
HomeFolder This class lists the contents of the user's home folder
Query This class performs a simple query.
DataManagement This class creates, revises, and deletes a set of Items
Each of these examples performs the same basic steps
1. Construct the desired service stub.
2. Gather the data for the opeation's input arguments,
3. Call the service operation
4. Process the results.
A few of the service operations will make use of the Change and Delete listeners.
Under normal circomstances the ExeptionHandler and PartialErrorListner will not
be called.

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="HelloTeamcenter">
</Property><Property Name="解决方案文件" Value="D:\soa_client\net\samples\HelloTeamcenter\HelloTeamcenter.sln">
</Property><Property Name="Date" Value="2011年8月29日星期一">
</Property><Property Name="Time" Value="19:15:39">
</Property></Properties><Event ErrorLevel="0" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="项目文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\HelloTeamcenter.csproj">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXCredentialManager.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\AppXCredentialManager.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXDeletedObjectListener.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\AppXDeletedObjectListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXExceptionHandler.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\AppXExceptionHandler.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXPartialErrorListener.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\AppXPartialErrorListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXRequestListener.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\AppXRequestListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXUpdateObjectListener.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\AppXUpdateObjectListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\Session.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\clientx\Session.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\DataManagement.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\hello\DataManagement.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\Hello.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\hello\Hello.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\HomeFolder.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\hello\HomeFolder.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\Query.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\hello\Query.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="Properties\AssemblyInfo.cs" Description="文件已成功备份为 D:\soa_client\net\samples\HelloTeamcenter\Backup\Properties\AssemblyInfo.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="项目已成功转换">
</Event><Event ErrorLevel="3" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="扫描完成: 项目文件不需要升级。">
</Event></UpgradeLog>

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="HelloTeamcenter">
</Property><Property Name="解决方案文件" Value="F:\Connor项目管理\东睦项目\OriginAutoCAD\HelloTeamcenter.sln">
</Property><Property Name="用户选项文件" Value="F:\Connor项目管理\东睦项目\OriginAutoCAD\HelloTeamcenter.suo">
</Property><Property Name="Date" Value="2015年10月23日">
</Property><Property Name="Time" Value="13:58">
</Property><Property Name="日志号" Value="2">
</Property></Properties><Event ErrorLevel="0" Project="" Source="HelloTeamcenter.sln" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\HelloTeamcenter.sln">
</Event><Event ErrorLevel="0" Project="" Source="HelloTeamcenter.suo" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\HelloTeamcenter.suo">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="项目文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\HelloTeamcenter.csproj">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj.user" Description="项目用户文件成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\HelloTeamcenter.csproj.user">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXCredentialManager.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\AppXCredentialManager.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXDeletedObjectListener.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\AppXDeletedObjectListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXExceptionHandler.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\AppXExceptionHandler.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXPartialErrorListener.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\AppXPartialErrorListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXRequestListener.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\AppXRequestListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\AppXUpdateObjectListener.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\AppXUpdateObjectListener.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="clientx\Session.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\clientx\Session.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\Login.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\Login.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\Login.Designer.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\Login.Designer.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\OpenFromTC.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\OpenFromTC.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\OpenFromTC.Designer.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\OpenFromTC.Designer.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\SaveToTC.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\SaveToTC.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\SaveToTC.Designer.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\SaveToTC.Designer.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\Search.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\Search.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\Search.Designer.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\Search.Designer.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\BTLClass.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\BTLClass.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\DataManagement.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\DataManagement.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\Hello.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\Hello.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\HomeFolder.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\HomeFolder.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\MXLClass.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\MXLClass.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\MyExtension.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\MyExtension.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginBTL.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginBTL.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginDataSet.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginDataSet.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginItemType.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginItemType.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginMXL.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginMXL.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginReadXml.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginReadXml.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginTool.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginTool.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\OriginTypeRule.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\OriginTypeRule.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\Query.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\Query.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="hello\Tool.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\hello\Tool.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="Properties\AssemblyInfo.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\Properties\AssemblyInfo.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="Properties\Resources.Designer.cs" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\Properties\Resources.Designer.cs">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="app.config" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\app.config">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\autocad_01.ico" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\autocad_01.ico">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\FOLDER.ICO" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\FOLDER.ICO">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\FOLDEROP.ICO" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\FOLDEROP.ICO">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\item.ico" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\item.ico">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\itemrev.ico" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\itemrev.ico">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\login.bmp" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\login.bmp">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\mail.ico" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\mail.ico">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\Newstuff_Folder.png" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\Newstuff_Folder.png">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="res\tai.ico" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\res\tai.ico">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\Login.resx" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\Login.resx">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\OpenFromTC.resx" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\OpenFromTC.resx">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\SaveToTC.resx" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\SaveToTC.resx">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="form\Search.resx" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\form\Search.resx">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="Properties\Resources.resx" Description="文件已成功备份为 F:\Connor项目管理\东睦项目\OriginAutoCAD\Backup1\Properties\Resources.resx">
</Event><Event ErrorLevel="1" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="您的项目以 .NET Framework 2.0 或 3.0 为目标。如果您的项目使用的程序集需要更新的 .NET Framework则项目生成将失败。通过单击项目菜单上的“属性”然后在“.NET Framework”下拉框中选择一个新版本可以更改 .NET Framework 的版本。(在 Visual Basic 中,可在单击“高级编辑器选项...”按钮时显示的“编译”选项卡上找到此下拉框。)">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="项目已成功转换">
</Event><Event ErrorLevel="3" Project="HelloTeamcenter" Source="HelloTeamcenter.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="HelloTeamcenter.sln" Description="成功转换解决方案">
</Event><Event ErrorLevel="3" Project="" Source="HelloTeamcenter.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="HelloTeamcenter" Source="app.config" Description="文件已成功转换。所有的 &lt;supportedRuntime&gt; 和 &lt;requiredRuntime&gt; 标记都已移除,以使项目能够用 Visual Studio 2005 生成并运行。">
</Event><Event ErrorLevel="3" Project="HelloTeamcenter" Source="app.config" Description="Converted">
</Event></UpgradeLog>

@ -0,0 +1,207 @@
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}

@ -0,0 +1,232 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:key name="ProjectKey" match="Event" use="@Project"/>
<xsl:template match="Events" mode="createProjects">
<projects>
<xsl:for-each select="Event">
<!--xsl:sort select="@Project" order="descending"/-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Project != @Project)">
<xsl:variable name="ProjectName" select="@Project"/>
<project>
<xsl:attribute name="name">
<xsl:value-of select="@Project"/>
</xsl:attribute>
<xsl:if test="@Project=''">
<xsl:attribute name="solution">
<xsl:value-of select="@Solution"/>
</xsl:attribute>
</xsl:if>
<xsl:for-each select="key('ProjectKey', $ProjectName)">
<!--xsl:sort select="@Source" /-->
<xsl:if test="(1=position()) or (preceding-sibling::*[1]/@Source != @Source)">
<source>
<xsl:attribute name="name">
<xsl:value-of select="@Source"/>
</xsl:attribute>
<xsl:variable name="Source">
<xsl:value-of select="@Source"/>
</xsl:variable>
<xsl:for-each select="key('ProjectKey', $ProjectName)[ @Source = $Source ]">
<event>
<xsl:attribute name="error-level">
<xsl:value-of select="@ErrorLevel"/>
</xsl:attribute>
<xsl:attribute name="description">
<xsl:value-of select="@Description"/>
</xsl:attribute>
</event>
</xsl:for-each>
</source>
</xsl:if>
</xsl:for-each>
</project>
</xsl:if>
</xsl:for-each>
</projects>
</xsl:template>
<xsl:template match="projects">
<xsl:for-each select="project">
<xsl:sort select="@Name" order="ascending"/>
<h2>
<xsl:if test="@solution"><a _locID="Solution">解决方案</a>: <xsl:value-of select="@solution"/></xsl:if>
<xsl:if test="not(@solution)"><a _locID="Project">项目</a>: <xsl:value-of select="@name"/>
<xsl:for-each select="source">
<xsl:variable name="Hyperlink" select="@name"/>
<xsl:for-each select="event[@error-level='4']">
<A class="note"><xsl:attribute name="HREF"><xsl:value-of select="$Hyperlink"/></xsl:attribute><xsl:value-of select="@description"/></A>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</h2>
<table cellpadding="2" cellspacing="0" width="98%" border="1" bordercolor="white" class="infotable">
<tr>
<td nowrap="1" class="header" _locID="Filename">文件名</td>
<td nowrap="1" class="header" _locID="Status">状态</td>
<td nowrap="1" class="header" _locID="Errors">错误</td>
<td nowrap="1" class="header" _locID="Warnings">警告</td>
</tr>
<xsl:for-each select="source">
<xsl:sort select="@name" order="ascending"/>
<xsl:variable name="source-id" select="generate-id(.)"/>
<xsl:if test="count(event)!=count(event[@error-level='4'])">
<tr class="row">
<td class="content">
<A HREF="javascript:"><xsl:attribute name="onClick">javascript:document.images['<xsl:value-of select="$source-id"/>'].click()</xsl:attribute><IMG border="0" _locID="IMG.alt" _locAttrData="alt" alt="展开/折叠节" class="expandable" height="11" onclick="changepic()" src="_UpgradeReport_Files/UpgradeReport_Plus.gif" width="9"><xsl:attribute name="name"><xsl:value-of select="$source-id"/></xsl:attribute><xsl:attribute name="child">src<xsl:value-of select="$source-id"/></xsl:attribute></IMG></A> <xsl:value-of select="@name"/>
</td>
<td class="content">
<xsl:if test="count(event[@error-level='3'])=1">
<xsl:for-each select="event[@error-level='3']">
<xsl:if test="@description='Converted'"><a _locID="Converted1">已转换</a></xsl:if>
<xsl:if test="@description!='Converted'"><xsl:value-of select="@description"/></xsl:if>
</xsl:for-each>
</xsl:if>
<xsl:if test="count(event[@error-level='3'])!=1 and count(event[@error-level='3' and @description='Converted'])!=0"><a _locID="Converted2">已转换</a>
</xsl:if>
</td>
<td class="content"><xsl:value-of select="count(event[@error-level='2'])"/></td>
<td class="content"><xsl:value-of select="count(event[@error-level='1'])"/></td>
</tr>
<tr class="collapsed" bgcolor="#ffffff">
<xsl:attribute name="id">src<xsl:value-of select="$source-id"/></xsl:attribute>
<td colspan="7">
<table width="97%" border="1" bordercolor="#dcdcdc" rules="cols" class="issuetable">
<tr>
<td colspan="7" class="issuetitle" _locID="ConversionIssues">转换报告 - <xsl:value-of select="@name"/>:</td>
</tr>
<xsl:for-each select="event[@error-level!='3']">
<xsl:if test="@error-level!='4'">
<tr>
<td class="issuenone" style="border-bottom:solid 1 lightgray">
<xsl:value-of select="@description"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr valign="top">
<td class="foot">
<xsl:if test="count(source)!=1">
<xsl:value-of select="count(source)"/><a _locID="file1"> 个文件</a>
</xsl:if>
<xsl:if test="count(source)=1">
<a _locID="file2">1 个文件</a>
</xsl:if>
</td>
<td class="foot">
<a _locID="Converted3">已转换</a>: <xsl:value-of select="count(source/event[@error-level='3' and @description='Converted'])"/><BR/>
<a _locID="NotConverted">未转换</a>: <xsl:value-of select="count(source) - count(source/event[@error-level='3' and @description='Converted'])"/>
</td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='2'])"/></td>
<td class="foot"><xsl:value-of select="count(source/event[@error-level='1'])"/></td>
</tr>
</table>
</xsl:for-each>
</xsl:template>
<xsl:template match="Property">
<xsl:if test="@Name!='Date' and @Name!='Time' and @Name!='LogNumber' and @Name!='Solution'">
<tr><td nowrap="1"><b><xsl:value-of select="@Name"/>: </b><xsl:value-of select="@Value"/></td></tr>
</xsl:if>
</xsl:template>
<xsl:template match="UpgradeLog">
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" href="_UpgradeReport_Files\UpgradeReport.css"/>
<title _locID="ConversionReport0">转换报告
<xsl:if test="Properties/Property[@Name='LogNumber']">
<xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/>
</xsl:if>
</title>
<script language="javascript">
function outliner () {
oMe = window.event.srcElement
//get child element
var child = document.all[event.srcElement.getAttribute("child",false)];
//if child element exists, expand or collapse it.
if (null != child)
child.className = child.className == "collapsed" ? "expanded" : "collapsed";
}
function changepic() {
uMe = window.event.srcElement;
var check = uMe.src.toLowerCase();
if (check.lastIndexOf("upgradereport_plus.gif") != -1)
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Minus.gif"
}
else
{
uMe.src = "_UpgradeReport_Files/UpgradeReport_Plus.gif"
}
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" onclick="outliner();">
<h1 _locID="ConversionReport">转换报告 - <xsl:value-of select="Properties/Property[@Name='Solution']/@Value"/></h1>
<p><span class="note">
<b _locID="TimeOfConversion">转换时间:</b> <xsl:value-of select="Properties/Property[@Name='Date']/@Value"/> <xsl:value-of select="Properties/Property[@Name='Time']/@Value"/><br/>
</span></p>
<xsl:variable name="SortedEvents">
<Events>
<xsl:for-each select="Event">
<xsl:sort select="@Project" order="ascending"/>
<xsl:sort select="@Source" order="ascending"/>
<xsl:sort select="@ErrorLevel" order="ascending"/>
<Event>
<xsl:attribute name="Project"><xsl:value-of select="@Project"/> </xsl:attribute>
<xsl:attribute name="Solution"><xsl:value-of select="/UpgradeLog/Properties/Property[@Name='Solution']/@Value"/> </xsl:attribute>
<xsl:attribute name="Source"><xsl:value-of select="@Source"/> </xsl:attribute>
<xsl:attribute name="ErrorLevel"><xsl:value-of select="@ErrorLevel"/> </xsl:attribute>
<xsl:attribute name="Description"><xsl:value-of select="@Description"/> </xsl:attribute>
</Event>
</xsl:for-each>
</Events>
</xsl:variable>
<xsl:variable name="Projects">
<xsl:apply-templates select="msxsl:node-set($SortedEvents)/*" mode="createProjects"/>
</xsl:variable>
<xsl:apply-templates select="msxsl:node-set($Projects)/*"/>
<p></p><p>
<table class="note">
<tr>
<td nowrap="1">
<b _locID="ConversionSettings">转换设置</b>
</td>
</tr>
<xsl:apply-templates select="Properties"/>
</table></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

@ -0,0 +1,64 @@
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
<appSettings>
<add key="CHINT-TITLE-A0-CN-X" value="2239.0336"/>
<add key="CHINT-TITLE-A0-CN-Y" value="-313.5048"/>
<add key="CHINT-TITLE-A0-EN-X" value="766.3449"/>
<add key="CHINT-TITLE-A0-EN-Y" value="-1092.2177"/>
<add key="GC-CHINT-TITLE-A0-CN-X" value="2268.4361"/>
<add key="GC-CHINT-TITLE-A0-CN-Y" value="-380.0687"/>
<add key="GC-CHINT-TITLE-A0-EN-X" value="2122.6918"/>
<add key="GC-CHINT-TITLE-A0-EN-Y" value="-311.0528"/>
<add key="CHINT-TITLE-A1-CN-X" value="2016.6554"/>
<add key="CHINT-TITLE-A1-CN-Y" value="-356.938"/>
<add key="CHINT-TITLE-A1-EN-X" value="3874.9229"/>
<add key="CHINT-TITLE-A1-EN-Y" value="-442.1908"/>
<add key="GC-CHINT-TITLE-A1-CN-X" value="2001.4803"/>
<add key="GC-CHINT-TITLE-A1-CN-Y" value="-318.9944"/>
<add key="GC-CHINT-TITLE-A1-EN-X" value="3874.9229"/>
<add key="GC-CHINT-TITLE-A1-EN-Y" value="-432.1908"/>
<add key="CHINT-TITLE-A2-CN-X" value="286.1828"/>
<add key="CHINT-TITLE-A2-CN-Y" value="-853.9018"/>
<add key="CHINT-TITLE-A2-EN-X" value="1815.9079"/>
<add key="CHINT-TITLE-A2-EN-Y" value="-291.1625"/>
<add key="GC-CHINT-TITLE-A2-CN-X" value="333.6702"/>
<add key="GC-CHINT-TITLE-A2-CN-Y" value="-814.4684"/>
<add key="GC-CHINT-TITLE-A2-EN-X" value="1815.9079"/>
<add key="GC-CHINT-TITLE-A2-EN-Y" value="-281.1625"/>
<add key="CHINT-TITLE-A3-CN-X" value="283.1309"/>
<add key="CHINT-TITLE-A3-CN-Y" value="-284.1189"/>
<add key="CHINT-TITLE-A3-EN-X" value="283.1309"/>
<add key="CHINT-TITLE-A3-EN-Y" value="-284.1189"/>
<add key="GC-CHINT-TITLE-A3-CN-X" value="-225.9579"/>
<add key="GC-CHINT-TITLE-A3-CN-Y" value="-274.1189"/>
<add key="GC-CHINT-TITLE-A3-EN-X" value="283.1309"/>
<add key="GC-CHINT-TITLE-A3-EN-Y" value="-274.1189"/>
<add key="CHINT-TITLE-A4-CN-X" value="14.0998"/>
<add key="CHINT-TITLE-A4-CN-Y" value="-240.4484"/>
<add key="CHINT-TITLE-A4-EN-X" value="-95.1342"/>
<add key="CHINT-TITLE-A4-EN-Y" value="-235.1224"/>
<add key="GC-CHINT-TITLE-A4-CN-X" value="261.4192"/>
<add key="GC-CHINT-TITLE-A4-CN-Y" value="-226.4351"/>
<add key="GC-CHINT-TITLE-A4-EN-X" value="-95.1342"/>
<add key="GC-CHINT-TITLE-A4-EN-Y" value="-225.1224"/>
<add key="ClientSettingsProvider.ServiceUri" value=""/>
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
</providers>
</roleManager>
</system.web>
</configuration>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save