Esempio n. 1
0
 public void AddSoft(string softName, string softVersion)
 {
     SoftwareList.Add(new SoftVM
     {
         SoftName    = softName,
         SoftVersion = softVersion
     });
 }
Esempio n. 2
0
        /// <summary>
        /// Remove fields with given values
        /// </summary>
        /// <param name="softwareList">SoftwareList to remove fields from</param>
        private void RemoveFields(SoftwareList softwareList)
        {
            if (DatItemFields.Contains(DatItemField.SoftwareListStatus))
            {
                softwareList.Status = SoftwareListStatus.NULL;
            }

            if (DatItemFields.Contains(DatItemField.Filter))
            {
                softwareList.Filter = null;
            }
        }
Esempio n. 3
0
        public ThirdPartySoftware()
        {
            InitializeComponent();

            // Get the list of software from our software.json resource file
            ResourceManager res     = new ResourceManager(RESOURCE_LIB_NAME, typeof(ZeroMunge).Assembly);
            string          jsonStr = (string)res.GetObject("software");

            // Deserialize the json into our SoftwareList class, set the license for each software, and sort the list alphabetically
            softwareList = JsonConvert.DeserializeObject <SoftwareList>(jsonStr);
            softwareList.SetLicenses();
            softwareList.Software.Sort();
        }
