Esempio n. 1
0
        /// <summary>
        ///  Uses the AFEventFrameFindControl, but overrides the EventFrameBrowser to FindEventFrames (AFOperations).
        ///  Opens dialog to select eventframes to be shown in the AFViewControl
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void afEventFrameFindCtrl_DialogButtonPressing(object sender, CancelEventArgs e)
        {
            e.Cancel = true;
            AFNamedCollectionList <AFEventFrame> frames = null;

            bool b = true;

            //    afEventFrameFindCtrl.FindEventFrame(afDatabasePicker1.AFDatabase, true, ref b);
            //   afEventFrameFindCtrl


            // AFEventFrame frame = afEventFrameFindCtrl.FindEventFrame(afDatabasePicker1.AFDatabase, false, ref b);



            AFOperations.FindEventFrames(this, afDatabasePicker1.AFDatabase, out frames, true, true, "PersistID");

            if (frames.Count > 0)
            {
                avcEventFrames.AFSetObject(frames, afDatabasePicker1.AFDatabase, null, null);

                avcEventFrames.AFSelection = frames[0];
                object selected = avcEventFrames.AFSelection;
                avcEventFrames_ItemSelected(this, null);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///  Handles the afTreeView Menu Item calls, brings up the FindElements Dialog and EventFrame Dialog
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void afTreeViewElements_MenuItemClicked(object sender, MenuItemClickedEventArgs e)
        {
            try
            {
                e.Handled = true;
                bool   persistUserData = true;
                bool   multiSelect     = true;
                string myPersistID     = "MyPersistID";
                if ((AFMenu.MenuCommand)e.ClickedItem.MergeIndex == AFMenu.MenuCommand.FindChildren)
                {
                    AFNamedCollectionList <AFElement> elements = null;
                    DialogResult dr = AFOperations.FindElements(this, afDatabasePicker1.AFDatabase, out elements, multiSelect, persistUserData, myPersistID);

                    //Clear Search and Load new search
                    if (dr == DialogResult.OK)
                    {
                        currentSearchResults     = elements;
                        currentTreeSearchTimes   = 0;
                        currentTreeSearch        = "";
                        tbElementSearchName.Text = "";

                        if (currentSearchResults.Count > 0)
                        {
                            findTreeNode(afTreeViewElements.Nodes[0], currentSearchResults[currentTreeSearchTimes]);
                        }
                    }
                }
                else if ((AFMenu.MenuCommand)e.ClickedItem.MergeIndex == AFMenu.MenuCommand.FindEventFrames)
                {
                    AFNamedCollectionList <AFEventFrame> frames = null;
                    AFOperations.FindEventFrames(this, afDatabasePicker1.AFDatabase, out frames, true, true, "PersistID");

                    if (frames.Count > 0)
                    {
                        avcEventFrames.AFSetObject(frames, afDatabasePicker1.AFDatabase, null, null);

                        avcEventFrames.AFSelection = frames[0];
                        object selected = avcEventFrames.AFSelection;
                        avcEventFrames_ItemSelected(this, null);
                    }
                }
            }
            catch { }
        }