本文整理汇总了C#中ModelDoc2.get_CustomInfo2方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.get_CustomInfo2方法的具体用法?C# ModelDoc2.get_CustomInfo2怎么用?C# ModelDoc2.get_CustomInfo2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelDoc2
的用法示例。
在下文中一共展示了ModelDoc2.get_CustomInfo2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getPriceForComponent
private void getPriceForComponent(ModelDoc2 model, bool ParentCalcStruct, Action<decimal> nextPrice, Action<Exception, string> nextError)
{
string currentConfig = model.IGetActiveConfiguration().Name;
if (currentConfig.ToLower().Contains("по умолчани") || currentConfig.ToLower().Contains("default"))
currentConfig = string.Empty;
string isProduct = model.GetCustomInfoValue(currentConfig, "IsProduct");
if (string.IsNullOrEmpty(isProduct))
{
isProduct = model.GetCustomInfoValue(string.Empty, "IsProduct");
if (string.IsNullOrEmpty(isProduct))
isProduct = "No";
}
if (isProduct == "Yes")
{
//изделие
//Проверка существования артикула для компонента в случает отсутствия, расчет цены на сам компонент не производится
string articul = model.GetCustomInfoValue(string.Empty, "Articul");
if (string.IsNullOrEmpty(articul))
articul = model.GetCustomInfoValue(currentConfig, "Articul");
if (!string.IsNullOrEmpty(articul))
{
try
{
nextPrice(сalculatePriceForModel(model));
}
catch (Exception e)
{
if (checkError(e))
nextError(e, Path.GetFileName(model.GetPathName()));
}
}
string s = model.GetPathName();
AssemblyDoc model_assembly = model as AssemblyDoc;
if (model_assembly != null)
{
bool calcStruct = true;
if (!string.IsNullOrEmpty(articul))
{
string calcStructStr = model.get_CustomInfo2(string.Empty, "CalcStruct");
if (calcStructStr.ToLower() == "no")
calcStruct = false;
}
var components = (object[])((AssemblyDoc)model).GetComponents(true);
foreach (var component in components)
{
var comp = (Component2)component;
ModelDoc2 _model = comp.IGetModelDoc();
if (_model != null)
{
getPriceForComponent(_model, calcStruct, nextPrice, nextError);
}
}
}
}
else
{
//не изделие
string articul = model.GetCustomInfoValue(string.Empty, "Articul");
if (string.IsNullOrEmpty(articul))
articul = model.GetCustomInfoValue(currentConfig, "Articul");
string isIndependentStr = model.get_CustomInfo2(string.Empty, "IsIndependent");
bool isIndependent = true;
if (string.IsNullOrEmpty(isIndependentStr) || isIndependentStr.ToLower() == "no")
isIndependent = false;
if (isIndependent)
{
bool calcStruct = true;
if (!string.IsNullOrEmpty(articul))
{
//независимый и с артикулом
try
{
nextPrice(сalculatePriceForModel(model));
}
catch (Exception e)
{
if (checkError(e))
nextError(e, Path.GetFileName(model.GetPathName()));
}
string calcStructStr = model.get_CustomInfo2(string.Empty, "CalcStruct");
if (calcStructStr.ToLower() == "no")
calcStruct = false;
}
if (calcStruct)
{
AssemblyDoc model_assembly = model as AssemblyDoc;
if (model_assembly != null)
{
//.........这里部分代码省略.........