Esempio n. 4
0
        private void GetSoftware()
        {
            List <Soft> softList = core.GetSoftware();

            foreach (Soft sft in softList)
            {
                SoftwareList.Add(new SoftVM
                {
                    SoftName    = sft.SoftName,
                    SoftVersion = sft.SoftVersion
                });
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Executes the page initialization event.
        /// </summary>
        /// <param name="e">The event arguments.</param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            SearchButton.Click           += SearchButtonClick;
            HardwareList.ItemDataBound   += ListItemDataBound;
            PremiumUpload.UploadComplete += UploadComplete;

            NoResultsMessage.Visible     = false;
            PremiumUploadSuccess.Visible = false;
            PremiumUploadError.Visible   = false;

            jQuery.RequestDnnPluginsRegistration();

            HardwareList.DataSource = DataProvider.HardwareProperties;
            SoftwareList.DataSource = DataProvider.SoftwareProperties;
            BrowserList.DataSource  = DataProvider.BrowserProperties;
            ContentList.DataSource  = DataProvider.ContentProperties;

            HardwareList.DataBind();
            SoftwareList.DataBind();
            BrowserList.DataBind();
            ContentList.DataBind();

            var refreshButtonText = LocalizeString("StatsRefreshButton.Text");
            var statsHtml         = LocalizeString("StatsHtml.Text");

            PremiumStats.RefreshButtonText = refreshButtonText;
            PremiumStats.Html = statsHtml;
            PremiumUpload.UploadButtonText = LocalizeString("UploadData.Text");
            LiteStats.RefreshButtonText    = refreshButtonText;
            LiteStats.Html = statsHtml;

            if (!IsPremium)
            {
                // lite
                Activate.ActivateButtonText        = LocalizeString("ActivateButtonText.Text");
                Activate.ActivatedMessageHtml      = LocalizeString("ActivatedMessageHtml.Text");
                Activate.ActivateInstructionsHtml  = LocalizeString("ActivateInstructionsHtml.Text");
                Activate.ActivationDataInvalidHtml = LocalizeString("ActivationDataInvalidHtml.Text");
                Activate.ActivationFailureCouldNotUpdateConfigHtml     = LocalizeString("ActivationFailureCouldNotUpdateConfigHtml.Text");
                Activate.ActivationFailureCouldNotWriteDataFileHtml    = LocalizeString("ActivationFailureCouldNotWriteDataFileHtml.Text");
                Activate.ActivationFailureCouldNotWriteLicenceFileHtml = LocalizeString("ActivationFailureCouldNotWriteLicenceFileHtml.Text");
                Activate.ActivationFailureGenericHtml = LocalizeString("ActivationFailureGenericHtml.Text");
                Activate.ActivationFailureHttpHtml    = LocalizeString("ActivationFailureHttpHtml.Text");
                Activate.ActivationFailureInvalidHtml = LocalizeString("ActivationFailureInvalidHtml.Text");
                Activate.ActivationStreamFailureHtml  = LocalizeString("ActivationStreamFailureHtml.Text");
                Activate.ActivationSuccessHtml        = LocalizeString("ActivationSuccessHtml.Text");
                Activate.ValidationFileErrorText      = LocalizeString("ValidationFileErrorText.Text");
                Activate.ValidationRequiredErrorText  = LocalizeString("ValidationRequiredErrorText.Text");
                Activate.ValidationRegExErrorText     = LocalizeString("ValidationRegExErrorText.Text");
                Activate.RefreshButtonText            = LocalizeString("RefreshButtonText.Text");
                Activate.UploadButtonText             = LocalizeString("UploadButtonText.Text");
                Activate.UploadInstructionsHtml       = LocalizeString("UploadInstructionsHtml.Text");
            }
            else
            {
                // premium
                DeviceExplorer.BackButtonDeviceText      = LocalizeString("BackButtonDeviceText.Text");
                DeviceExplorer.BackButtonDevicesText     = LocalizeString("BackButtonDevicesText.Text");
                DeviceExplorer.DeviceExplorerDeviceHtml  = LocalizeString("DeviceExplorerDeviceInstructionsHtml.Text");
                DeviceExplorer.DeviceExplorerModelsHtml  = LocalizeString("DeviceExplorerModelsInstructionsHtml.Text");
                DeviceExplorer.DeviceExplorerVendorsHtml = LocalizeString("DeviceExplorerVendorsHtml.Text");
            }

            if (IsPostBack)
            {
                return;
            }

            var vendor      = Request.QueryString["Vendor"];
            var model       = Request.QueryString["Model"];
            var deviceId    = Request.QueryString["DeviceID"];
            var searchQuery = Request.QueryString["Query"];

            var hasVendor      = !string.IsNullOrEmpty(vendor);
            var hasModel       = !string.IsNullOrEmpty(model);
            var hasDeviceId    = !string.IsNullOrEmpty(deviceId);
            var hasSearchQuery = !string.IsNullOrEmpty(searchQuery);

            if (hasVendor)
            {
                DeviceExplorer.Vendor = vendor;
            }

            if (hasModel)
            {
                DeviceExplorer.Model = model;
            }

            if (hasDeviceId)
            {
                DeviceExplorer.DeviceID = deviceId;
            }

            if (hasSearchQuery)
            {
                SearchTextBox.Text = Server.UrlDecode(searchQuery);
            }

            NoResultsMessage.Visible = hasSearchQuery && !hasDeviceId && !hasModel && !hasVendor;
        }
Esempio n. 6
0
 public void RemoveSoft(SoftVM delSoft)
 {
     SoftwareList.Remove(delSoft);
 }
Esempio n. 7
0
        public void DoDemo()
        {
            Task.Factory.StartNew(() =>
            {
                if (DemoStopped())
                {
                    return;
                }
                switch (_nextDemoState)
                {
                case Constants.ApplicationState.ScheduleAdd:
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        DrawerHost.IsLeftDrawerOpen = false;
                        var dialog = new ScheduleName {
                            Owner = this
                        };
                        DemoStateHandler.Instance.DemoState = dialog;
                        dialog.ShowDialog();

                        if (!string.IsNullOrEmpty(dialog.Name))
                        {
                            if (_viewModel.LastOpenedSchedule != null)
                            {
                                _viewModel.UpdateCurrentSchedule();
                            }

                            _viewModel.LastOpenedSchedule = new Schedule
                            {
                                Id = dialog.Name,
                            };

                            _viewModel.SaveCurrentSchedule();
                            _viewModel.InitRemainigSessions();

                            // in case this is the first time running
                            ScheduleView.Visibility   = Visibility.Visible;
                            ClassromsPanel.Visibility = Visibility.Visible;
                            ScheduleLabel.Visibility  = Visibility.Hidden;
                            GlobalButton.IsEnabled    = true;

                            Schedule.Appointments.Clear();

                            Title = $"{dialog.Name} - {_appTitle}";
                        }

                        _nextDemoState = Constants.ApplicationState.Courses;
                        DrawerHost.IsLeftDrawerOpen = true;
                    });
                    DemoStopped();
                    break;

                case Constants.ApplicationState.Courses:
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        var dialog = new CourseList(_viewModel);
                        DemoStateHandler.Instance.DemoState = dialog;
                        dialog.ShowDialog();
                        _nextDemoState = Constants.ApplicationState.Softwares;
                    });
                    DemoStopped();
                    break;

                case Constants.ApplicationState.Softwares:
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        var dialog = new SoftwareList(_viewModel);
                        DemoStateHandler.Instance.DemoState = dialog;
                        dialog.ShowDialog();
                        _nextDemoState = Constants.ApplicationState.Subjects;
                    });
                    DemoStopped();
                    break;

                case Constants.ApplicationState.Subjects:
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        var dialog = new SubjectList(_viewModel);
                        DemoStateHandler.Instance.DemoState = dialog;
                        dialog.ShowDialog();
                        _nextDemoState = Constants.ApplicationState.Classrooms;
                    });
                    DemoStopped();
                    break;

                case Constants.ApplicationState.Classrooms:
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        var dialog = new ClassroomList(_viewModel);
                        DemoStateHandler.Instance.DemoState = dialog;
                        dialog.ShowDialog();
                        _nextDemoState = Constants.ApplicationState.SessionDetails;
                        DrawerHost.IsLeftDrawerOpen = false;
                    });
                    DemoStopped();
                    break;

                case Constants.ApplicationState.SessionDetails:
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        _viewModel.Classroom = _viewModel.Classrooms[0];
                        var startTime        = DateTime.Now.StartOfWeek().Date + new TimeSpan(7, 15, 0);
                        var session          = _viewModel.RemainingSessions[0];
                        var avaibleTerms     = _viewModel.GetAvailableTerms(null, startTime, session);
                        var dialog           = new SessionDetails(_viewModel, Schedule.Appointments, avaibleTerms, startTime,
                                                                  session);
                        DemoStateHandler.Instance.DemoState = dialog;
                        dialog.ShowDialog();
                        _nextDemoState = Constants.ApplicationState.ScheduleAdd;
                    });
                    if (DemoStopped())
                    {
                        return;
                    }
                    //if (DemoStopped()) return;
                    Application.Current.Dispatcher.Invoke(
                        () => { _viewModel.RemoveClassroom(DemoStateHandler.Instance.DemoClassroomId); });
                    DemoStateHandler.Instance.RemoveDemoEntities();
                    _viewModel.LastOpenedSchedule = null;
                    break;
                }
            });
        }
Esempio n. 8
0
 public void RemoveSoftware(string id)
 {
     SoftwareList.Remove(SoftwareList.First(s => s.Id == id));
     SoftwareDao.Remove(id);
 }
Esempio n. 9
0
        public SoftwareListViewModel()
        {
            var softwareList = SoftwareDao.FindAll();

            softwareList.ForEach(s => SoftwareList.Add(s));
        }