Class Project
A Project is the database CADability works on. A Project is serializable and contains
one or more Models (which contain GeoObjects) lists of attributes, views and UserData.
A Project is usually saved in a file.
Inheritance
System.Object
Project
Implements
System.Runtime.Serialization.ISerializable
System.Collections.IEnumerable
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
[Serializable]
[JsonVersion(1)]
public class Project : IShowPropertyImpl, IShowProperty, IPropertyEntry, ISerializable, IAttributeListContainer, ICommandHandler, IEnumerable, IDeserializationCallback, IJsonSerialize, IJsonSerializeDone
Constructors
|
Improve this Doc
View Source
Project()
Creates an empty Project. The empty project contains clones of the globally defined
attributes and attribute lists (like colors, layers etc.)
Declaration
|
Improve this Doc
View Source
Project(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected Project(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
SerializationInfo
|
| System.Runtime.Serialization.StreamingContext |
context |
StreamingContext
|
Fields
|
Improve this Doc
View Source
Constructor
Declaration
public static Project.ConstructionDelegate Constructor
Field Value
|
Improve this Doc
View Source
UserData
The UserData object can take any kind of data. If the data objects
are serializable i.e. implement System.Runtime.Serialization.ISerializable they are serialized
together with the project. If they implement the IPropertyEntry interface
they are displayed and can be modified on the project tab page of the control center.
Declaration
Field Value
Properties
|
Improve this Doc
View Source
AdditionalSymbols
Declaration
public GeoObjectList AdditionalSymbols { get; }
Property Value
|
Improve this Doc
View Source
AnimatedViews
Declaration
public List<AnimatedView> AnimatedViews { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<AnimatedView> |
|
|
Improve this Doc
View Source
ColorList
Declaration
public ColorList ColorList { get; }
Property Value
|
Improve this Doc
View Source
DeferRefresh
Declaration
public bool DeferRefresh { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
DimensionStyleList
Declaration
public DimensionStyleList DimensionStyleList { get; }
Property Value
|
Improve this Doc
View Source
EntryType
Declaration
public override ShowPropertyEntryType EntryType { get; }
Property Value
Overrides
|
Improve this Doc
View Source
FileName
The name of the file in which this project ist stored. May be null.
Declaration
public string FileName { get; set; }
Property Value
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
FilterList
Declaration
public FilterList FilterList { get; }
Property Value
|
Improve this Doc
View Source
GdiViews
Gets a list of all defined GDI2DViews in this project.
Declaration
public List<GDI2DView> GdiViews { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<GDI2DView> |
|
|
Improve this Doc
View Source
HatchStyleList
Declaration
public HatchStyleList HatchStyleList { get; }
Property Value
|
Improve this Doc
View Source
IsModified
Gets or sets the modified flag
Declaration
public bool IsModified { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
LayerList
Declaration
public LayerList LayerList { get; }
Property Value
|
Improve this Doc
View Source
LayoutCount
Gets the number of layouts in this project
Declaration
public int LayoutCount { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
LinePatternList
Declaration
public LinePatternList LinePatternList { get; }
Property Value
|
Improve this Doc
View Source
LineWidthList
Declaration
public LineWidthList LineWidthList { get; }
Property Value
|
Improve this Doc
View Source
StyleList
Declaration
public StyleList StyleList { get; }
Property Value
|
Improve this Doc
View Source
SubEntries
Overrides SubEntries,
returns the subentries in this property view.
Declaration
public override IShowProperty[] SubEntries { get; }
Property Value
Overrides
|
Improve this Doc
View Source
SubEntriesCount
Overrides SubEntriesCount,
returns the number of subentries in this property view.
Declaration
public override int SubEntriesCount { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Overrides
|
Improve this Doc
View Source
SymbolList
Declaration
public GeoObjectList SymbolList { get; }
Property Value
|
Improve this Doc
View Source
Undo
Declaration
public UndoRedoSystem Undo { get; }
Property Value
Methods
|
Improve this Doc
View Source
Add(Object)
Declaration
public void Add(object toAdd)
Parameters
| Type |
Name |
Description |
| System.Object |
toAdd |
|
|
Improve this Doc
View Source
AddLayout(Layout)
Adds the specified Layout to the project.
Declaration
public int AddLayout(Layout l)
Parameters
| Type |
Name |
Description |
| Layout |
l |
the layout to add
|
Returns
| Type |
Description |
| System.Int32 |
the index of the new layout
|
|
Improve this Doc
View Source
AddModel(Model)
Adds the given Model to the project. The attributes of the GeoObjects
in this model are merged into the attribute lists of this project. Fires a
ModelsChangedEvent.
Declaration
public void AddModel(Model ToAdd)
Parameters
| Type |
Name |
Description |
| Model |
ToAdd |
Model to add
|
|
Improve this Doc
View Source
AddProjectedModel(String, Model, Projection)
Declaration
public int AddProjectedModel(string name, Model model, Projection projection)
Parameters
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Construct()
Declaration
public static Project Construct()
Returns
|
Improve this Doc
View Source
CreateSimpleProject()
Declaration
public static Project CreateSimpleProject()
Returns
|
Improve this Doc
View Source
DeserializeObject(String)
Declaration
public static object DeserializeObject(string fileName)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
|
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
Export(String, String)
Export the project in one of the following formats:
dxf, dwg, iges, step, vrml, stl, sat and xt (sat and xt must be licensed seperately)
Declaration
public bool Export(string fileName, string format)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
Path and filename for the generated output file
|
| System.String |
format |
Format, one of the strings: dxf, dwg, iges, step, vrml, stl, sat, xt
|
Returns
| Type |
Description |
| System.Boolean |
true on success
|
|
Improve this Doc
View Source
ExportToSTL(String)
Declaration
public void ExportToSTL(string fileName)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
|
|
Improve this Doc
View Source
ExportToWebGl(String)
Declaration
public void ExportToWebGl(string fileName)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
|
|
Improve this Doc
View Source
Finalize()
Declaration
protected void Finalize()
|
Improve this Doc
View Source
FindModel(String)
Returns the Model with the given name, Returns null if there is no
such model in the project.
Declaration
public Model FindModel(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
name of the required model
|
Returns
| Type |
Description |
| Model |
the model found or null
|
|
Improve this Doc
View Source
GetActiveModel()
Returns the active Model of this project.
Declaration
public Model GetActiveModel()
Returns
| Type |
Description |
| Model |
the active model
|
|
Improve this Doc
View Source
GetDefaultLayout()
Gets a default Layout for this project. If there is no layout
in this project a standard Layout is created and adde to the project
Declaration
public Layout GetDefaultLayout()
Returns
| Type |
Description |
| Layout |
a default layout
|
|
Improve this Doc
View Source
GetLayout(Int32)
Returns the Layout with the given index.
Declaration
public Layout GetLayout(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
index of required layout
|
Returns
| Type |
Description |
| Layout |
layout
|
|
Improve this Doc
View Source
GetModel(Int32)
Returns the Model with the given index.
Declaration
public Model GetModel(int Index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
Index |
Index of the required model
|
Returns
| Type |
Description |
| Model |
the model
|
|
Improve this Doc
View Source
GetModelCount()
Returns the number of models in this project.
Declaration
public int GetModelCount()
Returns
| Type |
Description |
| System.Int32 |
the number of models
|
|
Improve this Doc
View Source
GetNamedValue(String)
Declaration
public object GetNamedValue(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.Object |
|
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
The System.Runtime.Serialization.SerializationInfo to populate with data.
|
| System.Runtime.Serialization.StreamingContext |
context |
The destination (System.Runtime.Serialization.StreamingContext) for this serialization.
|
|
Improve this Doc
View Source
GetStandardModelView()
Declaration
public ModelView GetStandardModelView()
Returns
|
Improve this Doc
View Source
GetStandardModelView(Model)
Liefert die Standard Darstellung des gegebenen Modells.
Wenn keine definiert ist, die Draufsicht.
Declaration
public ModelView GetStandardModelView(Model m)
Parameters
| Type |
Name |
Description |
| Model |
m |
|
Returns
|
Improve this Doc
View Source
GetStandardModelView(Model, Int32)
Declaration
public ModelView GetStandardModelView(Model m, int Index)
Parameters
| Type |
Name |
Description |
| Model |
m |
|
| System.Int32 |
Index |
|
Returns
|
Improve this Doc
View Source
ReadFromFile(String)
Creates a new project reading the data from the file with the given name.
If FileName is null, an OpenFileDialog will be displayed.
Declaration
public static Project ReadFromFile(string FileName)
Parameters
| Type |
Name |
Description |
| System.String |
FileName |
The name of the file
|
Returns
| Type |
Description |
| Project |
The newly created project or null if failed to create a project
|
|
Improve this Doc
View Source
ReadFromFile(String, String)
Declaration
public static Project ReadFromFile(string FileName, string Format)
Parameters
| Type |
Name |
Description |
| System.String |
FileName |
|
| System.String |
Format |
|
Returns
|
Improve this Doc
View Source
ReadFromFile(String, String, Boolean, Boolean)
Declaration
public static Project ReadFromFile(string FileName, string Format, bool useProgress, bool makeCompounds = true)
Parameters
| Type |
Name |
Description |
| System.String |
FileName |
|
| System.String |
Format |
|
| System.Boolean |
useProgress |
|
| System.Boolean |
makeCompounds |
|
Returns
|
Improve this Doc
View Source
ReadFromStream(Stream)
Creates a new project reading the data from the given stream.
Declaration
public static Project ReadFromStream(Stream stream)
Parameters
| Type |
Name |
Description |
| System.IO.Stream |
stream |
Stream to read from
|
Returns
|
Improve this Doc
View Source
ReadFromXML(String)
Read the provided file with a sop formatter into a new Project. The file must have been written with WriteToXML(String).
Declaration
public static Project ReadFromXML(string FileName)
Parameters
| Type |
Name |
Description |
| System.String |
FileName |
|
Returns
|
Improve this Doc
View Source
RemoveLayout(Layout)
Removes the given Layout from the project. There must always be at least
one layout, so you cannot remove the last layout.
Declaration
public bool RemoveLayout(Layout toRemove)
Parameters
| Type |
Name |
Description |
| Layout |
toRemove |
layout to remove
|
Returns
| Type |
Description |
| System.Boolean |
success: true, failure: false
|
|
Improve this Doc
View Source
RemoveModel(Model)
Declaration
public void RemoveModel(Model ToRemove)
Parameters
| Type |
Name |
Description |
| Model |
ToRemove |
model to remove
|
|
Improve this Doc
View Source
RemoveModel(Int32)
Declaration
public void RemoveModel(int Index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
Index |
Index of the model to remove
|
|
Improve this Doc
View Source
RemoveModelView(ModelView)
Removes the given ModelView from the project. There must always be at least
one modelview, so you cannot remove the last modelview.
Declaration
public bool RemoveModelView(ModelView toRemove)
Parameters
| Type |
Name |
Description |
| ModelView |
toRemove |
modelview to remove
|
Returns
| Type |
Description |
| System.Boolean |
success: true, failure: false
|
|
Improve this Doc
View Source
RemoveModelView(Int32)
Declaration
public void RemoveModelView(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
|
Improve this Doc
View Source
RenameLayout(Layout, String)
Declaration
public bool RenameLayout(Layout l, string newName)
Parameters
| Type |
Name |
Description |
| Layout |
l |
|
| System.String |
newName |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
SaveModified()
Überprüft, ob Daten verändert wurden (IsModified) und fordert ggf. den Anwender auf
das Projekt zu speichern.
Declaration
public virtual bool SaveModified()
Returns
| Type |
Description |
| System.Boolean |
false, wenn Abbrechen gedrückt wurde, true sonst (speichern oder verwerfen)
|
|
Improve this Doc
View Source
SerializeObject(ISerializable, String)
Declaration
public static void SerializeObject(ISerializable toSerialize, string fileName)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.ISerializable |
toSerialize |
|
| System.String |
fileName |
|
|
Improve this Doc
View Source
SetActiveModel(Int32)
Declaration
public void SetActiveModel(int Index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
Index |
|
|
Improve this Doc
View Source
SetDefaults(IGeoObject)
Declaration
public void SetDefaults(IGeoObject go)
Parameters
|
Improve this Doc
View Source
SetNamedValue(String, Object)
Declaration
public void SetNamedValue(string name, object val)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
| System.Object |
val |
|
|
Improve this Doc
View Source
WriteToFile(String)
Saves the project in a file with the given FileName.
If FileName is null, a SaveFileDialog is presented. Uses WriteToStream.
Declaration
public virtual bool WriteToFile(string FileName)
Parameters
| Type |
Name |
Description |
| System.String |
FileName |
The file name
|
Returns
| Type |
Description |
| System.Boolean |
true, if successful, false if the user pressed escape in the SaveFileDialog
|
|
Improve this Doc
View Source
WriteToFileWithoutUserData(String)
Declaration
public bool WriteToFileWithoutUserData(string fileName)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
WriteToStream(Stream)
Writes the project data to the given stream. Resets the IsModified flag
Declaration
public void WriteToStream(Stream stream)
Parameters
| Type |
Name |
Description |
| System.IO.Stream |
stream |
Stream where to write the data
|
|
Improve this Doc
View Source
WriteToXML(String)
Write the project to an XML file using a soap formatter with System.Runtime.Serialization. Use ReadFromXML(String) to read the file into a projact.
Declaration
public void WriteToXML(string FileName)
Parameters
| Type |
Name |
Description |
| System.String |
FileName |
Name of the file to write to.
|
Events
|
Improve this Doc
View Source
BindToTypeEvent
Event that gets called when a type cannot be resolved during the deserialization. Provide the Type
of an constructable object as a result.
Declaration
public static event Project.BindToTypeDelegate BindToTypeEvent
Event Type
|
Improve this Doc
View Source
ModelsChangedEvent
Declaration
public event Project.ModelsChangedDelegate ModelsChangedEvent
Event Type
|
Improve this Doc
View Source
RefreshEvent
Declaration
public event Project.RefreshDelegate RefreshEvent
Event Type
|
Improve this Doc
View Source
ViewChangedEvent
Declaration
public event Project.ViewChangedDelegate ViewChangedEvent
Event Type
Explicit Interface Implementations
|
Improve this Doc
View Source
IAttributeListContainer.Add(String, IAttributeList)
Declaration
void IAttributeListContainer.Add(string KeyName, IAttributeList ToAdd)
Parameters
|
Improve this Doc
View Source
IAttributeListContainer.AttributeChanged(IAttributeList, INamedAttribute, ReversibleChange)
Declaration
void IAttributeListContainer.AttributeChanged(IAttributeList list, INamedAttribute attribute, ReversibleChange change)
Parameters
|
Improve this Doc
View Source
IAttributeListContainer.GetList(String)
Declaration
IAttributeList IAttributeListContainer.GetList(string keyName)
Parameters
| Type |
Name |
Description |
| System.String |
keyName |
|
Returns
|
Improve this Doc
View Source
IAttributeListContainer.List(Int32)
Declaration
IAttributeList IAttributeListContainer.List(int keyIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
keyIndex |
|
Returns
|
Improve this Doc
View Source
IAttributeListContainer.ListCount
Declaration
int IAttributeListContainer.ListCount { get; }
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
IAttributeListContainer.ListKeyName(Int32)
Declaration
string IAttributeListContainer.ListKeyName(int keyIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
keyIndex |
|
Returns
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
IAttributeListContainer.Remove(String)
Declaration
void IAttributeListContainer.Remove(string KeyName)
Parameters
| Type |
Name |
Description |
| System.String |
KeyName |
|
|
Improve this Doc
View Source
IAttributeListContainer.RemovingItem(IAttributeList, INamedAttribute, String)
Declaration
bool IAttributeListContainer.RemovingItem(IAttributeList list, INamedAttribute attribute, string resourceId)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IAttributeListContainer.UpdateList(IAttributeList)
Declaration
void IAttributeListContainer.UpdateList(IAttributeList list)
Parameters
|
Improve this Doc
View Source
IJsonSerialize.GetObjectData(IJsonWriteData)
Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
|
Improve this Doc
View Source
IJsonSerialize.SetObjectData(IJsonReadData)
Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
|
Improve this Doc
View Source
IJsonSerializeDone.SerializationDone()
Declaration
void IJsonSerializeDone.SerializationDone()
|
Improve this Doc
View Source
ICommandHandler.OnCommand(String)
Declaration
bool ICommandHandler.OnCommand(string MenuId)
Parameters
| Type |
Name |
Description |
| System.String |
MenuId |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
ICommandHandler.OnSelected(MenuWithHandler, Boolean)
Declaration
void ICommandHandler.OnSelected(MenuWithHandler selectedMenuItem, bool selected)
Parameters
| Type |
Name |
Description |
| MenuWithHandler |
selectedMenuItem |
|
| System.Boolean |
selected |
|
|
Improve this Doc
View Source
ICommandHandler.OnUpdateCommand(String, CommandState)
Declaration
bool ICommandHandler.OnUpdateCommand(string MenuId, CommandState CommandState)
Parameters
| Type |
Name |
Description |
| System.String |
MenuId |
|
| CommandState |
CommandState |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type |
Description |
| System.Collections.IEnumerator |
|
|
Improve this Doc
View Source
IDeserializationCallback.OnDeserialization(Object)
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
Implements
System.Runtime.Serialization.ISerializable
System.Collections.IEnumerable
System.Runtime.Serialization.IDeserializationCallback