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


C# IController.GetComponent方法代码示例

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


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

示例1: Copy


//.........这里部分代码省略.........
                    if (!isRoot) // non root dynamic, use app code class and ref link type to find it later 
                    {
                        String appCode = dynamic.Attributes[ConfigFileConstants.appCode].Value;
                        appCodeObjects.Add(linkTypeValue, appCode);

                        String refLinkType = dynamic.Attributes[ConfigFileConstants.refLinkType].Value;
                        refLinkTypes.Add(linkTypeValue, refLinkType);
                    }
                }

                XmlNode bridgeDynamic = link.SelectSingleNode("BridgeDynamic");
                if (bridgeDynamic != null)
                {
                    String linkTypeValue = link.Attributes[ConfigFileConstants.Type].Value;
                    String value = bridgeDynamic.Attributes[ConfigFileConstants.component].Value;
                    dynamicBridge.Add(linkTypeValue, value);
                }

                schemaReader = this.readingController.GetXSD(schemaFileName);
                schema = XmlSchema.Read(schemaReader, null);
                schemaReader.Close();
                schemaSet = new XmlSchemaSet();
                schemaSet.Add(schema);
                schemaSet.Compile();

                foreach (XmlSchema compiledSchema in schemaSet.Schemas())
                {
                    foundRootAndLT = false;
                    foreach (XmlSchemaElement element in compiledSchema.Elements.Values)
                    {
                        foundRootAndLT |= FindRootAndLinkType(element);
                    }
                    if (!foundRootAndLT)
                    {
                        MessageBox.Show("Root and link type not found for schema: " + schemaFileName);
                    }
                }
            }

            // Schemas processed, start copying!
            if (!parameters.UpdateAfterCopy)
            {
                writingController.TurnViewUpdateOff();
            }

            readingController.EnableLoadingCache();

            helper = new BulkHelper();
            helper.BeginBulkOperations(writingController.Configuration);
            XPathNavigator self = readingController.GetComponent(parameters.StartingRootID).CreateNavigator().SelectSingleNode("Components/Component");
            
            copiedRootName = parameters.NewName;

            // ensure no invalid filename characters
            for (int i = 0; i < copiedRootName.Length; i++)
            {
                char c = copiedRootName[i];
                for (int j = 0; j < Path.GetInvalidFileNameChars().Length; j++)
                {
                    if (c == Path.GetInvalidFileNameChars()[j])
                    {
                        MessageBox.Show("Invalid character in new name: " + c);
                        newName = "-1";
                        return -1;
                    }
                }
            }

            newName = copiedRootName;

            String componentType = self.GetAttribute(XmlSchemaConstants.Display.Component.Type, String.Empty);
            String description = self.GetAttribute(XmlSchemaConstants.Display.Component.Description, String.Empty);

            if (!schemaRootToLinkType.ContainsKey(componentType))
            {
                schemaRootToLinkType.Add(componentType, new List<String>());
            }

            if (parameters.StartingLinkType != null && !schemaRootToLinkType[componentType].Contains(parameters.StartingLinkType))
            {
                schemaRootToLinkType[componentType].Add(parameters.StartingLinkType);
            }

            String copyID = helper.CreateRootComponent(componentType, copiedRootName, description);

            CopyIDType(parameters.StartingRootID, copyID, componentType, null, null);

            readingController.DisableLoadingCache();

            int rootID = helper.EndBulkOperations(parameters.ClearWriteDB, parameters.ShowDialog, "Copying " + componentType, "Copying...");

            if (!parameters.UpdateAfterCopy)
            {
                writingController.TurnViewUpdateOn(false, false);
            }

            helper = null;

            return rootID;
        }
开发者ID:wshanshan,项目名称:DDD,代码行数:101,代码来源:AMEManager_Copy.cs


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