public static bool IsType2(this AnyObject i, Feature.FeatureType type) { if (i.GetType2() == type) { return(true); } return(false); }
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()); }
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; } }
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); }