public static ISwDmObject FromDispatch(object disp, ISwDmDocument doc)
        {
            switch (disp)
            {
            case ISwDMConfiguration conf:
                switch (doc)
                {
                case SwDmAssembly assm:
                    return(new SwDmAssemblyConfiguration(conf, assm));

                case SwDmDocument3D doc3D:
                    return(new SwDmConfiguration(conf, doc3D));

                default:
                    throw new NotSupportedException("This document type is not supported for configuration");
                }

            case ISwDMCutListItem cutList:
                return(new SwDmCutListItem((ISwDMCutListItem2)cutList, (SwDmDocument)doc));

            case ISwDMComponent comp:
                return(new SwDmComponent((SwDmAssembly)doc, comp));

            case ISwDMSheet sheet:
                return(new SwDmSheet(sheet, (SwDmDrawing)doc));

            case ISwDMView view:
                return(new SwDmDrawingView(view, (SwDmDrawing)doc));

            default:
                return(new SwDmObject(disp));
            }
        }
Exemple #2
0
 internal DocumentWrapper(ISwDmApplication app, ISwDmDocument model)
 {
     m_App        = app;
     Document     = model;
     m_IsDisposed = false;
 }
Exemple #3
0
 public SwDmDocumentCustomProperty(ISwDmDocument doc, string name, bool isCreated) : base(name, isCreated)
 {
     m_Doc = doc;
 }
 public static TObj FromDispatch <TObj>(object disp, ISwDmDocument doc)
     where TObj : ISwDmObject
 {
     return((TObj)FromDispatch(disp, doc));
 }
Exemple #5
0
 internal SwDmDocumentCustomPropertiesCollection(ISwDmDocument doc)
 {
     m_Doc = doc;
 }