예제 #1
0
 public static bool IsType2(this AnyObject i, Feature.FeatureType type)
 {
     if (i.GetType2() == type)
     {
         return(true);
     }
     return(false);
 }
예제 #2
0
        public static string GetPartNumber(this Document document)
        {
            Feature.FeatureType type = document.GetType2();

            switch (type)
            {
            case Feature.FeatureType.Part:
                Part partBase = document.GetPartBase();
                return(partBase.GetName());

            case Feature.FeatureType.Product:
                return(document.GetProduct().GetPartNumber());
            }
            return(document.GetName());
        }
예제 #3
0
 public DocumentNode(Document doc, Product product, DocumentNode parent)
     : base()
 {
     document     = doc;
     this.product = (Product)product;
     this.parent  = parent;
     type         = doc.GetType2();
     doc_name     = doc.GetName();
     product_name = GetProductName();
     if (parent == null)
     {
         level = 0;
     }
     else
     {
         level = parent.level + 1;
     }
 }
예제 #4
0
        public static string GetDescription(Document document)
        {
            Feature.FeatureType type = document.GetType2();
            string decsription;

            switch (type)
            {
            case Feature.FeatureType.Part:
                Part partBase = document.GetPartBase();
                var  prop     = partBase.Parameters;
                decsription = prop.Item(@"Definition").ValueAsString();
                return(decsription);

            case Feature.FeatureType.Product:
                return(document.GetProduct().GetDefinition());
            }
            return(null);
        }