UGS NX is a tool to create and simulate CAD designs.
NX™ programming and customization software tools help companies extend
and tailor NX solution capabilities to their specific needs. Supporting the
knowledge-driven automation capabilities of NX, these tools can be
employed by product development personnel and application developers.
The NX Common Application Programming Interface (API)
NX software provides an automation architecture that serves as the
foundation for all NX APIs as well as for a new journaling utility. Called the
Common API, it combines the power of journaling and automation with the
freedom of a language-neutral platform. Integrated within the core NX
architecture, the Common API is the foundation for all NX solutions and is
fully compatible with the existing Open C API.
NX Open Common Application Programming Interface (API)
The new Common API offers the following features:
• Language support – Provides a native .NET API that supports all .NET languages including Visual Basic .NET and C#. The Java and Open C++ APIs support the full range of Common API capabilities.
• Support for standard integrated development environments (IDEs) – Visual Studio .NET development environment is the industry standard IDE for developing .NET programs. It provides state-of-the-art browsing, editing, debugging, graphical layout of dialogs (WinForms and WebForms) and a unified IDE for web, desktop and mobile development needs. Visual Studio .NET is the recommended IDE for developing NX Open .NET programs. Similarly, Java integrated development environments – Eclipse, etbeans, etc. offer development of platform-independent Java automation programs which may use the JFC/Swing API for interactive user interface. Custom programs using
NX Open for Java API can utilize any of the industry standard Java IDEs forapplication development.
While using NX API, the functionality includes:-
1. First of all, a WPF application is linked to NX. On click of NXOpen button will open NX with the specified plmxml file.
2. Once the NX model is open, to get latest updated expressions, it again goes to .NET code, catches the expressions and update in the model.
Thursday, 11 November 2010
Reading a dll into IL file

