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


C# IController.GetComponentAndChildren方法代码示例

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


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

示例1: ThresholdDataSet

        public ThresholdDataSet(IController controller, Int32 configurationID)
        {
            organizationData = new ThresholdData("Organization");
            roleData = new ThresholdData("Role"); 
            billetData = new ThresholdData("Billet"); 
            informationProductData = new ThresholdData("Information Product"); 
            activityData = new ThresholdData("Activity");
            thresholdData = new ThresholdData[] { organizationData, roleData, billetData, informationProductData, activityData };
            
            XPathNodeIterator thresholds = controller.GetComponentAndChildren(configurationID, "Configuration", new ComponentOptions()).CreateNavigator().Select("/Components/Component/Component[@Type='Threshold']");
            if (thresholds.Count != 0)
            {
                ColorConverter cv = new ColorConverter();
                String baseString = "ComponentParameters/Parameter[@category='Threshold']/Parameter[@displayedName='";
                foreach (XPathNavigator threshold in thresholds)
                {
                    String name = threshold.GetAttribute("Name", "");
                    Double _lv = Double.Parse(threshold.SelectSingleNode(baseString + "LowerThresholdValue']/@value").ToString());
                    Double _mv1 = Double.Parse(threshold.SelectSingleNode(baseString + "MiddleThresholdValue1']/@value").ToString());
                    Double _mv2 = Double.Parse(threshold.SelectSingleNode(baseString + "MiddleThresholdValue2']/@value").ToString());
                    Double _uv = Double.Parse(threshold.SelectSingleNode(baseString + "UpperThresholdValue']/@value").ToString());
                    Boolean _lowerCheck = Boolean.Parse(threshold.SelectSingleNode(baseString + "LowerThresholdValueIsEqual']/@value").ToString());
                    Boolean _middleCheck1 = Boolean.Parse(threshold.SelectSingleNode(baseString + "MiddleThresholdValue1IsEqual']/@value").ToString());
                    Boolean _middleCheck2 = Boolean.Parse(threshold.SelectSingleNode(baseString + "MiddleThresholdValue2IsEqual']/@value").ToString());
                    Boolean _upperCheck = Boolean.Parse(threshold.SelectSingleNode(baseString + "UpperThresholdValueIsEqual']/@value").ToString());
                    Color _lowerColor = (Color)cv.ConvertFromString(threshold.SelectSingleNode(baseString + "LowerThresholdColor']/@value").ToString());
                    Color _middleColor = (Color)cv.ConvertFromString(threshold.SelectSingleNode(baseString + "MiddleThresholdColor']/@value").ToString());
                    Color _upperColor = (Color)cv.ConvertFromString(threshold.SelectSingleNode(baseString + "UpperThresholdColor']/@value").ToString());
                    bool found = false;
                    for(int i = 0; i < thresholdData.Length; i++)
                    {
                        ThresholdData data = thresholdData[i];
                        if (data.Name.Equals(name))
                        {
                            found = true;
                            data.LowerValue = _lv;
                            data.MiddleValue1 = _mv1;
                            data.MiddleValue2 = _mv2;
                            data.UpperValue = _uv;

                            data.LowerCheck = _lowerCheck;
                            data.MiddleCheck1 = _middleCheck1;
                            data.MiddleCheck2 = _middleCheck2;
                            data.UpperCheck = _upperCheck;

                            data.LowerColor = _lowerColor;
                            data.MiddleColor = _middleColor;
                            data.UpperColor = _upperColor;
                        }
                    }
                    if (!found)
                    {
                        throw new Exception("Could not find threshold data: " + name);
                    }
                }
            }
        }
开发者ID:wshanshan,项目名称:DDD,代码行数:57,代码来源:ThresholdDataSet.cs

