Class MachiningToolHouse
Tool House.
public class MachiningToolHouse : Dictionary<int, IMachiningTool>, IDictionary<int, IMachiningTool>, ICollection<KeyValuePair<int, IMachiningTool>>, IReadOnlyDictionary<int, IMachiningTool>, IReadOnlyCollection<KeyValuePair<int, IMachiningTool>>, IEnumerable<KeyValuePair<int, IMachiningTool>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable, IMakeXmlSource
- Inheritance
-
MachiningToolHouse
- Implements
- Inherited Members
- Extension Methods
Constructors
MachiningToolHouse()
Ctor.
public MachiningToolHouse()
MachiningToolHouse(XElement, string, string)
Ctor.
public MachiningToolHouse(XElement src, string baseDirectory, string relFile)
Parameters
src
XElementXML
baseDirectory
stringBase directory path for resolving relative paths
relFile
stringRelative file path
Properties
XName
Name for XML IO.
public static string XName { get; }
Property Value
Methods
CreateStickMillingTool()
Create a new Tool for UI. The tool ID is 1 if no tool existed; otherwise, the tool ID is the max tool ID plus 1.
public KeyValuePair<int, MillingTool> CreateStickMillingTool()
Returns
- KeyValuePair<int, MillingTool>
the generated tool id and the generated tool
MakeXmlSource(string, string, bool)
Creates an XML representation of the object. This method may also generate additional resources such as related files.
public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)
Parameters
baseDirectory
stringThe base directory for resolving relative paths
relFile
stringThe relative file path for the XML source
exhibitionOnly
boolif true, the extended file creation is suppressed.
Returns
- XElement
An XML element representing the object's state
Remarks
For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied.
The baseDirectory
is typically the folder at the nearest configuration file folder.
Since the folder can be moving with the configuration file.
SetToolId(int, IMachiningTool)
the function Typically used if the tool has already in the tool house.
public void SetToolId(int toolId, IMachiningTool millingTool)
Parameters
toolId
intmillingTool
IMachiningTool
Exceptions
- ArgumentException
throw if
toolId
has already existed.