コード例 #1
0
        public static void AddRibbonButtons()
        {
            _exitButton             = new RibbonApplicationMenuItemViewModel("Exit");
            _exitButton.Command     = new RelayCommand(Exit, ReturnTrue);
            _exitButton.ImageSource = PngIcons.GetIcon(IconName.Exit, IconSize.Size32);
            VM.ApplicationMenuItems.Add(_exitButton);



            _globalButton            = new RibbonButtonViewModel("Start tests");
            _globalButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _globalButton.LargeImage = PngIcons.GetIcon(IconName.Play, IconSize.Size32);
            VM.AddRibbonButton("Global", "Global", "", _globalButton);

            _clearConfigButton            = new RibbonButtonViewModel("Clear");
            _clearConfigButton.LargeImage = PngIcons.GetIcon(IconName.Clear, IconSize.Size32);
            VM.AddRibbonButton("Configuration", "Configuration", "", _clearConfigButton);
            _saveXmlConfigButton            = new RibbonButtonViewModel("Save XML config");
            _saveXmlConfigButton.LargeImage = PngIcons.GetIcon(IconName.Save, IconSize.Size32);
            VM.AddRibbonButton("Configuration", "Configuration", "XML", _saveXmlConfigButton);
            _loadXmlConfigButton            = new RibbonButtonViewModel("Load XML config");
            _loadXmlConfigButton.LargeImage = PngIcons.GetIcon(IconName.DocumentOpen, IconSize.Size32);
            VM.AddRibbonButton("Configuration", "Configuration", "XML", _loadXmlConfigButton);
            _saveIniConfigButton            = new RibbonButtonViewModel("Save INI config");
            _saveIniConfigButton.LargeImage = PngIcons.GetIcon(IconName.Save, IconSize.Size32);
            VM.AddRibbonButton("Configuration", "Configuration", "INI", _saveIniConfigButton);
            _loadIniConfigButton            = new RibbonButtonViewModel("Load INI config");
            _loadIniConfigButton.LargeImage = PngIcons.GetIcon(IconName.DocumentOpen, IconSize.Size32);
            VM.AddRibbonButton("Configuration", "Configuration", "INI", _loadIniConfigButton);

            _dbButton            = new RibbonButtonViewModel("Start test");
            _dbButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _dbButton.LargeImage = PngIcons.GetIcon(IconName.Play, IconSize.Size32);
            VM.AddRibbonButton("Database", "Database", "", _dbButton);

            _startHttpButton            = new RibbonButtonViewModel("Start server");
            _startHttpButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _startHttpButton.LargeImage = PngIcons.GetIcon(IconName.Play, IconSize.Size32);
            VM.AddRibbonButton("HttpServer", "HttpServer", "", _startHttpButton);
            _stopHttpButton            = new RibbonButtonViewModel("Stop server");
            _stopHttpButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _stopHttpButton.LargeImage = PngIcons.GetIcon(IconName.Close, IconSize.Size32);
            VM.AddRibbonButton("HttpServer", "HttpServer", "", _stopHttpButton);

            _startTcpButton            = new RibbonButtonViewModel("Start test");
            _startTcpButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _startTcpButton.LargeImage = PngIcons.GetIcon(IconName.Play, IconSize.Size32);
            VM.AddRibbonButton("TcpServer", "TcpServer", "", _startTcpButton);
            _stopTcpButton            = new RibbonButtonViewModel("Stop test");
            _stopTcpButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _stopTcpButton.LargeImage = PngIcons.GetIcon(IconName.Close, IconSize.Size32);
            VM.AddRibbonButton("TcpServer", "TcpServer", "", _stopTcpButton);

            _reportingButton            = new RibbonButtonViewModel("Start test");
            _reportingButton.Command    = new RelayCommand((param) => { }, ReturnTrue);
            _reportingButton.LargeImage = PngIcons.GetIcon(IconName.Play, IconSize.Size32);
            VM.AddRibbonButton("Reporting", "Reporting", "", _reportingButton);
        }
コード例 #2
0
 public PropertyViewModel(RibbonDockWindowViewModel rdVM)
 {
     _rdVM        = rdVM;
     _hideCommand = new RelayCommand(Hide, ReturnTrue);
     CanClose     = false;
     CanFloat     = false;
     ContentId    = "Properties";
     Title        = "Properties ";
     IconSource   = PngIcons.GetIcon(IconName.Settings, IconSize.Size16);
 }
コード例 #3
0
 public DatabaseViewModel(RibbonDockWindowViewModel rdVM)
 {
     _rdVM                   = rdVM;
     _closeCommand           = new RelayCommand(Close, ReturnTrue);
     _closeAllButThisCommand = new RelayCommand(CloseAllButThis, ReturnTrue);
     CanClose                = false;
     CanFloat                = false;
     ContentId               = "Database";
     Title                   = "Database ";
     IconSource              = PngIcons.GetIcon(IconName.Settings, IconSize.Size16);
 }
コード例 #4
0
        public ConfigurationViewModel(RibbonDockWindowViewModel rdVM)
        {
            _rdVM                   = rdVM;
            _closeCommand           = new RelayCommand(Close, ReturnTrue);
            _closeAllButThisCommand = new RelayCommand(CloseAllButThis, ReturnTrue);

            CanClose   = false;
            CanFloat   = false;
            ContentId  = "Configuration";
            Title      = "Configuration ";
            IconSource = PngIcons.GetIcon(IconName.Settings, IconSize.Size16);
            _settings  = new ObservableCollection <SettingModel>();
        }
コード例 #5
0
 public HttpServerViewModel(RibbonDockWindowViewModel rdVM)
 {
     _rdVM                   = rdVM;
     _closeCommand           = new RelayCommand(Close, ReturnTrue);
     _closeAllButThisCommand = new RelayCommand(CloseAllButThis, ReturnTrue);
     _startCommand           = new RelayCommand((param) => Start(), ReturnTrue);
     _stopCommand            = new RelayCommand((param) => Stop(), ReturnTrue);
     CanClose                = false;
     CanFloat                = false;
     ContentId               = "HttpServer";
     Title                   = "HttpServer ";
     IconSource              = PngIcons.GetIcon(IconName.Settings, IconSize.Size16);
     _eventList              = new ObservableCollection <HttpListenerContext>();
 }