-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdateProbeParameter.cs
More file actions
149 lines (129 loc) · 4.58 KB
/
UpdateProbeParameter.cs
File metadata and controls
149 lines (129 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
using EPDM.Interop.epdm;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace SWPDM_Update_Card_Data
{
public class UpdateProbeParameter : IEdmAddIn5
{
#region Private Variables
private const int CommandID = 1;
private const string AddInName = "Update Card Data";
private const int AddInVersion = 1;
private EdmCmd mPoCmd;
private Dictionary<int, string> FilePathList;
private IEdmVault5 mVault5;
private int mParentFolderID;
#endregion
/// <summary>
///
/// </summary>
/// <param name="poInfo"></param>
/// <param name="poVault"></param>
/// <param name="poCmdMgr"></param>
public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
{
poInfo.mbsAddInName = AddInName;
poInfo.mbsCompany = "No Company name";
poInfo.mbsDescription = "Update Card Data for MEM Probes only.";
poInfo.mlAddInVersion = AddInVersion;
poInfo.mlRequiredVersionMajor = 6;
poInfo.mlRequiredVersionMinor = 4;
// Register a menu command
poCmdMgr.AddCmd(CommandID, AddInName, (int)EdmMenuFlags.EdmMenu_Nothing);
// Get current Vault
mVault5 = poVault;
}
/// <summary>
///
/// </summary>
/// <param name="poCmd"></param>
/// <param name="ppoData"></param>
public void OnCmd(ref EdmCmd poCmd, ref EdmCmdData[] ppoData)
{
FilePathList = new Dictionary<int, string>();
if (poCmd.meCmdType == EdmCmdType.EdmCmd_Menu)
{
if (poCmd.mlCmdID == 1)
{
mPoCmd = poCmd;
// Get ID and full path of the selected files.
mParentFolderID = ppoData[0].mlObjectID3;
foreach (EdmCmdData p in ppoData)
{
FilePathList.Add(p.mlObjectID1, p.mbsStrData1);
}
WindowForm myform = new WindowForm(this);
myform.Show();
}
}
}
/// <summary>
///
/// </summary>
public EdmCmd GetPoCMD
{ get { return mPoCmd; } }
/// <summary>
///
/// </summary>
public Dictionary<int, string> GetPpoData
{ get { return FilePathList; } }
/// <summary>
///
/// </summary>
public IEdmVault5 GetVault5
{ get { return mVault5; } }
/// <summary>
///
/// </summary>
public int GetParentFolderID
{ get { return mParentFolderID; } }
/// <summary>
///
/// </summary>
public int GetParentWnd
{ get { return mPoCmd.mlParentWnd; } }
}
/// <summary>
/// This class is used for undoing checkout file related to the error that updating card data process.
/// Input: IEdmVault5 CurrentVault, int fileID, int ParentFolderID, int ParentHandleID
/// Output: No
/// </summary>
public class UndoCheckoutFiles
{
#region Private Variables
private int m_fileID;
private int m_ParentHandleID;
private int m_ParentFolderID;
private IEdmVault5 m_CurrentVault;
private IEdmFile5 file;
#endregion
/// <summary>
/// A constructor is used for passing Input variables value
/// </summary>
/// <param name="CurrentVault"></param>
/// <param name="fileID"></param>
/// <param name="ParentFolderID"></param>
/// <param name="ParentHandleID"></param>
public UndoCheckoutFiles(IEdmVault5 CurrentVault, int fileID, int ParentFolderID, int ParentHandleID)
{
m_fileID = fileID;
m_ParentHandleID = ParentHandleID;
m_CurrentVault = CurrentVault;
m_ParentFolderID = ParentFolderID;
}
/// <summary>
/// This method is used to perform "Undo Check Out" files.
/// Input: No
/// Output: No
/// </summary>
public void Undo()
{
file = (IEdmFile5)m_CurrentVault.GetObject(EdmObjectType.EdmObject_File, m_fileID);
IEdmEnumeratorVariable5 vars = (IEdmEnumeratorVariable5)file.GetEnumeratorVariable(file.GetLocalPath(m_ParentFolderID));
IEdmEnumeratorVariable8 vars8 = (IEdmEnumeratorVariable8)vars;
vars8.CloseFile(true);
file.UndoLockFile(m_ParentHandleID);
}
}
}