Esempio n. 1
0
        void txtPath_Leave(object sender, EventArgs e)
        {
            TreeNode curNode = tvAllViews.SelectedNode;

            if (curNode == null)
            {
                return;
            }

            VDView view = getViewFromNode(curNode);

            if (view == null)
            {
                return;
            }

            string curPath = SettingsHelper.getViewPathFromView(view, m_rootViewPath);
            string newPath = this.txtPath.Text;

            // path not changed
            if (string.Compare(curPath, newPath, true) == 0)
            {
                return;
            }

            if (string.IsNullOrEmpty(newPath))
            {
                SettingsHelper.saveViewPathToView(string.Empty, view, m_rootViewPath);
            }
            else
            {
                SettingsHelper.saveViewPathToView(newPath, view, m_rootViewPath);
            }
        }
        internal void initTreeView(VDView rootView, string rootViewPath)
        {
            m_rootViewPath = rootViewPath;

            tvAllViews.Nodes.Clear();
            TreeNode rootNode = new TreeNode(rootView.WidgetName);
            saveViewToNode(rootNode, rootView);
            tvAllViews.Nodes.Add(rootNode);
            createTreeNode(rootView, rootNode);
        }
 private static void createTreeNode(VDView parentView, TreeNode parentNode)
 {
     List<VDView> childViews = parentView.GetChildren<VDView>();
     foreach (VDView cv in childViews)
     {
         TreeNode cn = new TreeNode(cv.WidgetName);
         saveViewToNode(cn, cv);
         parentNode.Nodes.Add(cn);
         createTreeNode(cv, cn);
     }
 }
Esempio n. 4
0
        internal void initTreeView(VDView rootView, string rootViewPath)
        {
            m_rootViewPath = rootViewPath;

            tvAllViews.Nodes.Clear();
            TreeNode rootNode = new TreeNode(rootView.WidgetName);

            saveViewToNode(rootNode, rootView);
            tvAllViews.Nodes.Add(rootNode);
            createTreeNode(rootView, rootNode);
        }
Esempio n. 5
0
        static private void createTreeNode(VDView parentView, TreeNode parentNode)
        {
            List <VDView> childViews = parentView.GetChildren <VDView>();

            foreach (VDView cv in childViews)
            {
                TreeNode cn = new TreeNode(cv.WidgetName);
                saveViewToNode(cn, cv);
                parentNode.Nodes.Add(cn);
                createTreeNode(cv, cn);
            }
        }
        internal void initView(VDView rootView, string rootViewPath)
        {
            m_rootViewPath = rootViewPath;
            m_rootView = rootView;

            if (m_rootView != null)
            {
                string path = SettingsHelper.getCSModelPathFromView(rootView, m_rootViewPath);
                if (string.IsNullOrEmpty(path))
                    this.txtPath.Text = string.Empty;
                else
                    this.txtPath.Text = path;
            }
        }
Esempio n. 7
0
        void tvAllViews_AfterSelect(object sender, TreeViewEventArgs e)
        {
            VDView view = getViewFromNode(e.Node);

            if (view != null)
            {
                string path = SettingsHelper.getViewPathFromView(view, m_rootViewPath);
                if (string.IsNullOrEmpty(path))
                {
                    this.txtPath.Text = string.Empty;
                }
                else
                {
                    this.txtPath.Text = path;
                }
            }
        }
Esempio n. 8
0
        internal void initView(VDView rootView, string rootViewPath)
        {
            m_rootViewPath = rootViewPath;
            m_rootView     = rootView;

            if (m_rootView != null)
            {
                string path = SettingsHelper.getCSModelPathFromView(rootView, m_rootViewPath);
                if (string.IsNullOrEmpty(path))
                {
                    this.txtPath.Text = string.Empty;
                }
                else
                {
                    this.txtPath.Text = path;
                }
            }
        }
 private static void saveViewToNode(TreeNode node, VDView view)
 {
     node.Tag = view;
 }
Esempio n. 10
0
 static private void saveViewToNode(TreeNode node, VDView view)
 {
     node.Tag = view;
 }