public OptionsWindow(SpnvSubSystem system)
        {
            InitializeComponent();

            App app = Application.Current as App;

            if (app != null && app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _system = system;

            _supernova = _system.Setting.Clone() as SupernovaSetting;
            if (app != null)
            {
                _general = app.GeneralSetting.Clone() as GeneralSetting;
            }

            InitializeGeneralPage();
            InitializeAccountPage();
            InitializeSystemPage();
            InitializeCodecsPage();

            _adminUser = (app.LoginRole.Charater == LoginUserRole.Role.Admin);
            if (!_adminUser)
            {
                tabControl.IsEnabled = false;
            }
        }
Exemple #2
0
        public GroupSettingWindow(SpnvSubSystem system)
        {
            this.InitializeComponent();

            App app = App.Current as App;

            if (app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _system = system;
            _isMixedGroupsModified = false;

            _allUsers = new List <User>(system.UserInfo.Users);
            lbxAllUsers.ItemsSource = _allUsers;

            cbxGroup.ItemsSource = _system.UserInfo.PrivateGroups;

            this.LvMixedGroups.ItemsSource = _system.UserInfo.MixedGroups;
            if (this.LvMixedGroups.Items.Count != 0)
            {
                this.LvMixedGroups.SelectedIndex = 0;
            }

            _allUsersPatternTwo = new List <User>(system.UserInfo.AllWithCustomeUsers);
            this.lvAllUsersWithCustomizedUser.ItemsSource = _allUsersPatternTwo;

            if (cbxGroup.Items.Count != 0)
            {
                cbxGroup.SelectedIndex = 0;
            }
        }
Exemple #3
0
        public ChannelContextWindow(SpnvSubSystem system, Channel channel)
        {
            this.InitializeComponent();

            App app = App.Current as App;

            if (app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _sysytem = system;
            _channel = channel;

            if (channel.IsChannelBusy)
            {
                this.txtChannelName.Text  = (channel.CallPartyDisplayName != null && channel.CallPartyDisplayName.Length != 0) ? channel.CallPartyDisplayName : channel.Name;
                this.txtChannelState.Text = channel.CallPartyDisplayNumber;
            }
            else
            {
                this.txtChannelName.Text = channel.Name;
            }

            DialPrefixType type = _sysytem.PrefixInfo.GetPrefixType(channel.CallDestNum);

            if (type != DialPrefixType.DialNoprefix)
            {
                btnRedirectToHandset.IsEnabled = false;
            }
        }
        public RecordFileListWindow(SpnvSubSystem system)
        {
            this.InitializeComponent();

            App app = App.Current as App;

            if (app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _subsystem = system;

            _recording = new RecordingFiles(_subsystem);
            _recording.LoadRecordingFiles(system.Setting.RecordingFileDir);
            if (_recording.Files.Count != 0)
            {
                lsvFiles.ItemsSource = _recording.Files;
            }
            else
            {
                lsvFiles.ItemsSource = null;
            }

            btnPlay.IsEnabled   = false;
            btnDelete.IsEnabled = false;

            if (_recording.Files.Count == 0)
            {
                btnDeleteAll.IsEnabled = false;
            }
        }
Exemple #5
0
        public UserContextWindow(User user, SpnvSubSystem system)
        {
            InitializeComponent();

            App app = Application.Current as App;

            if (app != null && app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _system = system;
            _user   = user;

            DataContext = user;

            if (user.IsLocalUser)
            {
                btnNormalCall.IsEnabled = false;
                btnIntercom.IsEnabled   = false;
                btnPickup.IsEnabled     = false;
                btnThreeway.IsEnabled   = false;
                btnIntercept.IsEnabled  = false;
                btnEavesdrop.IsEnabled  = false;
                btnJoinConf.IsEnabled   = false;
                btnKickConf.IsEnabled   = false;
                btnMessage.IsEnabled    = false;
            }
        }
Exemple #6
0
        protected override void  OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledException;

            if (!EnsureSingleInstance())
            {
                Shutdown();
                return;
            }

            LoadSettings();

            InitializeModules();

            Layout.MainWindow main = new Layout.MainWindow();
            SetTheme(_generalSetting.Theme);

            /*
             * if (!InitializeLicense())
             * {
             *  Shutdown();
             *  return;
             * }*/

            Systeminfo.HandsetMgr = HandsetMgr;
            Systeminfo.SIPUA      = SIPUA;
            Systeminfo.ConfigMgr  = ConfigManager;
            Systeminfo.Initialize(1);

            LoginWindow login = new LoginWindow();

            if (login.ShowDialog() != true)
            {
                Shutdown();
                return;
            }

            main.Initialize();

            if (_generalSetting.MaxWindow)
            {
                main.WindowState = WindowState.Maximized;
                main.WindowStyle = WindowStyle.None;
            }
            main.Show();

            //开启定时删除录音文件的时钟
            _spnvSubSystem = (SpnvSubSystem)Systeminfo.GetSpnvSubSystem();
            if (_spnvSubSystem != null)
            {
                _recordingFiles              = new RecordingFiles(_spnvSubSystem);
                _delRecordingsTimer          = new System.Timers.Timer(10 * 60 * 1000);
                _delRecordingsTimer.Elapsed += DelRecordingsAtTwelve;
                _delRecordingsTimer.Start();
            }
        }
        public XmlrpcService(SpnvSubSystem system, string ipAddress, int port, string remoteAddr, int remotePort)
        {
            Address       = ipAddress;
            Port          = port;
            RemoteAddress = remoteAddr;
            RemotePort    = remotePort;

            _impl        = new XmlrpcImpl();
            _impl.System = system;
        }
        public SpnvPage(SpnvSubSystem system)
        {
            this.InitializeComponent();

            _subsystem = system;

            _highlightTimer = new DispatcherTimer {
                Interval = new TimeSpan(0, 0, 5)
            };
            _highlightTimer.Tick += highlight_stop_tick;
        }
        public MessageInboxWindow(SpnvSubSystem system)
        {
            this.InitializeComponent();

            App app = App.Current as App;

            if (app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _subsystem             = system;
            lbxMessage.ItemsSource = system.TextMessages.Messages;
        }
Exemple #10
0
        public GroupContextWindow(Group group, SpnvSubSystem system)
        {
            this.InitializeComponent();

            DataContext = group;

            _group  = group;
            _system = system;

            App app = App.Current as App;

            if (app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }
        }
        public SettingWindow(SpnvSubSystem system)
        {
            InitializeComponent();

            App app = Application.Current as App;

            if (app != null && app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _system = system;

            btnStatus.Visibility       = Visibility.Hidden;
            btnCallHistory.DataContext = _system.CallHisory;
        }
Exemple #12
0
        public UserCustomizeWindow(SpnvSubSystem system)
        {
            InitializeComponent();

            App app = Application.Current as App;

            if (app != null && app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _system = system;

            //如果在此处重新加载数据,会导致自定义用户在内存中包含多组对象,修改就不能同步
            //if(_system.InitializeCustomizeUser())
            UpdateUsers();

            btnDelUser.IsEnabled    = false;
            btnModifyUser.IsEnabled = false;
        }
        public CallHistoryWindow(SpnvSubSystem system)
        {
            this.InitializeComponent();

            App app = App.Current as App;

            if (app.AppBkBrush != null)
            {
                Background = app.AppBkBrush;
            }

            _subsystem = system;
            _subsystem.CallHisory.ClearUnreadMissing();

            lbxCallHistory.ItemsSource = system.CallHisory.Items;

            system.CallHisory.OnCallHistoryChanged += () => Dispatcher.BeginInvoke(new Action(() => lbxCallHistory.Items.Refresh()));

            btnDelete.IsEnabled = false;
        }
Exemple #14
0
 public SpnvChannels(SpnvSubSystem system)
 {
     _system = system;
 }
Exemple #15
0
        public DialPad(SpnvSubSystem system)
        {
            InitializeComponent();

            _subsystem = system;
        }
Exemple #16
0
 public RecordingFiles(SpnvSubSystem system)
 {
     _subsystem = system;
 }