Initial Commit of the PDM project (ready for DWS migration)
This commit is contained in:
@@ -0,0 +1,400 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Access Custom File References 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">
|
||||
<meta name=MS-HKWD content="C# examples,file references">
|
||||
<body>
|
||||
<h1><span style="font-weight: normal; font-size: 7.5pt;">SOLIDWORKS PDM Professional API Help</span></h1>
|
||||
<h1>Access Custom File References Example (C#)</h1>
|
||||
<p><a name="top"></a>This example shows how to access custom file references.</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="AccessCustRefs.gif" width="303" height="260"></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>AccessCustRef_CSharp</b> in <b>Name</b>.</span><br>
|
||||
<span style="color:green;">// c. Click <b>Browse</b> and navigate to the folder where to create 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. Replace the code in <b>Form1.cs</b> with <a href="#Form1.cs">this code</a>.</span><br>
|
||||
<span style="color:green;">// g. To create the form,
|
||||
replace the code in <b>Form1.Designer.cs</b> with <br>
|
||||
// <a href="#Form1.Designer.cs">this code</a>.</span><br>
|
||||
<font color="#008000">// 2. Add references to:<br>
|
||||
// b. <b>EPDM.Interop.epdm.dll</b> (click <b>Browse</b> and browse to the top
|
||||
folder <br>
|
||||
// of your SOLIDWORKS PDM Professional installation, click <br>
|
||||
// <b> EPDM.Interop.epdm.dll</b> > <b>Add</b>).<br>
|
||||
</font><font size="2"><span style="COLOR: green">// c. </span><b>
|
||||
<font color="#008000">EPDM.interop.EPDMResultCode.dll</font></b> (</font><font color="#008000"><font size="2">click
|
||||
<b>Browse ></b><br>
|
||||
// <b>EPDM.interop.EPDMResultCode.dll > Add > OK</b>)</font><font size="1">.</font></font><span style="COLOR: green"><br>
|
||||
</span><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:green;">//</span><font size="2"><span style="color:green;"> 1. Displays
|
||||
the Add custom file reference dialog box.</span><br>
|
||||
</font>
|
||||
<span style="color:green;">//</span><font size="2"><span style="color:green;">
|
||||
a. Select a vault view.</span><br>
|
||||
</font>
|
||||
<span style="color:green;">//</span><font size="2"><span style="color:green;">
|
||||
b. Click <b>Browse for two files</b>. </span><br>
|
||||
</font>
|
||||
<span style="color:green;">//</span><font size="2"><span style="color:green;">
|
||||
1. Locate and click two files in the root
|
||||
folder of the vault.<br>
|
||||
</span>
|
||||
</font>
|
||||
<span style="color:green;">//</span><font size="2"><span style="color:green;">
|
||||
2. Click <b>Open</b>.<br>
|
||||
// 3. Checks out the first file.<br>
|
||||
// c. Click <b>Add custom file reference</b>.</span><br>
|
||||
<span style="color:green;">// d. Click <b>OK</b> to close each
|
||||
message box.</span><br>
|
||||
</font>
|
||||
<span style="color:green;">//</span><font size="2"><span style="color:green;"> 2. Close the Add custom file reference dialog. </span></font><br>
|
||||
<span style="color:green;">
|
||||
//----------------------------------------------------------------------------</span><br>
|
||||
<br>
|
||||
<span style="color:green;"><a name="Form1.cs"></a>//Form1.cs</span><br>
|
||||
</p>
|
||||
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE">
|
||||
<span style="color:blue;">using</span> System;<br>
|
||||
<span style="color:blue;">using</span> System.Collections.Generic;<br>
|
||||
<span style="color:blue;">using</span> System.ComponentModel;<br>
|
||||
<span style="color:blue;">using</span> System.Data;<br>
|
||||
<span style="color:blue;">using</span> System.Drawing;<br>
|
||||
<span style="color:blue;">using</span> System.Linq;<br>
|
||||
<span style="color:blue;">using</span> System.Text;<br>
|
||||
<span style="color:blue;">using</span> System.Windows.Forms;<br>
|
||||
<span style="color:blue;">using</span> EPDM.Interop.epdm;<br>
|
||||
<br>
|
||||
<br>
|
||||
<span style="color:blue;">namespace</span> AccessCustRefs_CSharp<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>
|
||||
<span style="color:blue;">private</span> <span style="color:#2b91af;">IEdmVault5</span> vault1 = <span style="color:blue;">null</span>;<br>
|
||||
<span style="color:#2b91af;">IEdmEnumeratorCustomReference7</span> addCustRefs;<br>
|
||||
<span style="color:#2b91af;">IEdmFile5</span> file1 = <span style="color:blue;">null</span>;<br>
|
||||
<span style="color:#2b91af;">IEdmFile5</span> file2 = <span style="color:blue;">null</span>;<br>
|
||||
<br>
|
||||
<span style="color:#2b91af;">IEdmFolder5</span> parentFolder = <span style="color:blue;">null</span>;<br>
|
||||
<br>
|
||||
<span style="color:blue;">public</span> <span style="color:blue;">void</span> Form1_Load(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:#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:blue;">if</span> (vault1 == <span style="color:blue;">null</span>)<br>
|
||||
{<br>
|
||||
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();<br>
|
||||
}<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 Open dialog</span><br>
|
||||
CustRefOpenFileDialog.InitialDirectory = vault1.<b>RootFolderPath</b>;<br>
|
||||
<span style="color:green;">//Show the Open dialog</span><br>
|
||||
System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span> DialogResult;<br>
|
||||
DialogResult = CustRefOpenFileDialog.ShowDialog();<br>
|
||||
<span style="color:green;">//If the user didn't click Open, exit</span><br>
|
||||
<span style="color:blue;">if</span> (!(DialogResult == System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span>.OK))<br>
|
||||
{<br>
|
||||
<span style="color:blue;">return</span>;<br>
|
||||
}<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>
|
||||
<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>
|
||||
{<br>
|
||||
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();<br>
|
||||
}<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>
|
||||
|
||||
<font color="#008000">//Get the two selected files</font><br>
|
||||
file1 = vault2.<b>GetFileFromPath</b>(CustRefListBox.Items[0].ToString(), <span style="color:blue;">out</span> parentFolder);<br>
|
||||
file2 = vault2.<b>GetFileFromPath</b>(CustRefListBox.Items[1].ToString(), <span style="color:blue;">out</span> parentFolder);<br>
|
||||
<br>
|
||||
|
||||
<font color="#008000">//Check out the first file</font><br>
|
||||
<span style="color:blue;">if</span> (!file1.<b>IsLocked</b>)<br>
|
||||
{<br>
|
||||
file1.<b>LockFile</b>(parentFolder.<b>ID</b>, <span style="color:blue;">this</span>.Handle.ToInt32(), <span style="color:#2b91af;">Convert</span>.ToInt32(<span style="color:#2b91af;">EdmLockFlag</span>.EdmLock_Simple));<br>
|
||||
}<br>
|
||||
<br>
|
||||
|
||||
<font color="#008000">//Add the second file as a custom reference to the first
|
||||
file</font><br>
|
||||
addCustRefs = (<span style="color:#2b91af;">IEdmEnumeratorCustomReference7</span>)file1;<br>
|
||||
addCustRefs.<b>AddReference3</b>(file2.<b>ID</b>, parentFolder.<b>ID</b>, 1, <span style="color:blue;">true</span>);<br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(file2.<b>Name</b> + <span style="color:#a31515;">" added as reference to "</span> + file1.<b>Name</b>);<br>
|
||||
|
||||
<font color="#0000FF">bool</font> shownInBOM;<br>
|
||||
|
||||
shownInBOM = addCustRefs.<b>GetShowInBOM</b>(file2.<b>ID</b>, parentFolder.<b>ID</b>);<br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(file2.<b>Name</b>
|
||||
+ <font color="#A31515">" shown in BOM? "</font> + shownInBOM);<br>
|
||||
<br>
|
||||
|
||||
<font color="#008000">//Check in the first file</font><br>
|
||||
file1.<b>UnlockFile</b>(<span style="color:blue;">this</span>.Handle.ToInt32(), <span style="color:#a31515;">"Custom reference added"</span>);<br>
|
||||
<br>
|
||||
|
||||
<font color="#008000">//Display all of the custom references of the first file</font><br>
|
||||
ShowFileRefs();<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;">private</span> <span style="color:blue;">void</span> ShowFileRefs()<br>
|
||||
{<br>
|
||||
<span style="color:blue;">try</span><br>
|
||||
{<br>
|
||||
<span style="color:#2b91af;">IEdmEnumeratorCustomReference6</span> enumRef = <span style="color:blue;">default</span>(<span style="color:#2b91af;">IEdmEnumeratorCustomReference6</span>);<br>
|
||||
enumRef = (<span style="color:#2b91af;">IEdmEnumeratorCustomReference6</span>)file1;<br>
|
||||
<span style="color:#2b91af;">IEdmPos5</span> pos = <span style="color:blue;">default</span>(<span style="color:#2b91af;">IEdmPos5</span>);<br>
|
||||
pos = enumRef.<b>GetFirstRefPosition</b>();<br>
|
||||
<span style="color:blue;">int</span> fileID = 0;<br>
|
||||
<span style="color:blue;">int</span> folderID = 0;<br>
|
||||
<span style="color:blue;">string</span> message = <span style="color:blue;">null</span>;<br>
|
||||
<span style="color:blue;">int</span> quant = 1;<br>
|
||||
<span style="color:blue;">string</span> pbsRetPath = <span style="color:#a31515;">""</span>;<br>
|
||||
message = <span style="color:#a31515;">"Custom references of "</span> + file1.<b>Name</b> + <span style="color:#a31515;">":"</span> + <span style="color:#a31515;">"\r\n"</span>;<br>
|
||||
<span style="color:blue;">while</span> (!pos.<b>IsNull</b>)<br>
|
||||
{<br>
|
||||
enumRef.<b>GetNextRef2</b>(pos, <span style="color:blue;">out</span> fileID, <span style="color:blue;">out</span> folderID, <span style="color:blue;">out</span> pbsRetPath, <span style="color:blue;">out</span> quant);<br>
|
||||
message = message + pbsRetPath + <span style="color:#a31515;">" (fileID="</span> + fileID.ToString() + <span style="color:#a31515;">", folderID="</span> + folderID.ToString() + <span style="color:#a31515;">", quantity="</span> + quant.ToString() + <span style="color:#a31515;">")"</span> + <span style="color:#a31515;">"\r\n"</span>;<br>
|
||||
}<br>
|
||||
<span style="color:#2b91af;">MessageBox</span>.Show(message);<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;">"\r\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>
|
||||
}</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> AccessCustRefs_CSharp<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>(91, 13);<br>
|
||||
<span style="color:blue;">this</span>.VaultsLabel.TabIndex = 0;<br>
|
||||
<span style="color:blue;">this</span>.VaultsLabel.Text = <span style="color:#a31515;">"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, 42);<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, 78);<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>(146, 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 two files..."</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>(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.HorizontalScrollbar = <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, 107);<br>
|
||||
<span style="color:blue;">this</span>.CustRefListBox.Name = <span style="color:#a31515;">"CustRefListBox"</span>;<br>
|
||||
<span style="color:blue;">this</span>.CustRefListBox.SelectionMode = System.Windows.Forms.<span style="color:#2b91af;">SelectionMode</span>.MultiExtended;<br>
|
||||
<span style="color:blue;">this</span>.CustRefListBox.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(259, 56);<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>(68, 175);<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>(150, 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>(AddCustomFileReference_Click);<br>
|
||||
<span style="color:green;">//</span><br>
|
||||
<span style="color:green;">//CustRefOpenFileDialog</span><br>
|
||||
<span style="color:green;">//</span><br>
|
||||
<span style="color:blue;">this</span>.CustRefOpenFileDialog.Multiselect = <span style="color:blue;">true</span>;<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>(287, 222);<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 reference"</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>.Form1_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;">internal</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span> VaultsLabel;<br>
|
||||
<span style="color:blue;">internal</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span> VaultsComboBox;<br>
|
||||
<span style="color:blue;">internal</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span> BrowseButton;<br>
|
||||
<span style="color:blue;">internal</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span> CustRefListBox;<br>
|
||||
<span style="color:blue;">internal</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span> AddCustomFileReference;<br>
|
||||
<span style="color:blue;">internal</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span> CustRefOpenFileDialog;<br>
|
||||
}<br>
|
||||
}</p>
|
||||
<p style="font-family: Courier New; font-size: 13; color: black; background: white" class="APICODE">
|
||||
</p>
|
||||
<p style="font-family: Courier New; color: black; background: white" align="center">
|
||||
<a href="#top">Back to top</a></p>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user