387 lines
50 KiB
HTML
387 lines
50 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<title>Roll Back Revisions 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,revisions">
|
|
<meta name=MS-HKWD content="C# examples,versions">
|
|
<meta name=MS-HKWD content="C# examples,rollback">
|
|
<body>
|
|
<h1><span style="font-weight: normal; font-size: 7.5pt;">SOLIDWORKS PDM Professional API Help</span></h1>
|
|
<h1>Roll Back Revisions Example (C#)</h1>
|
|
<p><a name="Top"></a>This example shows how to roll back a checked-in file to its first revision in the current version.</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="Revision.gif" width="327" height="233"></p>
|
|
|
|
<pre style="font-family: Courier New; font-size: 13; color: black; background: white"><span style="color:green;">//----------------------------------------------------------------------------</span>
|
|
<span style="color:green;">// Preconditions:</span>
|
|
<span style="color:green;">// 1. Start Microsoft Visual Studio.</span>
|
|
<span style="color:green;">// a. Click <b>File > New > Project > Visual C# > Windows Forms Application</b>.</span>
|
|
<span style="color:green;">// b. Type <b>RevisionCSharp</b> in <b>Name</b>.</span>
|
|
<span style="color:green;">// c. Click <b>Browse</b> and navigate to the folder where to create the project.</span>
|
|
<span style="color:green;">// d. Click <b>OK</b>. </span>
|
|
<span style="color:green;">// e. Click <b>Show All Files</b> in the Solution Explorer toolbar and expand </span>
|
|
<span style="color:green;">// <b>Form1.cs</b> in the Solution Explorer.</span>
|
|
<span style="color:green;">// f. Replace the code in <b>Form1.cs</b> with <a href="#Form1">this code</a>.</span>
|
|
<span style="color:green;">// g. To create the form, replace the code in <b>Form1.Designer.cs</b> with </span>
|
|
<span style="color:green;">// <a href="#Designer">this code</a>.</span>
|
|
<span style="color:green;">// 2. Add <b>EPDM.Interop.epdm.dll</b> as a reference (right-click the project</span>
|
|
<span style="color:green;">// name in the Solution Explorer, click <b>Add > Reference</b>, click </span>
|
|
<span style="color:green;">// <b>Assemblies > Framework</b> in the left-side panel, browse to the top folder of </span>
|
|
<span style="color:green;">// your SOLIDWORKS PDM Professional installation, locate and click </span>
|
|
<span style="color:green;">// <b>EPDM.Interop.epdm.dll</b> > <b>Add</b> > <b>OK</b>).</span>
|
|
<span style="color:green;">// 3. Right-click <b>EPDM.Interop.epdm</b> in References, click <b>Properties</b>, and set </span>
|
|
<span style="color:green;">// <b>Embed Interop Types</b> to <b>False</b> to handle methods that pass arrays of </span>
|
|
<span style="color:green;">// structures.</span>
|
|
<span style="color:green;">// 4. To find a checked-in file with a revision scheme and at least three
|
|
// </span><span style="color:green;">revisions in </span><span style="color:green;">the current version:</span>
|
|
<span style="color:green;">// a. Open a vault view in File Explorer.</span>
|
|
<span style="color:green;">// b. Click a checked-in file.</span>
|
|
<span style="color:green;">// c. Click <b>Display > History</b>.</span>
|
|
<span style="color:green;">// d. Examine the Event column. If <b>Revision</b> is:</span>
|
|
<span style="color:green;">// * listed in the Event column, then the file </span>
|
|
<span style="color:green;">// has a revision scheme. Scroll down and examine the
|
|
// </span><span style="color:green;">Event and Version columns </span><span style="color:green;">to verify that at least three
|
|
// </span><span style="color:green;">revisions exist for </span><span style="color:green;">the current version of the file.</span>
|
|
<span style="color:green;">// * not listed in the Event column, then</span>
|
|
<span style="color:green;">// repeat steps 4b - 4d until you find a checked-in file </span>
|
|
<span style="color:green;">// </span><span style="color:green;">with </span><span style="color:green;">a revision scheme and at least three revisions for
|
|
// the current version. </span>
|
|
<span style="color:green;">// 5. Click <b>Debug > Start Debugging </b>or press F5.</span>
|
|
<span style="color:green;">//</span>
|
|
<span style="color:green;">// Postconditions: </span>
|
|
<span style="color:green;">// 1. Displays the Get revision names dialog box.</span>
|
|
<span style="color:green;">// 2. Select a vault view.</span>
|
|
<span style="color:green;">// 3. Click <b>Browse</b>.</span>
|
|
<span style="color:green;">// 4. Displays the Select a file dialog box.</span>
|
|
<span style="color:green;">// a. Click the file identified in Preconditions step 4 in the </span>
|
|
<span style="color:green;">// selected vault.</span>
|
|
<span style="color:green;">// b. Click <b>Open </b>to display the selected file's path and file </span>
|
|
<span style="color:green;">// name in the </span><span style="color:green;">Get revision names</span><span style="color:green;"> dialog box.</span>
|
|
<span style="color:green;">// 5. Click <b>Get revisions</b>. </span>
|
|
<span style="color:green;">// 6. Displays a message box listing the names of the revisions
|
|
// for the selected file. Click <b>OK</b> to close the message box.
|
|
// 7. Displays a message box showing the revision to which the file
|
|
// was rolled back and the current version. Click <b>OK</b> to close the
|
|
// message box.</span>
|
|
<span style="color:green;">// 8. Close the Get revision names dialog box.</span><span style="color:green;">
|
|
// 9. Click the file in the vault in File Explorer for which revisions
|
|
// were rolled back.</span>
|
|
<span style="color:green;">// a. Click <b>Display > History</b>.</span>
|
|
<span style="color:green;">// b. Scroll down and examine the Event, Version, and Comment columns.</span>
|
|
<span style="color:green;">//----------------------------------------------------------------------------</span>
|
|
<span style="color:green;"><a name="Form1"></a>//Form1.cs</span>
|
|
|
|
<span style="color:blue;">using</span> EPDM.Interop.epdm;
|
|
<span style="color:blue;">using</span> System.Windows.Forms;
|
|
<span style="color:blue;">using</span> System;
|
|
|
|
<span style="color:blue;">namespace</span> RevisionCSharp
|
|
{
|
|
<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>
|
|
{
|
|
<span style="color:blue;">public</span> Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
<span style="color:#2b91af;">IEdmVault5</span> vault1 = <span style="color:blue;">null</span>;
|
|
<span style="color:#2b91af;">IEdmVault8</span> vault = <span style="color:blue;">null</span>;
|
|
<span style="color:#2b91af;">IEdmFile5</span> aFile;
|
|
<span style="color:#2b91af;">IEdmFolder5</span> folder;
|
|
|
|
<span style="color:blue;">private</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)
|
|
{
|
|
<span style="color:blue;">try</span>
|
|
{
|
|
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();
|
|
vault = (<span style="color:#2b91af;">IEdmVault8</span>)vault1;
|
|
<span style="color:#2b91af;">EdmViewInfo</span>[] Views = { };
|
|
|
|
vault.<b>GetVaultViews</b>(<span style="color:blue;">out</span> Views, <span style="color:blue;">false</span>);
|
|
VaultsComboBox.Items.Clear();
|
|
<span style="color:blue;">foreach</span> (<span style="color:#2b91af;">EdmViewInfo</span> View <span style="color:blue;">in</span> Views)
|
|
{
|
|
VaultsComboBox.Items.Add(View.<b>mbsVaultName</b>);
|
|
}
|
|
<span style="color:blue;">if</span> (VaultsComboBox.Items.Count > 0)
|
|
{
|
|
VaultsComboBox.Text = (<span style="color:blue;">string</span>)VaultsComboBox.Items[0];
|
|
}
|
|
|
|
}
|
|
<span style="color:blue;">catch</span> (System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span> ex)
|
|
{
|
|
<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);
|
|
}
|
|
<span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)
|
|
{
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message);
|
|
}
|
|
}
|
|
|
|
<span style="color:blue;">public</span> <span style="color:blue;">void</span> RevisionButton_Click(System.<span style="color:#2b91af;">Object</span> sender, System.<span style="color:#2b91af;">EventArgs</span> e)
|
|
{
|
|
<span style="color:blue;">try</span>
|
|
{
|
|
<span style="color:green;">//Only create a new vault object</span>
|
|
<span style="color:green;">//if one hasn't been created yet</span>
|
|
<span style="color:blue;">if</span> (vault1 == <span style="color:blue;">null</span>)
|
|
{
|
|
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();
|
|
}
|
|
|
|
<span style="color:blue;">if</span> (!vault1.<b>IsLoggedIn</b>)
|
|
{
|
|
<span style="color:green;">//Log into selected vault as the current user</span>
|
|
vault1.<b>LoginAuto</b>(VaultsComboBox.Text, <span style="color:blue;">this</span>.Handle.ToInt32());
|
|
}
|
|
|
|
<span style="color:green;">//Get the local version number</span>
|
|
<span style="color:blue;">int</span> version = 0;
|
|
version = aFile.<b>GetLocalVersionNo</b>(folder.ID);
|
|
<span style="color:blue;">if</span> (version < 1)
|
|
{
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(<span style="color:#a31515;">"A local copy of "</span> + aFile.<b>Name</b> + <span style="color:#a31515;">" does not exist."</span>);
|
|
<span style="color:blue;">return</span>;
|
|
}
|
|
|
|
<span style="color:green;">//Get the version interface</span>
|
|
<span style="color:#2b91af;">IEdmEnumeratorVersion7</span> verEnum = <span style="color:blue;">default</span>(<span style="color:#2b91af;">IEdmEnumeratorVersion7</span>);
|
|
verEnum = (<span style="color:#2b91af;">IEdmEnumeratorVersion7</span>)aFile;
|
|
<span style="color:#2b91af;">IEdmVersion8</span> ver = <span style="color:blue;">default</span>(<span style="color:#2b91af;">IEdmVersion8</span>);
|
|
ver = (<span style="color:#2b91af;">IEdmVersion8</span>)verEnum.<b>GetVersion</b>(version);
|
|
|
|
<span style="color:green;">//Enumerate the revisions</span>
|
|
<span style="color:blue;">string</span> message = <span style="color:blue;">null</span>;
|
|
<span style="color:#2b91af;">IEdmPos5</span> pos = <span style="color:blue;">default</span>(<span style="color:#2b91af;">IEdmPos5</span>);
|
|
pos = ver.<b>GetFirstRevisionPosition</b>();<span style="color:#2b91af;">
|
|
IEdmRevision7</span> rev = <span style="color:blue;">default</span>(<span style="color:#2b91af;">IEdmRevision7</span>);<span style="color:blue;">
|
|
</span> <span style="color:blue;">int</span> verNbr = 0;
|
|
|
|
<span style="color:blue;">if</span> (!pos.<b>IsNull</b>)
|
|
{
|
|
message = <span style="color:#a31515;">"The following revisions are set on "</span> + aFile.<b>Name</b> + <span style="color:#a31515;">": "</span> + <span style="color:#a31515;">"\n"</span>;
|
|
<span style="color:blue;">while</span> (!pos.<b>IsNull</b>)
|
|
{
|
|
rev = (<span style="color:#2b91af;">IEdmRevision7</span>)ver.<b>GetNextRevision</b>(pos);
|
|
message = message + <span style="color:#a31515;">" "</span> + rev.<b>Name</b> + <span style="color:#a31515;">"\n"</span>;
|
|
verNbr = rev.<b>VersionNo</b>;
|
|
}
|
|
}
|
|
<span style="color:blue;">else</span>
|
|
{
|
|
message = <span style="color:#a31515;">"A revision scheme is not defined for "</span> + aFile.<b>Name</b> + <span style="color:#a31515;">"."</span> + <span style="color:#a31515;">"\n"</span>;
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(message);
|
|
<span style="color:blue;">return</span>;
|
|
}
|
|
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(message);</pre>
|
|
<pre style="font-family: Consolas; font-size: 13; color: black; background: white"><font face="Courier New" style="font-size: 10pt"><span style="color:green;"> //Roll back to first revision</span>
|
|
pos = ver.<b>GetFirstRevisionPosition</b>();
|
|
rev = (<span style="color:#2b91af;">IEdmRevision7</span>)ver.<b>GetNextRevision</b>(pos);
|
|
ver = (<span style="color:#2b91af;">IEdmVersion8</span>)verEnum.<b>GetVersion</b>(version);
|
|
message = (<span style="color:#a31515;">"Roll back to revision "</span> + rev.<b>Name</b> + <span style="color:#a31515;">" of version "</span> + verNbr);
|
|
rev.<b>Rollback3</b>(message, <span style="color:blue;">true</span>);
|
|
<span style="color:#2b91af;"> MessageBox</span>.Show(message);</font><font face="Courier New">
|
|
|
|
}
|
|
<span style="color:blue;">catch</span> (System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span> ex)
|
|
{
|
|
<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;">" "</span> + ex.Message);
|
|
}
|
|
<span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)
|
|
{
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message);
|
|
}
|
|
}
|
|
|
|
<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)
|
|
{
|
|
<span style="color:blue;">try</span>
|
|
{
|
|
<span style="color:green;">//If one hasn't been created yet</span>
|
|
<span style="color:blue;">if</span> (vault1 == <span style="color:blue;">null</span>)
|
|
{
|
|
vault1 = <span style="color:blue;">new</span> <span style="color:#2b91af;">EdmVault5</span>();
|
|
}
|
|
|
|
<span style="color:blue;">if</span> (!vault1.<b>IsLoggedIn</b>)
|
|
{
|
|
<span style="color:green;">//Log into selected vault as the current user</span>
|
|
vault1.<b>LoginAuto</b>(VaultsComboBox.Text, <span style="color:blue;">this</span>.Handle.ToInt32());
|
|
}
|
|
<span style="color:green;">//Set the initial directory in the Select a file dialog</span>
|
|
OpenFileDialog1.InitialDirectory = vault1.<b>RootFolderPath</b>;
|
|
<span style="color:green;">//Show the Select a file dialog</span>
|
|
System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span> DialogResult;
|
|
DialogResult = OpenFileDialog1.ShowDialog();
|
|
|
|
<span style="color:blue;">if</span> (!(DialogResult == System.Windows.Forms.<span style="color:#2b91af;">DialogResult</span>.OK))
|
|
{
|
|
<span style="color:green;">//Do nothing</span>
|
|
}
|
|
<span style="color:blue;">else</span>
|
|
{
|
|
<span style="color:green;">//Browse for a local file whose revisions you want to see</span>
|
|
<span style="color:blue;">string</span> fileName = OpenFileDialog1.FileName;
|
|
FileListBox.Items.Add(fileName);
|
|
aFile = vault1.<b>GetFileFromPath</b>(fileName, <span style="color:blue;">out</span> folder);
|
|
|
|
}
|
|
|
|
}
|
|
<span style="color:blue;">catch</span> (System.Runtime.InteropServices.<span style="color:#2b91af;">COMException</span> ex)
|
|
{
|
|
<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;">" "</span> + ex.Message);
|
|
}
|
|
<span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)
|
|
{
|
|
<span style="color:#2b91af;">MessageBox</span>.Show(ex.Message);
|
|
}
|
|
|
|
}
|
|
}
|
|
}</font></pre>
|
|
<div align="center">
|
|
<pre style="font-family: Calibri; font-size: 13; color: black; background: white"><a href="#Top">Back to top</a></pre>
|
|
</div>
|
|
<div align="left">
|
|
<pre style="font-family: Courier New; font-size: 13; color: #008000; background: white"><a name="Designer"></a>//Form1.Designer.cs</pre>
|
|
</div>
|
|
<div align="left">
|
|
<pre style="font-family: Courier New; font-size: 13; color: black; background: white"><span style="color:blue;">namespace</span> RevisionCSharp
|
|
{
|
|
<span style="color:blue;">partial</span> <span style="color:blue;">class</span> <span style="color:#2b91af;">Form1</span>
|
|
{
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><summary></span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> Required designer variable.</span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"></summary></span>
|
|
<span style="color:blue;">private</span> System.ComponentModel.<span style="color:#2b91af;">IContainer</span> components = <span style="color:blue;">null</span>;
|
|
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><summary></span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> Clean up any resources being used.</span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"></summary></span>
|
|
<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>
|
|
<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)
|
|
{
|
|
<span style="color:blue;">if</span> (disposing && (components != <span style="color:blue;">null</span>))
|
|
{
|
|
components.Dispose();
|
|
}
|
|
<span style="color:blue;">base</span>.Dispose(disposing);
|
|
}
|
|
|
|
<span style="color:blue;"> #region</span> Windows Form Designer generated code
|
|
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"><summary></span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> Required method for Designer support - do not modify</span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> the contents of this method with the code editor.</span>
|
|
<span style="color:gray;">///</span><span style="color:green;"> </span><span style="color:gray;"></summary></span>
|
|
<span style="color:blue;">private</span> <span style="color:blue;">void</span> InitializeComponent()
|
|
{
|
|
<span style="color:blue;">this</span>.VaultsLabel = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span>();
|
|
<span style="color:blue;">this</span>.VaultsComboBox = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span>();
|
|
<span style="color:blue;">this</span>.FileListBox = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span>();
|
|
<span style="color:blue;">this</span>.BrowseButton = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span>();
|
|
<span style="color:blue;">this</span>.RevisionButton = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span>();
|
|
<span style="color:blue;">this</span>.OpenFileDialog1 = <span style="color:blue;">new</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span>();
|
|
<span style="color:blue;">this</span>.SuspendLayout();
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// VaultsLabel</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.VaultsLabel.AutoSize = <span style="color:blue;">true</span>;
|
|
<span style="color:blue;">this</span>.VaultsLabel.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(23, 13);
|
|
<span style="color:blue;">this</span>.VaultsLabel.Name = <span style="color:#a31515;">"VaultsLabel"</span>;
|
|
<span style="color:blue;">this</span>.VaultsLabel.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(91, 13);
|
|
<span style="color:blue;">this</span>.VaultsLabel.TabIndex = 0;
|
|
<span style="color:blue;">this</span>.VaultsLabel.Text = <span style="color:#a31515;">"Select vault view:"</span>;
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// VaultsComboBox</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.VaultsComboBox.FormattingEnabled = <span style="color:blue;">true</span>;
|
|
<span style="color:blue;">this</span>.VaultsComboBox.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(26, 30);
|
|
<span style="color:blue;">this</span>.VaultsComboBox.Name = <span style="color:#a31515;">"VaultsComboBox"</span>;
|
|
<span style="color:blue;">this</span>.VaultsComboBox.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(220, 21);
|
|
<span style="color:blue;">this</span>.VaultsComboBox.TabIndex = 1;
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// FileListBox</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.FileListBox.FormattingEnabled = <span style="color:blue;">true</span>;
|
|
<span style="color:blue;">this</span>.FileListBox.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(26, 90);
|
|
<span style="color:blue;">this</span>.FileListBox.Name = <span style="color:#a31515;">"FileListBox"</span>;
|
|
<span style="color:blue;">this</span>.FileListBox.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(167, 17);
|
|
<span style="color:blue;">this</span>.FileListBox.TabIndex = 2;
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// BrowseButton</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.BrowseButton.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(199, 84);
|
|
<span style="color:blue;">this</span>.BrowseButton.Name = <span style="color:#a31515;">"BrowseButton"</span>;
|
|
<span style="color:blue;">this</span>.BrowseButton.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(75, 23);
|
|
<span style="color:blue;">this</span>.BrowseButton.TabIndex = 3;
|
|
<span style="color:blue;">this</span>.BrowseButton.Text = <span style="color:#a31515;">"Browse..."</span>;
|
|
<span style="color:blue;">this</span>.BrowseButton.TextAlign = System.Drawing.<span style="color:#2b91af;">ContentAlignment</span>.MiddleLeft;
|
|
<span style="color:blue;">this</span>.BrowseButton.UseVisualStyleBackColor = <span style="color:blue;">true</span>;
|
|
<span style="color:blue;">this</span>.BrowseButton.Click += <span style="color:blue;">new</span> System.<span style="color:#2b91af;">EventHandler</span>(BrowseButton_Click);
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// OpenFileDialog1</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.OpenFileDialog1.FileName = <span style="color:#a31515;">"OpenFileDialog1"</span>;
|
|
<span style="color:blue;">this</span>.OpenFileDialog1.Multiselect = <span style="color:blue;">true</span>;
|
|
<span style="color:blue;">this</span>.OpenFileDialog1.Title = <span style="color:#a31515;">"Select a file"</span>;
|
|
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// RevisionButton</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.RevisionButton.Location = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Point</span>(26, 137);
|
|
<span style="color:blue;">this</span>.RevisionButton.Name = <span style="color:#a31515;">"RevisionButton"</span>;
|
|
<span style="color:blue;">this</span>.RevisionButton.Size = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(88, 23);
|
|
<span style="color:blue;">this</span>.RevisionButton.TabIndex = 4;
|
|
<span style="color:blue;">this</span>.RevisionButton.Text = <span style="color:#a31515;">"Get revisions"</span>;
|
|
<span style="color:blue;">this</span>.RevisionButton.TextAlign = System.Drawing.<span style="color:#2b91af;">ContentAlignment</span>.MiddleLeft;
|
|
<span style="color:blue;">this</span>.RevisionButton.UseVisualStyleBackColor = <span style="color:blue;">true</span>;
|
|
<span style="color:blue;">this</span>.RevisionButton.Click += <span style="color:blue;">new</span> System.<span style="color:#2b91af;">EventHandler</span>(RevisionButton_Click);
|
|
<span style="color:green;">// </span>
|
|
<span style="color:green;">// Form1</span>
|
|
<span style="color:green;">// </span>
|
|
<span style="color:blue;">this</span>.AutoScaleDimensions = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">SizeF</span>(6F, 13F);
|
|
<span style="color:blue;">this</span>.AutoScaleMode = System.Windows.Forms.<span style="color:#2b91af;">AutoScaleMode</span>.Font;
|
|
<span style="color:blue;">this</span>.ClientSize = <span style="color:blue;">new</span> System.Drawing.<span style="color:#2b91af;">Size</span>(284, 187);
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.RevisionButton);
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.BrowseButton);
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.FileListBox);
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.VaultsComboBox);
|
|
<span style="color:blue;">this</span>.Controls.Add(<span style="color:blue;">this</span>.VaultsLabel);
|
|
<span style="color:blue;">this</span>.Name = <span style="color:#a31515;">"Form1"</span>;
|
|
<span style="color:blue;">this</span>.Text = <span style="color:#a31515;">"Get revision names"</span>;
|
|
<span style="color:blue;">this</span>.Load += <span style="color:blue;">new</span> System.<span style="color:#2b91af;">EventHandler</span>(Form1_Load);
|
|
<span style="color:blue;">this</span>.ResumeLayout(<span style="color:blue;">false</span>);
|
|
<span style="color:blue;">this</span>.PerformLayout();
|
|
|
|
}
|
|
|
|
<span style="color:blue;"> #endregion</span>
|
|
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">Label</span> VaultsLabel;
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">ComboBox</span> VaultsComboBox;
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">ListBox</span> FileListBox;
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span> BrowseButton;
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">Button</span> RevisionButton;
|
|
<span style="color:blue;">private</span> System.Windows.Forms.<span style="color:#2b91af;">OpenFileDialog</span> OpenFileDialog1;
|
|
}
|
|
}</pre>
|
|
</div>
|
|
<div align="center">
|
|
<pre style="font-family: Calibri; font-size: 13; color: #008000; background: white"><a href="#Top">Back to top</a></pre>
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|