348 lines
48 KiB
HTML
348 lines
48 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<title>Add Custom File Reference Example (C#)</title>
|
|
<meta http-equiv="Content-Language" content="en-us">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
|
<link rel="stylesheet" type="text/css" href="ApiHelp.css">
|
|
</head>
|
|
<meta name=MS-HKWD content="C# examples,custom file references">
|
|
|
|
<body>
|
|
<h1><span style="font-weight: normal; font-size: 7.5pt;">SOLIDWORKS PDM Professional API Help</span></h1>
|
|
<h1>Add Custom File Reference Example (C#)</h1>
|
|
<p><a name="top"></a>This example shows how to add a custom file reference to a
|
|
file in the vault.</p>
|
|
<p><b>NOTE</b>: If using the primary interop assembly
|
|
provided with SOLIDWORKS PDM Professional, see
|
|
<a href="Using_NET_Framework_in_Applications.htm">Using .NET Framework 4.0 in
|
|
Stand-alone Applications</a>.</p>
|
|
<p><img border="0" src="AddCustomRefs.gif" width="333" height="346"></p>
|
|
|
|
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE">
|
|
<span style="color:green;">
|
|
//----------------------------------------------------------------------------</span><br>
|
|
<span style="color:green;">// Preconditions:</span><br>
|
|
<span style="color:green;">// 1. Start Microsoft Visual Studio.</span><br>
|
|
<span style="color:green;">// a. Click <b>File > New > Project > Visual
|
|
C# > Windows Forms Application</b>.</span><br>
|
|
<span style="color:green;">// b. Type <b>CustRefCSharp</b> in <b>Name</b>.</span><br>
|
|
<span style="color:green;">// c. Click <b>Browse</b> and navigate to the folder where to create </span><br>
|
|
<span style="color:green;">// the project.</span><br>
|
|
<span style="color:green;">// d. Click <b>OK</b>. </span><br>
|
|
<span style="color:green;">// e. Click <b>Show All Files</b> in the Solution Explorer toolbar and expand </span><br>
|
|
<span style="color:green;">// <b>Form1.cs</b> in the Solution Explorer.</span><br>
|
|
<span style="color:green;">
|
|
// f. Create a form similar to the form shown above and change:</span><br>
|
|
<span style="color:green;">// 1. Top label to <b>VaultsLabel</b>.</span><br>
|
|
<span style="color:green;">// 2. Combo box to <b>VaultsComboBox</b>.</span><br>
|
|
<span style="color:green;">// 3. Browse button to <b>BrowseButton</b>.<br>
|
|
// 4. List box to <b>CustRefListBox</b>.</span><br>
|
|
<span style="color:green;">// 5. <b>Add custom file reference</b> button to <b>AddCustomFileReference</b>.</span><br>
|
|
<span style="color:green;">// g. Replace the code in <b>Form1.cs</b> with <a href="#Form1.cs">this code</a>.</span><br>
|
|
<span style="color:green;">// h. Replace the code in <b>Form1.Designer.cs</b> with <a href="#Form1.Designer.cs">this code</a>.</span><br>
|
|
<span style="color:green;">// 2. Add <b>EPDM.Interop.epdm.dll</b> as a reference (right-click the project</span><br>
|
|
<span style="color:green;">// name in the Solution Explorer, click <b>Add Reference</b>, click </span><br>
|
|
<span style="color:green;">// <b>Assemblies > Framework</b> in the left-side panel, browse to the top folder of </span><br>
|
|
<span style="color:green;">// your SOLIDWORKS PDM Professional installation, locate and click </span><br>
|
|
<span style="color:green;">// <b>EPDM.Interop.epdm.dll</b>, click <b>Open</b>, click <b>Add</b>, and click <b>Close</b>).</span><br>
|
|
<span style="color:green;">// 3. Right-click <b>EPDM.Interop.epdm</b> in References, click <b>Properties</b>, and set </span><br>
|
|
<span style="color:green;">// <b>Embed Interop Types</b> to <b>False</b> to handle methods that pass arrays of </span><br>
|
|
<span style="color:green;">// structures.</span><br>
|
|
<span style="color:green;">// 4. Click <b>Debug > Start Debugging</b> or press F5.</span><br>
|
|
<span style="color:green;">//</span><br>
|
|
<span style="color:green;">// Postconditions: </span><br>
|
|
<span style="color: #008000; background-position: 0 0">//</span><font size="2"><span style="color:green;"> 1. The Add custom references dialog displays.<br>
|
|
</span>/<span style="color:green;">/ 2. Select a vault.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> 3. Click <b>Browse for file to which to add custom reference</b>, </span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> locate and click a file in the vault, and click <b>Open</b>.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> The file is checked out.<br>
|
|
// 4. In a view of the selected vault, right-click a file and click <b>Copy</b>.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> 5. In the
|
|
Add custom references dialog, click <b>Add custom file reference</b>.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> The file that was copied to the clipboard is added as a custom </span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> reference to the checked-out file.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> 6. In the Create File References dialog, click <b>OK</b>.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> The file is checked in.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> 7. In the Edit User-Defined File References dialog, click <b>OK</b>.</span><br>
|
|
<span style="color: #008000">//</span><span style="color:green;"> 8. Close the Add custom references dialog. </span></font><br>
|
|
<span style="color:green;">
|
|
//----------------------------------------------------------------------------</span><br>
|
|
<br>
|
|
<span style="color:green;"><a name="Form1.cs"></a>//Form1.cs</span><br>
|
|
<span style="color:blue;">using</span> System.IO;<br>
|
|
<span style="color:blue;">using</span> System.Xml.Serialization;<br>
|
|
<span style="color:blue;">using</span> System;<br>
|
|
<span style="color:blue;">using</span> System.Collections;<br>
|
|
<span style="color:blue;">using</span> System.Collections.Generic;<br>
|
|
<span style="color:blue;">using</span> System.Data;<br>
|
|
<span style="color:blue;">using</span> System.Diagnostics;<br>
|
|
<span style="color:blue;">using</span> System.Windows.Forms;<br>
|
|
<span style="color:blue;">using</span> System.ComponentModel;<br>
|
|
<span style="color:blue;">using</span> EPDM.Interop.epdm;<br>
|
|
<br>
|
|
<span style="color:blue;">namespace</span> CustRefCSharp<br>
|
|
{<br>
|
|
<span style="color:blue;">public</span> <span style="color:blue;">partial</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Form1</span> : <span style="color:#2b91af;">Form</span><br>
|
|
{<br>
|
|
<span style="color:blue;">public</span> Form1()<br>
|
|
{<br>
|
|
InitializeComponent();<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:#2b91af;">IEdmVault5</span> vault1 = <span style="color:blue;">null</span>;<br>
|
|
<br>
|
|
<span style="color:blue;">public</span> <span style="color:blue;">void</span> FileReferencesCSharp_Load(System.<span style="color:#2b91af;">Object</span> sender, System.<span style="color:#2b91af;">EventArgs</span> e)<br>
|
|
{<br>
|
|
<br>
|
|
<span style="color:blue;">try</span><br>
|
|
{<br>
|
|
<span style="color:#2b91af;">IEdmVault5</span> vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();<br>
|
|
<span style="color:#2b91af;">IEdmVault8</span> vault = (<span style="color:#2b91af;">IEdmVault8</span>)vault1;<br>
|
|
<span style="color:#2b91af;">EdmViewInfo</span>[] Views = <span style="color:blue;">null</span>;<br>
|
|
<br>
|
|
vault.<b>GetVaultViews</b>(<span style="color:blue;">out</span> Views, <span style="color:blue;">false</span>);<br>
|
|
VaultsComboBox.Items.Clear();<br>
|
|
<span style="color:blue;">foreach</span> (<span style="color:#2b91af;">EdmViewInfo</span> View <span style="color:blue;">in</span> Views)<br>
|
|
{<br>
|
|
VaultsComboBox.Items.Add(View.<b>mbsVaultName</b>);<br>
|
|
}<br>
|
|
<span style="color:blue;">if</span> (VaultsComboBox.Items.Count > 0)<br>
|
|
{<br>
|
|
VaultsComboBox.Text = (<span style="color:blue;">string</span>)VaultsComboBox.Items[0];<br>
|
|
}<br>
|
|
}<br>
|
|
<span style="color:blue;">catch</span> (System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span> ex)<br>
|
|
{<br>
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"HRESULT = 0x"</span> + ex.ErrorCode.ToString(<span style="color:#a31515;">"X"</span>) + <span style="color:#a31515;">"\n"</span> + ex.Message);<br>
|
|
}<br>
|
|
<span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)<br>
|
|
{<br>
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message);<br>
|
|
}<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:blue;">public</span> <span style="color:blue;">void</span> BrowseButton_Click(System.<span style="color:#2b91af;">Object</span> sender, System.<span style="color:#2b91af;">EventArgs</span> e)<br>
|
|
{<br>
|
|
<span style="color:blue;">try</span><br>
|
|
{<br>
|
|
CustRefListBox.Items.Clear();<br>
|
|
<br>
|
|
<span style="color:green;">//Only create a new vault object</span><br>
|
|
<span style="color:green;">//if one hasn't been created yet</span><br>
|
|
<span style="color:blue;">if</span> (vault1 == <span style="color:blue;">null</span>)<br>
|
|
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();<br>
|
|
<span style="color:blue;">if</span> (!vault1.<b>IsLoggedIn</b>)<br>
|
|
{<br>
|
|
<span style="color:green;">//Log into selected vault as the current user</span><br>
|
|
vault1.<b>LoginAuto</b>(VaultsComboBox.Text, <span style="color:blue;">this</span>.Handle.ToInt32());<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:green;">//Set the initial directory in the File Open dialog</span><br>
|
|
CustRefOpenFileDialog.InitialDirectory = vault1.<b>RootFolderPath</b>;<br>
|
|
<span style="color:green;">//Show the File Open dialog</span><br>
|
|
System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span> DialogResult = <span style="color:blue;">default</span>(System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span>);<br>
|
|
DialogResult = CustRefOpenFileDialog.ShowDialog();<br>
|
|
<span style="color:green;">//If the user didn't click Open, exit the sub</span><br>
|
|
<span style="color:blue;">if</span> (!(DialogResult == System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span>.OK))<br>
|
|
<span style="color:blue;">return</span>;<br>
|
|
<br>
|
|
<span style="color:blue;">foreach</span> (<span style="color:blue;">string</span> FileName <span style="color:blue;">in</span> CustRefOpenFileDialog.FileNames)<br>
|
|
{<br>
|
|
CustRefListBox.Items.Add(FileName);<br>
|
|
}<br>
|
|
}<br>
|
|
<span style="color:blue;">catch</span> (System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span> ex)<br>
|
|
{<br>
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"HRESULT = 0x"</span> + ex.ErrorCode.ToString(<span style="color:#a31515;">"X"</span>) + <span style="color:#a31515;">"\n"</span> + ex.Message);<br>
|
|
}<br>
|
|
<span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)<br>
|
|
{<br>
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message);<br>
|
|
}<br>
|
|
}<br>
|
|
<br>
|
|
<br>
|
|
<span style="color:blue;">public</span> <span style="color:blue;">void</span> AddCustomFileReference_Click(System.<span style="color:#2b91af;">Object</span> sender, System.<span style="color:#2b91af;">EventArgs</span> e)<br>
|
|
{<br>
|
|
<span style="color:blue;">try</span><br>
|
|
{<br>
|
|
<span style="color:green;">//Only create a new vault object</span><br>
|
|
<span style="color:green;">//if one hasn't been created yet</span><br>
|
|
<span style="color:#2b91af;">IEdmVault7</span> vault2 = <span style="color:blue;">null</span>;<br>
|
|
<span style="color:blue;">if</span> (vault1 == <span style="color:blue;">null</span>)<br>
|
|
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();<br>
|
|
vault2 = (<span style="color:#2b91af;">IEdmVault7</span>)vault1;<br>
|
|
<span style="color:blue;">if</span> (!vault1.<b>IsLoggedIn</b>)<br>
|
|
{<br>
|
|
<span style="color:green;">//Log into selected vault as the current user</span><br>
|
|
vault1.<b>LoginAuto</b>(VaultsComboBox.Text, <span style="color:blue;">this</span>.Handle.ToInt32());<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:#2b91af;">IEdmAddCustomRefs</span> addCustRefs = (<span style="color:#2b91af;">IEdmAddCustomRefs</span>)vault2.<b>CreateUtility</b>(<span style="color:#2b91af;">EdmUtility</span>.<b>EdmUtil_AddCustomRefs</b>);<br>
|
|
<span style="color:#2b91af;">Int32</span>[] ppoFileIdArray = <span style="color:blue;">new</span> <span style="color:#2b91af;">Int32</span>[CustRefListBox.Items.Count];<br>
|
|
<span style="color:#2b91af;">IEdmFile5</span> file = <span style="color:blue;">null</span>;<br>
|
|
<span style="color:#2b91af;">IEdmFolder5</span> parentFolder = <span style="color:blue;">null</span>;<br>
|
|
<span style="color:blue;">int</span> i = 0;<br>
|
|
<span style="color:blue;">foreach</span> (<span style="color:blue;">string</span> FileName <span style="color:blue;">in</span> CustRefListBox.Items)<br>
|
|
{<br>
|
|
file = vault2.<b>GetFileFromPath</b>(FileName, <span style="color:blue;">out</span> parentFolder);<br>
|
|
<span style="color:blue;">if</span> (!file.<b>IsLocked</b>) {<br>
|
|
file.<b>LockFile</b>(parentFolder.<b>ID</b>, <span style="color:blue;">this</span>.Handle.ToInt32(), (<span style="color:blue;">int</span>)<span style="color:#2b91af;">EdmLockFlag</span>.EdmLock_Simple);<br>
|
|
}<br>
|
|
ppoFileIdArray[i] = file.<b>ID</b>;<br>
|
|
i++;<br>
|
|
}<br>
|
|
<span style="color:#2b91af;">Boolean</span> retCode = <span style="color:blue;">false</span>;<br>
|
|
<br>
|
|
<span style="color:green;">//Add the file that is copied to the clipboard as a custom reference to the selected file</span><br>
|
|
<span style="color:blue;">foreach</span> (<span style="color:blue;">int</span> ID <span style="color:blue;">in</span> ppoFileIdArray)<br>
|
|
{<br>
|
|
addCustRefs.<b>AddReferencesClipboard</b>(ID);<br>
|
|
addCustRefs.<b>CreateTree</b>((<span style="color:blue;">int</span>)<span style="color:#2b91af;">EdmCreateReferenceFlags</span>.Ecrf_Nothing);<br>
|
|
addCustRefs.<b>ShowDlg</b>(<span style="color:blue;">this</span>.Handle.ToInt32());<br>
|
|
retCode = addCustRefs.<b>CreateReferences</b>();<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:green;">// Check in the file</span><br>
|
|
file.<b>UnlockFile</b>(<span style="color:blue;">this</span>.Handle.ToInt32(), <span style="color:#a31515;">"Custom reference added"</span>);<br>
|
|
<br>
|
|
<span style="color:green;">//Display current custom file references</span><br>
|
|
retCode = addCustRefs.<b>ShowEditReferencesDlg</b>(<span style="color:blue;">ref</span> ppoFileIdArray, <span style="color:blue;">this</span>.Handle.ToInt32());<br>
|
|
<br>
|
|
}<br>
|
|
<span style="color:blue;">catch</span> (System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span> ex)<br>
|
|
{<br>
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"HRESULT = 0x"</span> + ex.ErrorCode.ToString(<span style="color:#a31515;">"X"</span>) + <span style="color:#a31515;">"\n"</span> + ex.Message);<br>
|
|
}<br>
|
|
<span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)<br>
|
|
{<br>
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message);<br>
|
|
}<br>
|
|
}<br>
|
|
<br>
|
|
}<br>
|
|
}</p>
|
|
<p style="font-family: Courier New; color: black; background: white" align="center">
|
|
<a href="#top">Back to top</a></p>
|
|
<p style="font-family: Courier New; font-size: 13; color: #008000; background: white" class="APICODE">
|
|
<a name="Form1.Designer.cs"></a>//Form1.Designer.cs</p>
|
|
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE">
|
|
<span style="color:blue;">namespace</span> CustRefCSharp<br>
|
|
{<br>
|
|
<span style="color:blue;">partial</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Form1</span><br>
|
|
{<br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><summary></span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> Required designer variable.</span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"></summary></span><br>
|
|
<span style="color:blue;">private</span> System.ComponentModel.<span style="color:#2b91af;">IContainer</span> components = <span style="color:blue;">null</span>;<br>
|
|
<br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><summary></span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> Clean up any resources being used.</span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"></summary></span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><param name="disposing"></span><span style="color:green;">true if managed resources should be disposed; otherwise, false.</span><span style="color:gray;"></param></span><br>
|
|
<span style="color:blue;">protected</span> <span style="color:blue;">override</span> <span style="color:blue;">void</span> Dispose(<span style="color:blue;">bool</span> disposing)<br>
|
|
{<br>
|
|
<span style="color:blue;">if</span> (disposing && (components != <span style="color:blue;">null</span>))<br>
|
|
{<br>
|
|
components.Dispose();<br>
|
|
}<br>
|
|
<span style="color:blue;">base</span>.Dispose(disposing);<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:blue;"> #region</span> Windows Form Designer generated code<br>
|
|
<br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><summary></span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> Required method for Designer support - do not modify</span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> the contents of this method with the code editor.</span><br>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"></summary></span><br>
|
|
<span style="color:blue;">private</span> <span style="color:blue;">void</span> InitializeComponent()<br>
|
|
{<br>
|
|
<span style="color:blue;">this</span>.VaultsLabel = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span>();<br>
|
|
<span style="color:blue;">this</span>.VaultsComboBox = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span>();<br>
|
|
<span style="color:blue;">this</span>.BrowseButton = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span>();<br>
|
|
<span style="color:blue;">this</span>.CustRefListBox = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span>();<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span>();<br>
|
|
<span style="color:blue;">this</span>.CustRefOpenFileDialog = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span>();<br>
|
|
<span style="color:blue;">this</span>.SuspendLayout();<br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:green;">// VaultsLabel</span><br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:blue;">this</span>.VaultsLabel.AutoSize = <span style="color:blue;">true</span>;<br>
|
|
<span style="color:blue;">this</span>.VaultsLabel.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(13, 26);<br>
|
|
<span style="color:blue;">this</span>.VaultsLabel.Name = <span style="color:#a31515;">"VaultsLabel"</span>;<br>
|
|
<span style="color:blue;">this</span>.VaultsLabel.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(244, 13);<br>
|
|
<span style="color:blue;">this</span>.VaultsLabel.TabIndex = 0;<br>
|
|
<span style="color:blue;">this</span>.VaultsLabel.Text = <span style="color:#a31515;">"Copy a file to the clipboard, then select vault view:"</span>;<br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:green;">// VaultsComboBox</span><br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:blue;">this</span>.VaultsComboBox.FormattingEnabled = <span style="color:blue;">true</span>;<br>
|
|
<span style="color:blue;">this</span>.VaultsComboBox.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 59);<br>
|
|
<span style="color:blue;">this</span>.VaultsComboBox.Name = <span style="color:#a31515;">"VaultsComboBox"</span>;<br>
|
|
<span style="color:blue;">this</span>.VaultsComboBox.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(121, 21);<br>
|
|
<span style="color:blue;">this</span>.VaultsComboBox.TabIndex = 1;<br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:green;">// BrowseButton</span><br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:blue;">this</span>.BrowseButton.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 98);<br>
|
|
<span style="color:blue;">this</span>.BrowseButton.Name = <span style="color:#a31515;">"BrowseButton"</span>;<br>
|
|
<span style="color:blue;">this</span>.BrowseButton.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(271, 23);<br>
|
|
<span style="color:blue;">this</span>.BrowseButton.TabIndex = 3;<br>
|
|
<span style="color:blue;">this</span>.BrowseButton.Text = <span style="color:#a31515;">"Browse for file to which to add a custom reference..."</span>;<br>
|
|
<span style="color:blue;">this</span>.BrowseButton.UseVisualStyleBackColor = <span style="color:blue;">true</span>;<br>
|
|
<span style="color:blue;">this</span>.BrowseButton.Click += <span style="color:blue;">new</span> System.<span style="color:#2b91af;">EventHandler</span>(<span style="color:blue;">this</span>.BrowseButton_Click);<br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:green;">// CustRefListBox</span><br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:blue;">this</span>.CustRefListBox.FormattingEnabled = <span style="color:blue;">true</span>;<br>
|
|
<span style="color:blue;">this</span>.CustRefListBox.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 150);<br>
|
|
<span style="color:blue;">this</span>.CustRefListBox.Name = <span style="color:#a31515;">"CustRefListBox"</span>;<br>
|
|
<span style="color:blue;">this</span>.CustRefListBox.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(259, 95);<br>
|
|
<span style="color:blue;">this</span>.CustRefListBox.TabIndex = 4;<br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:green;">// AddCustomFileReference</span><br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(16, 273);<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.Name = <span style="color:#a31515;">"AddCustomFileReference"</span>;<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(259, 23);<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.TabIndex = 5;<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.Text = <span style="color:#a31515;">"Add custom file reference"</span>;<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.UseVisualStyleBackColor = <span style="color:blue;">true</span>;<br>
|
|
<span style="color:blue;">this</span>.AddCustomFileReference.Click += <span style="color:blue;">new</span> System.<span style="color:#2b91af;">EventHandler</span>(<span style="color:blue;">this</span>.AddCustomFileReference_Click);<br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:green;">// Form1</span><br>
|
|
<span style="color:green;">// </span><br>
|
|
<span style="color:blue;">this</span>.AutoScaleDimensions = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">SizeF</span>(6F, 13F);<br>
|
|
<span style="color:blue;">this</span>.AutoScaleMode = System.Windows.Forms.<span style="color:#2b91af;">AutoScaleMode</span>.Font;<br>
|
|
<span style="color:blue;">this</span>.ClientSize = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(317, 308);<br>
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.AddCustomFileReference);<br>
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.CustRefListBox);<br>
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.BrowseButton);<br>
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.VaultsComboBox);<br>
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.VaultsLabel);<br>
|
|
<span style="color:blue;">this</span>.Name = <span style="color:#a31515;">"Form1"</span>;<br>
|
|
<span style="color:blue;">this</span>.Text = <span style="color:#a31515;">"Add custom file references"</span>;<br>
|
|
<span style="color:blue;">this</span>.Load += <span style="color:blue;">new</span> System.<span style="color:#2b91af;">EventHandler</span>(<span style="color:blue;">this</span>.FileReferencesCSharp_Load);<br>
|
|
<span style="color:blue;">this</span>.ResumeLayout(<span style="color:blue;">false</span>);<br>
|
|
<span style="color:blue;">this</span>.PerformLayout();<br>
|
|
<br>
|
|
}<br>
|
|
<br>
|
|
<span style="color:blue;"> #endregion</span><br>
|
|
<br>
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span> VaultsLabel;<br>
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span> VaultsComboBox;<br>
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span> BrowseButton;<br>
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span> CustRefListBox;<br>
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span> AddCustomFileReference;<br>
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span> CustRefOpenFileDialog;<br>
|
|
}<br>
|
|
}</p>
|
|
<p style="font-family: Courier New; color: black; background: white" align="center">
|
|
<a href="#top">Back to top</a></p>
|
|
|
|
</body>
|
|
|
|
</html>
|