Example #1
0
        private void ChangePriority(FindMeNumberDiagramShape fmd, short prChange)
        {
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactRow = fmd.ContactRow;

            short oldPriority = contactRow.Priority;

            // Increase the priority of the current contactRow. Zero is highest priority.
            contactRow.Priority += prChange;

            // Get all or our contacts in order of priority
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow[] contactRows = (WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow[])ExtensionContactTable.Select("ExtensionID = '" + extension.ExtensionID + "'", "Priority ASC");

            foreach (WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contact in contactRows)
            {
                if (contact != contactRow && contact.Priority >= contactRow.Priority)
                {
                    contact.Priority = oldPriority;
                    break;
                }
            }

            UpdatePriorityNumbers();

            int childIndex = pnlFlow.Controls.GetChildIndex(fmd);

            if ((prChange > 0 && childIndex > 1) || (prChange < 0 && childIndex < pnlFlow.Controls.Count))
            {
                childIndex -= prChange;
                pnlFlow.Controls.SetChildIndex(fmd, childIndex);
            }
        }
Example #2
0
        private void AddContactControl(WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions, WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactRow, bool scrollIntoView)
        {
            // Create our contact number shape
            FindMeNumberDiagramShape fmd = new FindMeNumberDiagramShape(extensions, contactRow);

            fmd.Dock              = DockStyle.Top;
            fmd.NumberType        = numberType;
            fmd.UsingCallBlast    = cbCallBlast.Checked;
            fmd.EnableCallIPPhone = enableCallIPPhone;
            fmd.Visible           = false;

            fmd.DeletePressed   += new EventHandler(fmd_DeletePressed);
            fmd.MoveDownPressed += new EventHandler(fmd_MoveDownPressed);
            fmd.MoveUpPressed   += new EventHandler(fmd_MoveUpPressed);
            fmd.SizeChanged     += new EventHandler(fmd_SizeChanged);

            pnlFlow.Controls.Add(fmd);
            pnlFlow.Controls.SetChildIndex(fmd, 1);

            fmd.Visible = true;

            if (scrollIntoView)
            {
                fmd.Expanded = true;
                //pnlFlow.ScrollControlIntoView(fmd);
                //pnlFlow.AutoScrollPosition = new Point(pnlFlow.AutoScrollPosition.X, fmd.Top);
            }
        }
Example #3
0
        private void DeleteContactItem(FindMeNumberDiagramShape fmd)
        {
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactRow = fmd.ContactRow;

            Guid extensionId  = contactRow.ExtensionID;
            Guid extContactId = contactRow.ExtensionContactNumberID;

            contactRow.Delete();

            pnlFlow.Controls.Remove(fmd);
        }
        private void DeleteContactItem(FindMeNumberDiagramShape fmd)
        {
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactRow = fmd.ContactRow;

            Guid extensionId = contactRow.ExtensionID;
            Guid extContactId = contactRow.ExtensionContactNumberID;
            contactRow.Delete();

            pnlFlow.Controls.Remove(fmd);
        }
        private void ChangePriority(FindMeNumberDiagramShape fmd, short prChange)
        {
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactRow = fmd.ContactRow;

            short oldPriority = contactRow.Priority;

            // Increase the priority of the current contactRow. Zero is highest priority.
            contactRow.Priority += prChange;

            // Get all or our contacts in order of priority
            WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow[] contactRows = (WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow[])ExtensionContactTable.Select("ExtensionID = '" + extension.ExtensionID + "'", "Priority ASC");

            foreach (WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contact in contactRows)
            {
                if (contact != contactRow && contact.Priority >= contactRow.Priority)
                {
                    contact.Priority = oldPriority;
                    break;
                }
            }

            UpdatePriorityNumbers();

            int childIndex = pnlFlow.Controls.GetChildIndex(fmd);

            if ((prChange > 0 && childIndex > 1) || (prChange < 0 && childIndex < pnlFlow.Controls.Count))
            {
                childIndex -= prChange;
                pnlFlow.Controls.SetChildIndex(fmd, childIndex);
            }
        }
        private void AddContactControl(WOSI.CallButler.Data.CallButlerDataset.ExtensionsDataTable extensions, WOSI.CallButler.Data.CallButlerDataset.ExtensionContactNumbersRow contactRow, bool scrollIntoView)
        {
            // Create our contact number shape
            FindMeNumberDiagramShape fmd = new FindMeNumberDiagramShape(extensions, contactRow);
            fmd.Dock = DockStyle.Top;
            fmd.NumberType = numberType;
            fmd.UsingCallBlast = cbCallBlast.Checked;
            fmd.EnableCallIPPhone = enableCallIPPhone;
            fmd.Visible = false;

            fmd.DeletePressed += new EventHandler(fmd_DeletePressed);
            fmd.MoveDownPressed += new EventHandler(fmd_MoveDownPressed);
            fmd.MoveUpPressed += new EventHandler(fmd_MoveUpPressed);
            fmd.SizeChanged += new EventHandler(fmd_SizeChanged);

            pnlFlow.Controls.Add(fmd);
            pnlFlow.Controls.SetChildIndex(fmd, 1);

            fmd.Visible = true;

            if (scrollIntoView)
            {
                fmd.Expanded = true;
                //pnlFlow.ScrollControlIntoView(fmd);
                //pnlFlow.AutoScrollPosition = new Point(pnlFlow.AutoScrollPosition.X, fmd.Top);
            }
        }