Пример #1
0
        /// <summary>
        /// Builds the feature structure based on the items chosen
        /// </summary>
        /// <returns></returns>
        private void BuildFeatureStructure(int hvoClosedFeature, int hvoValue, ref IFsFeatureSpecification val)
        {
            val = (IFsClosedValue)m_fs.FindOrCreateClosedValue(hvoClosedFeature);
            val.FeatureRAHvo = hvoClosedFeature;
            IFsClosedValue closed = val as IFsClosedValue;

            if (closed != null)
            {
                closed.ValueRAHvo = hvoValue;
            }
        }
        /// <summary>
        /// Recursively builds the feature structure based on contents of treeview node path.
        /// It recurses back up the treeview node path to the top and then builds the feature structure
        /// as it goes back down.
        /// </summary>
        /// <param name="node"></param>
        /// <param name="fs"></param>
        /// <returns></returns>
        private void BuildFeatureStructure(FeatureTreeNode node, ref IFsFeatStruc fs, ref IFsFeatureSpecification val)
        {
            if (node.Parent != null)
            {
                BuildFeatureStructure((FeatureTreeNode)node.Parent, ref fs, ref val);
            }
            switch (node.Kind)
            {
            case FeatureTreeNodeInfo.NodeKind.Complex:
                IFsComplexValue complex = fs.FindOrCreateComplexValue(node.Hvo);
                val = complex as FsComplexValue;
                val.FeatureRAHvo = node.Hvo;
                if (fs.TypeRA == null)
                {
                    // this is the type which contains the complex feature
                    fs.TypeRAHvo = FsFeatureSystem.GetTypeFromFsComplexFeature(m_cache, node.Hvo);
                }
                fs = (IFsFeatStruc)complex.ValueOA;
                if (fs.TypeRA == null)
                {
                    // this is the type of what's being embedded in the fs
                    IFsComplexFeature cf = val.FeatureRA as IFsComplexFeature;
                    if (cf != null)
                    {
                        fs.TypeRA = cf.TypeRA;
                    }
                }
                break;

            case FeatureTreeNodeInfo.NodeKind.Closed:
                val = (IFsClosedValue)fs.FindOrCreateClosedValue(node.Hvo);
                val.FeatureRAHvo = node.Hvo;
                break;

            case FeatureTreeNodeInfo.NodeKind.SymFeatValue:
                IFsClosedValue closed = val as IFsClosedValue;
                if (closed != null)
                {
                    closed.ValueRAHvo = node.Hvo;
                }
                break;

            default:
                break;                         // do nothing
            }
        }
		/// <summary>
		/// Recursively builds the feature structure based on contents of treeview node path.
		/// It recurses back up the treeview node path to the top and then builds the feature structure
		/// as it goes back down.
		/// </summary>
		/// <param name="node"></param>
		/// <param name="fs"></param>
		/// <returns></returns>
		private void BuildFeatureStructure(FeatureTreeNode node, ref IFsFeatStruc fs, ref IFsFeatureSpecification val)
		{
			if (node.Parent != null)
				BuildFeatureStructure((FeatureTreeNode)node.Parent, ref fs, ref val);
			switch (node.Kind)
			{
				case FeatureTreeNodeInfo.NodeKind.Complex:
					IFsComplexValue complex = fs.FindOrCreateComplexValue(node.Hvo);
					val = complex as FsComplexValue;
					val.FeatureRAHvo = node.Hvo;
					if (fs.TypeRA == null)
					{
						// this is the type which contains the complex feature
						fs.TypeRAHvo = FsFeatureSystem.GetTypeFromFsComplexFeature(m_cache, node.Hvo);
					}
					fs = (IFsFeatStruc)complex.ValueOA;
					if (fs.TypeRA == null)
					{
						// this is the type of what's being embedded in the fs
						IFsComplexFeature cf = val.FeatureRA as IFsComplexFeature;
						if (cf != null)
						{
							fs.TypeRA = cf.TypeRA;
						}
					}
					break;
				case FeatureTreeNodeInfo.NodeKind.Closed:
					val = (IFsClosedValue)fs.FindOrCreateClosedValue(node.Hvo);
					val.FeatureRAHvo = node.Hvo;
					break;
				case FeatureTreeNodeInfo.NodeKind.SymFeatValue:
					IFsClosedValue closed = val as IFsClosedValue;
					if (closed != null)
						closed.ValueRAHvo = node.Hvo;
					break;
				default:
					break; // do nothing
			}
		}