예제 #1
0
        /// <summary>
        /// 将当前选择的列添加到右边
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnRight_Click(object sender, RoutedEventArgs e)
        {
            TreeViewItem item = this.tvControls.SelectedItem as TreeViewItem;

            if (null == item)
            {
                return;
            }
            string controlName  = string.Format("{0}", item.Header);
            var    pageLoadItem = this.lbLoadingControls.ItemsSource as List <PageLoadingInfo>;

            if (null == pageLoadItem)
            {
                pageLoadItem = new List <PageLoadingInfo>();
                PageLoadingInfo pli = new PageLoadingInfo();
                pli.ControlName      = controlName;
                pli.CallFunctionName = _INIT_FUNCTION;//"InitLoad";
                ListBoxItem lbi = new ListBoxItem();
                lbi.Content = pli;
                this.lbLoadingControls.Items.Add(lbi);
                pageLoadItem.Add(pli);
                this.IDesignFramework.GetCurrentXmlTemplate().PageLoadingItem = pageLoadItem;
                this.IDesignFramework.UpdateCurrentTemplate();
            }
            else
            {
                var isExists = from p in pageLoadItem
                               where p.ControlName.Equals(controlName)
                               select p;
                if (null == isExists || 0 == isExists.Count())
                {
                    PageLoadingInfo pli = new PageLoadingInfo();
                    pli.ControlName      = controlName;
                    pli.CallFunctionName = _INIT_FUNCTION;//"InitLoad";
                    pageLoadItem.Add(pli);
                    FillListBoxItem(pageLoadItem);

                    this.IDesignFramework.GetCurrentXmlTemplate().PageLoadingItem = pageLoadItem;
                    this.IDesignFramework.UpdateCurrentTemplate();
                }
            }
            _SetEvaluationContent();
        }
예제 #2
0
        /// <summary>
        /// 将当左右所有列添加到右边
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnRightAll_Click(object sender, RoutedEventArgs e)
        {
            var controlItem = this.IDesignFramework.GetCurrentXmlTemplate().ControlItem;

            this.lbLoadingControls.Items.Clear();
            List <PageLoadingInfo> result = new List <PageLoadingInfo>();

            foreach (var v in controlItem)
            {
                PageLoadingInfo pli = new PageLoadingInfo();
                pli.CallFunctionName = _INIT_FUNCTION;// "InitLoad";
                pli.ControlName      = v.Name;
                result.Add(pli);
                ListBoxItem lbi = new ListBoxItem();
                lbi.Content = pli;
                this.lbLoadingControls.Items.Add(lbi);
            }
            this.IDesignFramework.GetCurrentXmlTemplate().PageLoadingItem = result;
            this.IDesignFramework.UpdateCurrentTemplate();
            _SetEvaluationContent();
        }
예제 #3
0
        /// <summary>
        /// 删除当前选择的列
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnLeft_Click(object sender, RoutedEventArgs e)
        {
            var items = this.lbLoadingControls.SelectedItems;

            if (null == items || 0 == items.Count)
            {
                return;
            }
            foreach (var item in items)
            {
                PageLoadingInfo p = item as PageLoadingInfo;
                if (null == p)
                {
                    continue;
                }
                this.IDesignFramework.GetCurrentXmlTemplate().PageLoadingItem.Remove(p);
            }
            this.IDesignFramework.UpdateCurrentTemplate();
            FillListBoxItem(this.IDesignFramework.GetCurrentXmlTemplate().PageLoadingItem);
            _SetEvaluationContent();
        }