示例2: GetFunctions

        public static List<Function> GetFunctions(int RootID, int ComponentID, String linkType, IController passedController)
        {
            ComponentOptions compOptions = new ComponentOptions();
            compOptions.LevelDown = 0;
            IXPathNavigable comp = passedController.GetComponentAndChildren(RootID, ComponentID, linkType, compOptions);

            if (comp != null)
            {
                XPathNavigator nav = comp.CreateNavigator();

                //XPathNodeIterator iterator = nav.Select("//Component[@" + XmlSchemaConstants.Display.Component.Id + "='" + ComponentID + "']");

                XPathNodeIterator iterator = nav.Select("/Components/Component");

                if (iterator.Count > 0)
                {
                    iterator.MoveNext();

                    return GetFunctions(iterator.Current);
                }
            }

            return new List<Function>();
        }
开发者ID:wshanshan,项目名称:DDD,代码行数:24,代码来源:FunctionHelper.cs

示例3: ListDialog

        public ListDialog(String p_listAddFromScreen, String p_listItemType, String p_listLinkType, IController p_listController, int p_rootIDForList, String p_callingLinkType, IController p_callingController, int p_callingRootID)
            : base()
        {
            myHelper = new ViewComponentHelper(this);

            InitializeComponent();

            CreateColumns();

            m_listLinkType = p_listLinkType;
            m_callingLinkType = p_callingLinkType;

            m_listItemType = p_listItemType;

            m_rootIDForList = p_rootIDForList;
            m_callingRootID = p_callingRootID;

            listController = p_listController;
            callingController = p_callingController;

            amountToAddUpDown = new NumericUpDown();
            this.myScrollingListView.Controls.Add(amountToAddUpDown);
            amountToAddUpDown.Hide();

            this.myScrollingListView.ItemSelectionChanged += new ListViewItemSelectionChangedEventHandler(listView1_ItemSelectionChanged);
            this.myScrollingListView.DoubleClick += new EventHandler(ListDialog_DoubleClick);
            this.myScrollingListView.HScrollMoved += new EventHandler(listView1_ScrollMoved);
            this.myScrollingListView.VScrollMoved += new EventHandler(listView1_ScrollMoved);
            this.myScrollingListView.MouseWheelRotated += new EventHandler(listView1_MouseWheelRotated);

            this.amountToAddUpDown.KeyDown += new KeyEventHandler(newNumericUpDown_KeyDown);

            // initialize label
            ComponentOptions compOptions = new ComponentOptions();
            compOptions.LevelDown = 0;

            IXPathNavigable callingInfoIXP = callingController.GetComponentAndChildren(m_callingRootID, p_callingLinkType, compOptions);
            XPathNavigator callingNavigator = callingInfoIXP.CreateNavigator();

            XPathNavigator callingRootComponent = callingNavigator.SelectSingleNode("/Components/Component");

            if (callingRootComponent != null)
            {
                String rootName = callingRootComponent.GetAttribute("Name", callingRootComponent.NamespaceURI);
                String rootType = callingRootComponent.GetAttribute("Type", callingRootComponent.NamespaceURI);
                addButtonLabel.Text = "Add selected items to " + rootType + " " + rootName + ":";
            }

            // initialize title
            this.Text = "Items of type " + m_listItemType + " from the " + p_listAddFromScreen;

            addButton.AutoSize = true;
            addButton.Text = "Add";
            addButton.Click += new EventHandler(AddButton_Click);
            closeButton.Click += new EventHandler(buttonCancel_Click);

            this.myScrollingListView.MultiSelect = true;

            // update / close hooks:
            callingController.RegisterForUpdate(this);
            this.FormClosing += new FormClosingEventHandler(ListDialog_FormClosing);

            // default images
            Dictionary<String, Bitmap> typeImage = listController.GetIcons();
            ImageList tempList = new ImageList();
            Image image;

            foreach (String k in typeImage.Keys)
            {
                image = typeImage[k];
                tempList.Images.Add(k, image);
            }

            this.myScrollingListView.SmallImageList = tempList;
        }
开发者ID:wshanshan,项目名称:DDD,代码行数:75,代码来源:ListDialog.cs


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