I went through many blogs and forums when I was required to read a dll and understand if particular string value exists in the dll or not.
I wanted to read dll not for the business logic but for the string value present in dll or not.
Though Ildasm.exe tool is a great help but it tells about the properties and methods in the dll, not about the string value. When you double click on the content in ildasm window then it shows IL (intermediate language).
So now I want to create and read the IL file from this particular DLL.
Code as given below: -
string mSILlocation = "D:\\InterfacingService.il";
string command1 = dllLocation.Insert(dllLocation.Length, mSILlocation).Insert(dllLocation.Length, " /output:");
//string Command = "[DLL Location] /output:[location of new IL file created](file.il)";
int ExitCode;
ProcessStartInfo ProcessInfo;
System.Diagnostics.Process Process;
ProcessInfo = new ProcessStartInfo("C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\bin\\ildasm.exe", command1);
ProcessInfo.CreateNoWindow = true;
ProcessInfo.UseShellExecute = false;
Process = Process.Start(ProcessInfo);
Process.WaitForExit(Timeout);
ExitCode = Process.ExitCode;
Process.Close();
Tuesday, 5 October 2010
Click Once deployment
Deployment Technologies
________________________________________
Windows and the .NET Framework include several deployment technologies, including:
• XCopy deployment.
• Windows Installer deployment.
• ClickOnce deployment.
XCopy Deployment
XCopy deployment refers to the use of the XCopy command-line program to copy files from one location to another. XCopy deployment is suitable under the following circumstances:
• The application is self-contained. It does not need to update the client to run.
• Application files must be moved from one location to another, such as from a build location (local disk, UNC file share, and so on) to a publish location (Web site, UNC file share, and so on).
• The application does not require shell integration (Start menu shortcut, desktop icon, and so on).
Although XCopy is suitable for simple deployment scenarios, it is limited when more complex deployment capabilities are required. In particular, using XCopy often incurs the overhead for creating, executing, and maintaining scripts for managing deployment in a robust way. Furthermore, XCopy does not support versioning, uninstallation, or rollback.
Windows Installer
Windows Installer allows applications to be packaged as self-contained executables that can be easily distributed to clients and run. Furthermore, Windows Installer is installed with Windows and enables integration with the desktop, the Start menu, and the Programs control panel.
Windows Installer simplifies the installation and uninstallation of applications, but it does not provide facilities for ensuring that installed applications are kept up-to-date from a versioning standpoint.
ClickOnce Deployment
ClickOnce enables Web-style application deployment for non-Web applications. Applications are published to and deployed from Web or file servers. Although ClickOnce does not support the full range of client features that Windows Installer-installed applications do, it does support a subset that includes the following:
• Integration with the Start menu and Programs control panel.
• Versioning, rollback, and uninstallation.
• Online install mode, which always launches an application from the deployment location.
• Automatic updating when new versions are released.
• Registration of file extensions.
Deploying WPF Applications
________________________________________
The deployment options for a WPF application depend on the type of application. From a deployment perspective, WPF has three significant application types:
• Standalone applications.
• Markup-only XAML applications.
• XAML browser applications (XBAPs).
Deploying Standalone Applications
Standalone applications are deployed using either ClickOnce or Windows Installer. Either way, standalone applications require full trust to run. Full trust is automatically granted to standalone applications that are deployed using Windows Installer. Standalone applications that are deployed using ClickOnce are not automatically granted full trust. Instead, ClickOnce displays a security warning dialog that users must accept before a standalone application is installed. If accepted, the standalone application is installed and granted full trust. If not, the standalone application is not installed.
Deploying Markup-Only XAML Applications
Markup-only XAML pages are usually published to Web servers, like HTML pages, and can be viewed using Internet Explorer. Markup-only XAML pages run within a partial-trust security sandbox with restrictions that are defined by the Internet zone permission set. This provides an equivalent security sandbox to HTML-based Web applications.
Markup-only XAML pages can be installed to the local file system by using either XCopy or Windows Installer. These pages can be viewed using Internet Explorer or Windows Explorer.
Deploying XAML Browser Applications
XBAPs are compiled applications that require the following three files to be deployed:
• ApplicationName.exe: The executable assembly application file.
• ApplicationName.xbap: The deployment manifest.
• ApplicationName.exe.manifest: The application manifest.
Courtesy: MSDN
Click Once Deployment:
There are three strategic approach to deploy application using Click once.
1. Install from Web or network share.
2. From CD or drive
3. Start application from web or network share.
The project iTracs is a standalone application. It can be installed from network. And then it requires services and centralized database from network to work on the application.
There are few tools available for click once deployment.
http://www.clickoncemore.net/home.php
________________________________________
Windows and the .NET Framework include several deployment technologies, including:
• XCopy deployment.
• Windows Installer deployment.
• ClickOnce deployment.
XCopy Deployment
XCopy deployment refers to the use of the XCopy command-line program to copy files from one location to another. XCopy deployment is suitable under the following circumstances:
• The application is self-contained. It does not need to update the client to run.
• Application files must be moved from one location to another, such as from a build location (local disk, UNC file share, and so on) to a publish location (Web site, UNC file share, and so on).
• The application does not require shell integration (Start menu shortcut, desktop icon, and so on).
Although XCopy is suitable for simple deployment scenarios, it is limited when more complex deployment capabilities are required. In particular, using XCopy often incurs the overhead for creating, executing, and maintaining scripts for managing deployment in a robust way. Furthermore, XCopy does not support versioning, uninstallation, or rollback.
Windows Installer
Windows Installer allows applications to be packaged as self-contained executables that can be easily distributed to clients and run. Furthermore, Windows Installer is installed with Windows and enables integration with the desktop, the Start menu, and the Programs control panel.
Windows Installer simplifies the installation and uninstallation of applications, but it does not provide facilities for ensuring that installed applications are kept up-to-date from a versioning standpoint.
ClickOnce Deployment
ClickOnce enables Web-style application deployment for non-Web applications. Applications are published to and deployed from Web or file servers. Although ClickOnce does not support the full range of client features that Windows Installer-installed applications do, it does support a subset that includes the following:
• Integration with the Start menu and Programs control panel.
• Versioning, rollback, and uninstallation.
• Online install mode, which always launches an application from the deployment location.
• Automatic updating when new versions are released.
• Registration of file extensions.
Deploying WPF Applications
________________________________________
The deployment options for a WPF application depend on the type of application. From a deployment perspective, WPF has three significant application types:
• Standalone applications.
• Markup-only XAML applications.
• XAML browser applications (XBAPs).
Deploying Standalone Applications
Standalone applications are deployed using either ClickOnce or Windows Installer. Either way, standalone applications require full trust to run. Full trust is automatically granted to standalone applications that are deployed using Windows Installer. Standalone applications that are deployed using ClickOnce are not automatically granted full trust. Instead, ClickOnce displays a security warning dialog that users must accept before a standalone application is installed. If accepted, the standalone application is installed and granted full trust. If not, the standalone application is not installed.
Deploying Markup-Only XAML Applications
Markup-only XAML pages are usually published to Web servers, like HTML pages, and can be viewed using Internet Explorer. Markup-only XAML pages run within a partial-trust security sandbox with restrictions that are defined by the Internet zone permission set. This provides an equivalent security sandbox to HTML-based Web applications.
Markup-only XAML pages can be installed to the local file system by using either XCopy or Windows Installer. These pages can be viewed using Internet Explorer or Windows Explorer.
Deploying XAML Browser Applications
XBAPs are compiled applications that require the following three files to be deployed:
• ApplicationName.exe: The executable assembly application file.
• ApplicationName.xbap: The deployment manifest.
• ApplicationName.exe.manifest: The application manifest.
Courtesy: MSDN
Click Once Deployment:
There are three strategic approach to deploy application using Click once.
1. Install from Web or network share.
2. From CD or drive
3. Start application from web or network share.
The project iTracs is a standalone application. It can be installed from network. And then it requires services and centralized database from network to work on the application.
There are few tools available for click once deployment.
http://www.clickoncemore.net/home.php
Observable Collection
ObservableCollection is very important feature of data binding in WPF.
It is like a regular collection other than it can raise two more events. Which are INotifyCollectionChanged and INotifyPropertyChanged events. As the name suggests when collection is changed (item is added or removed) then INotifyCollectionChanged event will be raised.
If a property is changed in collection or count of collection is changed then INotifyCollectionChanged event is raised.
For more details you can try here:
http://www.e-pedro.com/2009/04/an-introduction-to-observablecollection-in-wpf/
INotifyPropertyChanged interface is implemented with method OnPropertyChanged().
This method will notify to UI (xaml) that this property is changed.
It is like a regular collection other than it can raise two more events. Which are INotifyCollectionChanged and INotifyPropertyChanged events. As the name suggests when collection is changed (item is added or removed) then INotifyCollectionChanged event will be raised.
If a property is changed in collection or count of collection is changed then INotifyCollectionChanged event is raised.
http://www.e-pedro.com/2009/04/an-introduction-to-observablecollection-in-wpf/
INotifyPropertyChanged interface is implemented with method OnPropertyChanged().
This method will notify to UI (xaml) that this property is changed.
Saturday, 2 October 2010
Dependency Property in WPF.
public static readonly DependencyProperty MaskProperty =
DependencyProperty.Register("Mask", typeof(string), typeof(PTextBox), new PropertyMetadata(null));
public string Mask
{
get { return (string)GetValue(MaskProperty); }
set { SetValue(MaskProperty, value); }
}
First section explains about Dependency property. It is a static property. In old ways, Void was used to override the property, but without overriding we can reuse the same property.
“
In the "old ways", to set up some sort of change notification on the Height property here, you would have had to override it in a new class deriving from this FrameworkElement class and added whatever you needed in the 'set' part of the property here. However, you no longer have to do things like that. Instead, you can use Dependency properties.”
Eg: Mask is the property present in PTextBox class with type string. So first MaskProperty is created as DependencyProperty.
Then Mask property wrapper is created using GetValue() and SetValue() methods.
::http://www.switchonthecode.com/tutorials/wpf-tutorial-introduction-to-dependency-properties
DependencyProperty.Register("Mask", typeof(string), typeof(PTextBox), new PropertyMetadata(null));
public string Mask
{
get { return (string)GetValue(MaskProperty); }
set { SetValue(MaskProperty, value); }
}
First section explains about Dependency property. It is a static property. In old ways, Void was used to override the property, but without overriding we can reuse the same property.
“
In the "old ways", to set up some sort of change notification on the Height property here, you would have had to override it in a new class deriving from this FrameworkElement class and added whatever you needed in the 'set' part of the property here. However, you no longer have to do things like that. Instead, you can use Dependency properties.”
Eg: Mask is the property present in PTextBox class with type string. So first MaskProperty is created as DependencyProperty.
Then Mask property wrapper is created using GetValue() and SetValue() methods.
::http://www.switchonthecode.com/tutorials/wpf-tutorial-introduction-to-dependency-properties
Monday, 20 September 2010
Saturday, 18 September 2010
Data Template and Item Template
Data Template is used when different data is presented in the form of same data format.
This is defined under Resources of XAML page. While Declaring Data Template, make a complete set of required UI controls. like:
DataTemplate DataType="" Key=""
Control1
Control2
Control3
DataTemplate
While using the DataTemplate, assign created DataTemplate in ItemTemplate and define ItemsSource also. ItemSource may have collection of type specified in DataTemplate.
DataTrigger::
In XAML file -
DataTemplate.Trigger
..................................
Custom controls in WPF
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Tag="Rating">
MouseEnter="OnMouseEnter" />
MouseEnter="OnMouseEnter" />
MouseEnter="OnMouseEnter" />
MouseEnter="OnMouseEnter" />
MouseEnter="OnMouseEnter" />
Concept of Custom Control: First create a Style with any name/key and specify a TargetType(UI Control) also. When this style is required just specify while declaring UI Control. EventHandlers can also be attached and defined in code behind page.
Wednesday, 15 September 2010
WPF custom controls
to read about WPF custom controls:
http://www.codeguru.com/cpp/data/data-misc/xml/article.php/c12521__1/Creating-Custom-WPF-Controls.htm
http://www.codeguru.com/cpp/data/data-misc/xml/article.php/c12521__1/Creating-Custom-WPF-Controls.htm
Subscribe to:
Posts (Atom)