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


C# TreeList.CalcHitInfo方法代码示例

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


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

示例1: treeSolInterm_MouseDown

        private void treeSolInterm_MouseDown(object sender, MouseEventArgs e)
        {
            tree = sender as TreeList;
            TreeListHitInfo ht = tree.CalcHitInfo(e.Location);
            if (ht != null && ht.Node != null)
            {
                tree.FocusedNode = ht.Node;

                //determinar que tipo de solucion es el nodo seleccionado
                int typeSol = Convert.ToInt32(tree.FocusedNode["Type_sol"]);

                //habilitar los botones en popup
                btNewSolInt1.Enabled = false;
                btNewSolInt2.Enabled = false;
                btNewSolStdVer.Enabled = false;

                if (nodeSolutionInProcess == null)
                {
                    if (typeSol == 0) // mrc o solucion patrón
                    {
                        //habilitar Solucion intermedia 1 y standar de verificacion
                        btNewSolInt1.Enabled = true;
                        btNewSolStdVer.Enabled = true;
                    }
                    else if (typeSol == 1) // solucion intermedia 1
                    {
                        //habilitar solucion intermedia 2
                        btNewSolInt2.Enabled = true;

                        //habilitar el estandar de verificacion
                        btNewSolStdVer.Enabled = true;
                    }
                    else if (typeSol == 2) // solución intermedia 2
                    {
                        //habilitar solucion intermedia 2
                        btNewSolStdVer.Enabled = true;
                    }
                }
            }
            else if (ht != null && ht.Node == null)
            {
                tree.FocusedNode = ht.Node;

                btNewSolInt1.Enabled = false;
                btNewSolInt2.Enabled = false;
                btNewSolStdVer.Enabled = false;
            }
        }
开发者ID:khoattn,项目名称:LimsProject,代码行数:48,代码来源:FormCalibs.cs

示例2: treeSolInterm_MouseDown

        private void treeSolInterm_MouseDown(object sender, MouseEventArgs e)
        {
            tree = sender as TreeList;
            TreeListHitInfo ht = tree.CalcHitInfo(e.Location);
            if (ht != null && ht.Node != null)
            {
                tree.FocusedNode = ht.Node;

                //determinar que tipo de solucion es el nodo seleccionado
                int typeSol = Convert.ToInt32(tree.FocusedNode["Type_sol"]);
                int root_type_pattern = Convert.ToInt32(tree.FocusedNode["Root_type_pattern"]);
                decimal concentrationNode = Convert.ToDecimal(tree.FocusedNode["Concentration"]);

                //habilitar los botones en popup
                btNewSolInt1.Enabled = false;
                btNewSolInt2.Enabled = false;
                btNewSolStdVer.Enabled = false;
                btNewSolCalib.Enabled = false;

                if (typeSol == 0) // mrc o solucion patrón
                {
                    if (!HasChildSolInt1(tree.FocusedNode))
                    {
                        //habilitar Solucion intermedia 1 y estandar de verificacion
                        //para calibraciones verificar que la solucion patrón tenga la misma concentración
                        btNewSolCalib.Enabled = template_method_aa.Sol_concentration == concentrationNode ? true : false;

                        if ((root_type_pattern == 1 && template_method_aa.Std_type_pattern == root_type_pattern)
                            || (root_type_pattern == 2 && template_method_aa.Std_type_pattern == root_type_pattern))
                        {
                            btNewSolInt1.Enabled = template_method_aa.Std_flag_sol_intermedia1 == true ? true : false; ;
                            btNewSolStdVer.Enabled = HasChildStdVer(tree.FocusedNode) != true ? true : false;
                        }
                        else
                        {
                            btNewSolInt1.Enabled = false;
                            btNewSolStdVer.Enabled = false;
                        }
                    }
                }
                else if (typeSol == 1) // solucion intermedia 1
                {
                    if (!HasChildSolInt2(tree.FocusedNode))
                    {
                        //habilitar solucion intermedia 2
                        btNewSolCalib.Enabled = false;

                        //habilitar el estandar de verificacion
                        btNewSolStdVer.Enabled = true;

                        if ((root_type_pattern == 1 && template_method_aa.Std_type_pattern == root_type_pattern)
                            || (root_type_pattern == 2 && template_method_aa.Std_type_pattern == root_type_pattern))
                        {
                            btNewSolInt2.Enabled = template_method_aa.Std_flag_sol_intermedia2 == true ? true : false;
                            btNewSolStdVer.Enabled = HasChildStdVer(tree.FocusedNode) != true ? true : false;
                        }
                        else
                        {
                            btNewSolInt2.Enabled = false;
                            btNewSolStdVer.Enabled = false;
                        }
                    }
                }
                else if (typeSol == 2) // solución intermedia 2
                {
                    //habilitar estandar de verificación
                    btNewSolStdVer.Enabled = true;
                    btNewSolCalib.Enabled = false;
                }
            }
            else if (ht != null && ht.Node == null)
            {
                tree.FocusedNode = ht.Node;

                btNewSolInt1.Enabled = false;
                btNewSolInt2.Enabled = false;
                btNewSolStdVer.Enabled = false;
                btNewSolCalib.Enabled = false;
            }
        }
开发者ID:khoattn,项目名称:LimsProject,代码行数:80,代码来源:FormSolInterm.cs

示例3: GetDragDropEffect

        private DragDropEffects GetDragDropEffect(TreeList tl, TreeListNode dragNode, ref bool updown)
        {
            if (dragFromGrid)
            {
                return DragDropEffects.Copy;
            }

            TreeListNode targetNode;
            Point p = tl.PointToClient(MousePosition);
            targetNode = tl.CalcHitInfo(p).Node;

            if (dragNode != null && targetNode != null
                && dragNode != targetNode
                && dragNode.ParentNode == targetNode.ParentNode)
            {
                //下移
                if (tl.GetNodeIndex(dragNode) < tl.GetNodeIndex(targetNode))
                {
                    updown = true;
                }
                //上移
                else
                {
                    updown = false;
                }
                return DragDropEffects.Move;
            }
            else
                return DragDropEffects.None;
        }
开发者ID:sunpander,项目名称:VSDT,代码行数:30,代码来源:FormResources.cs

示例4: getDragDropEffect

		private static DragDropEffects getDragDropEffect(
			TreeList tl,
			TreeListNode dragNode)
		{
			var p = tl.PointToClient(MousePosition);
			var targetNode = tl.CalcHitInfo(p).Node;

			if (dragNode != null && targetNode != null &&
				dragNode != targetNode &&
				!ZetaResourceEditorTreeListControl.IsNodeChildNodeOf(targetNode, dragNode))
			{
				if (dragNode.Tag is FileGroup || dragNode.Tag is ProjectFolder)
				{
					if (targetNode.Tag is ProjectFolder || targetNode.Tag is Project)
					{
						return DragDropEffects.Move;
					}
					else
					{
						return DragDropEffects.None;
					}
				}
				else
				{
					return DragDropEffects.None;
				}
			}
			else
			{
				return DragDropEffects.None;
			}
		}
开发者ID:iraychen,项目名称:ZetaResourceEditor,代码行数:32,代码来源:ProjectFilesUserControl.cs


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