Пример #1
0
 protected void EventBeforeDeleteItem(ref object aObj, ref int aPlace)
 {
     CasObjectEventArgs ae = new CasObjectEventArgs(aObj, aPlace);
     if (OnBeforeDeleteItem != null)
         OnBeforeDeleteItem(this, ae);
     aObj		= ae.pObject;
     aPlace	= ae.pInt;
 }
Пример #2
0
        //private void OnTreeBeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
        //{
        //    e.Node.Text = e.Node.Text;
        //}
        //private void OnTreeAfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        //{
        //    this.LabelEdit = false;
        //}
        //        private void OnTreeAfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        //        {
        //            if (e.Label == null && mLastCommand != (eCommand.Add|eCommand.Edit)) // press ESC - canceled
        //                e.CancelEdit = true;
        //            else
        //            {
        //                bool ret = false;
        //                string prevText = e.Node.Text;
        //                if (e.Label != null)
        //                    e.Node.Text = e.Label;
        //                if (mLastCommand == (eCommand.Add|eCommand.Edit))
        //                {
        //                    ret = ItemAdd();
        //                    if(!ret)
        //                        Nodes.Remove(e.Node);
        //                }
        //                else if (mLastCommand == eCommand.Edit)
        //                {
        //                    ret = ItemRename();
        //                }
        //                if (!ret)
        //                    e.Node.Text = prevText;
        //
        //                //e.Node.EndEdit(ret);
        //                //e.CancelEdit = !ret;
        //                if (ret)
        //                {
        //                    e.CancelEdit = true;
        //                    CASTreeItemData tid;
        //                    if (e.Node.Parent == null)
        //                    {
        //                        tid = (CASTreeItemData)e.Node.Tag;
        //                        ReloadLevel(tid.pPlace, 0);
        //                    }
        //                    else
        //                    {
        //                        tid = (CASTreeItemData)e.Node.Parent.Tag;
        //                        ReloadLevel(tid.pPlace, tid.pCode);
        //                    }
        //                    SelectedNode = SearchByText(e.Node.Text);
        //                }
        //            }
        //            InitTextForNewItem();
        //            this.LabelEdit = false;
        //            //this.AfterLabelEdit  -= new NodeLabelEditEventHandler(OnTreeAfterLabelEdit);
        //        }
        /*protected override void OnAfterLabelEdit(NodeLabelEditEventArgs e)
        {
            base.OnAfterLabelEdit(e);

            if (e.Label == null && mLastCommand != (eCommand.Add|eCommand.Edit)) // press ESC - canceled
                e.CancelEdit = true;
            else
            {
                bool ret = false;
                string prevText = e.Node.Text;
                if (e.Label != null)
                    e.Node.Text = e.Label;
                if (mLastCommand == (eCommand.Add|eCommand.Edit))
                {
                    ret = ItemAdd();
                    if(!ret)
                        Nodes.Remove(e.Node);
                }
                else if (mLastCommand == eCommand.Edit)
                {
                    ret = ItemRename();
                }
                if (!ret)
                    e.Node.Text = prevText;

                e.Node.EndEdit(ret);
                //e.CancelEdit = !ret;
                if (ret)
                {
                    //e.CancelEdit = true;
                    CASTreeItemData tid;
                    if (e.Node.Parent == null)
                    {
                        tid = (CASTreeItemData)e.Node.Tag;
                        ReloadLevel(tid.pPlace, 0);
                    }
                    else
                    {
                        tid = (CASTreeItemData)e.Node.Parent.Tag;
                        ReloadLevel(tid.pPlace, tid.pCode);
                    }
                    SelectedNode = SearchByText(e.Node.Text);
                }
            }
            InitTextForNewItem();
            this.LabelEdit = false;
        }*/
        protected void EventBeforeViewItemProperty(ref object aRefBook, ref int aPlace)
        {
            CasObjectEventArgs ae = new CasObjectEventArgs(aRefBook, aPlace);
            if (OnBeforeViewItemProperty != null)
                OnBeforeViewItemProperty(this, ae);
            aRefBook	= ae.pObject;
            aPlace		= ae.pInt;
        }
Пример #3
0
        /*protected override void OnResize(System.EventArgs ea)
        {
            tv.Invalidate();
            base.OnResize(ea);

        }*/
        private void OnBeforeViewProperty(object sender, CasObjectEventArgs e)
        {
            e.pObject = pRefBook;
            e.pInt = ((CASTreeItemData)mTv.SelectedNode.Tag).pPlace;
        }