当前位置: 首页>>代码示例>>C#>>正文


C# ModelDoc2.GetCustomInfoNames2方法代码示例

本文整理汇总了C#中ModelDoc2.GetCustomInfoNames2方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.GetCustomInfoNames2方法的具体用法?C# ModelDoc2.GetCustomInfoNames2怎么用?C# ModelDoc2.GetCustomInfoNames2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelDoc2的用法示例。


在下文中一共展示了ModelDoc2.GetCustomInfoNames2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: sendAttributes

        private void sendAttributes(ModelDoc2 model, Collection<AttributeInfo> componentsAttributesCollection, string path, string orderNumber, int fileType, string filePath, string fileName, string configuration)
        {
            string[] attributeNames = model.GetCustomInfoNames2(configuration);

            foreach (string attributeName in attributeNames)
            {
                string attributeValue = model.GetCustomInfoValue(configuration, attributeName);

                //Проверка записано ли свойство такого файла
                AttributeInfo attributeInfo = new AttributeInfo { Path = path, AttributeName = attributeName, AttributeValue = attributeValue };

                KeyValuePair<string, string> componentAttribute = new KeyValuePair<string, string>(path, attributeName);
                if (!componentsAttributesCollection.Contains(attributeInfo))
                {
                    componentsAttributesCollection.Add(attributeInfo);

                    //конвертация булевых атрибутов в формат БД
                    if (model.GetCustomInfoType3(configuration, attributeName) == 11)
                        attributeValue = (attributeValue == "Yes") ? "T" : "F";

                    //пропуск свойств без значений
                    if (!string.IsNullOrEmpty(attributeValue))

                        using (OracleCommand cmd = new OracleCommand())
                        {
                            cmd.Connection = Connection;
                            cmd.CommandText = "GENERAL.SWR_FILEDATA_ADD_SW";
                            cmd.CommandType = CommandType.StoredProcedure;
                            cmd.Parameters.Add("P_NUMAGREE", OracleDbType.Varchar2).Value = orderNumber;
                            cmd.Parameters.Add("P_CODEFILETYPE", OracleDbType.Int32).Value = fileType;
                            cmd.Parameters.Add("P_FILEPATH", OracleDbType.Varchar2).Value = filePath;
                            cmd.Parameters.Add("P_FILENAME", OracleDbType.Varchar2).Value = fileName;
                            cmd.Parameters.Add("P_IDFILEATTRIBUTE", OracleDbType.Varchar2).Value = attributeName;
                            cmd.Parameters.Add("P_ATTRIBUTEVALUE", OracleDbType.Varchar2).Value = attributeValue;
                            cmd.Parameters.Add("P_COMMIT", OracleDbType.Char).Value = 'T';
                            cmd.ExecuteNonQuery();
                        }

                }
                else
                {
                }
            }
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:44,代码来源:Repository.cs

示例2: SetColorProperty

        private bool SetColorProperty(ModelDoc2 inModel, string colorProp, OleDbConnection oleDb, string colorName,
            string column, OleDbConnection oleDbDecorDef)
        {
            bool isColorChanged = false;
            if (colorProp != "")
            {
                var names = (string[])inModel.GetCustomInfoNames2("");
                if (names.Contains(colorProp))
                {
                    isColorChanged = _mSwAddin.SetModelProperty(inModel, colorProp, "",
                                                                swCustomInfoType_e.swCustomInfoText,
                                                                colorName, true);
                    if (oleDbDecorDef != null)
                    {
                        string fullDecorName = string.Empty;
                        string[] restrictionValues = new string[3] { null, null, "decornames" };
                        DataTable schemaInformation = oleDbDecorDef.GetSchema("Tables", restrictionValues);
                        if (schemaInformation.Rows.Count == 0)
                            fullDecorName = string.Empty;
                        else
                        {
                            string selectStr = @"select * from decornames where FILEJPG = """ +
                                               colorName + @"""";
                            var cmDecorDef = new OleDbCommand(selectStr, oleDbDecorDef);
                            var rdDecorDef = cmDecorDef.ExecuteReader();
                            while (rdDecorDef.Read())
                            {
                                fullDecorName = rdDecorDef["DecorName"].ToString();
                            }
                            schemaInformation.Dispose();
                            cmDecorDef.Dispose();
                            rdDecorDef.Close();
                        }
                        int index;
                        if (int.TryParse(colorProp.Substring(colorProp.Length - 1, 1), out index))
                            _mSwAddin.SetModelProperty(inModel, "ColorName" + index.ToString(), "",
                                                       swCustomInfoType_e.swCustomInfoText,
                                                       fullDecorName, true);
                    }

                }
            }
            else
            {
                if (column == "Part Color Priority")
                    MessageBox.Show(@"В файле " + Environment.NewLine + oleDb.DataSource + Environment.NewLine +
                                @" в столбце 'Part Color Priority', Element: " +
                                Path.GetFileNameWithoutExtension(
                                    _mSwAddin.GetModelNameWithoutSuffix(inModel.GetPathName()))
                                + @" ошибка!", _mSwAddin.MyTitle, MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                else
                    MessageBox.Show(@"В файле " + Environment.NewLine + oleDb.DataSource + Environment.NewLine +
                                @" в столбце '" + column + @"' ошибка!", _mSwAddin.MyTitle, MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
            return isColorChanged;
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:58,代码来源:frmSetParameters.cs

示例3: CheckPropForArticul

 private bool CheckPropForArticul(ModelDoc2 model)
 {
     bool ret = false;
     var commonPropNames = (string[])model.GetCustomInfoNames();
     foreach (var commonPropName in commonPropNames)
     {
         if (commonPropName.ToLower() == "articul" && model.GetCustomInfoValue("", commonPropName) != "")
             ret = true;
     }
     if (model.GetConfigurationCount() >= 1)
     {
         string confName = model.IGetActiveConfiguration().Name;
         var confPropNames = (string[])model.GetCustomInfoNames2(confName);
         foreach (var confPropName in confPropNames)
         {
             if (confPropName.ToLower() == "articul" && model.GetCustomInfoValue(confName, confPropName) != "")
                 ret = true;
         }
     }
     return ret;
 }
开发者ID:digger1985,项目名称:MyCode,代码行数:21,代码来源:SwAddin.cs


注:本文中的ModelDoc2.GetCustomInfoNames2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。