Example #1
0
        public static UIpp GenerateUIpp(XmlDocument xmlDoc, string path)
        {
            UIpp uipp = new UIpp();

            // Set Attributes
            XmlElement uippNode = xmlDoc.DocumentElement;

            if (!string.IsNullOrEmpty(uippNode.GetAttribute("AlwaysOnTop")))
            {
                uipp.AlwaysOnTop = Convert.ToBoolean(uippNode.GetAttribute("AlwaysOnTop"));
            }
            else
            {
                uipp.AlwaysOnTop = true;
            }
            uipp.Color = uippNode.GetAttribute("Color");
            if (!string.IsNullOrEmpty(uippNode.GetAttribute("DialogSidebar")))
            {
                uipp.DialogSidebar = Convert.ToBoolean(uippNode.GetAttribute("DialogSidebar"));
            }
            else
            {
                uipp.DialogSidebar = true;
            }
            if (!string.IsNullOrEmpty(uippNode.GetAttribute("Flat")))
            {
                uipp.Flat = Convert.ToBoolean(uippNode.GetAttribute("Flat"));
            }
            else
            {
                uipp.Flat = false;
            }
            uipp.Icon = uippNode.GetAttribute("Icon");
            if (!string.IsNullOrEmpty(uippNode.GetAttribute("RootXMLPath")))
            {
                uipp.RootXMLPath = uippNode.GetAttribute("RootXMLPath");
            }
            else
            {
                uipp.RootXMLPath = Path.GetDirectoryName(path);
            }
            uipp.Title = uippNode.GetAttribute("Title");

            // Add Messages Node
            XmlNode mNode = xmlDoc.SelectSingleNode("/UIpp/Messages");

            uipp.Messages = GetMessagesNode(mNode);

            // Add Software Node
            XmlNode swNode = xmlDoc.SelectSingleNode("/UIpp/Software");

            uipp.Software = GetSoftwareNode(swNode);

            // Add Actions Node
            XmlNode aNode = xmlDoc.SelectSingleNode("/UIpp/Actions");

            uipp.Actions = GetActionsNode(aNode);

            return(uipp);
        }
Example #2
0
 private void NewXML()
 {
     uipp = new UIpp();
     _actionsViewModel       = new Menus.ActionsViewModel(_eventAggregator, uipp);
     _settingsViewModel      = new Menus.SettingsViewModel();
     _configurationViewModel = new Menus.ConfigurationViewModel(_eventAggregator, uipp);
     _softwareViewModel      = new Menus.SoftwareViewModel(uipp, _settingsViewModel);
     _statusMessageViewModel = new Menus.StatusMessageViewModel(uipp);
     _settingsViewModel.svm  = _softwareViewModel;
     _configurationViewModel.RefreshConfiguration();
     _softwareViewModel.RefreshSoftwareList();
 }
Example #3
0
        public SoftwareViewModel(UIpp uipp, SettingsViewModel sv)
        {
            UIpp                                = uipp;
            SV                                  = sv;
            ConfigMgrServer                     = SV.SettingsCMFQDN + " (" + SV.SettingsSiteCode + ")";
            AvailableSoftwareViewSource         = new CollectionViewSource();
            AvailableSoftwareViewSource.Filter += AvailableApplicationsFilter;
            Globals.SoftwareViewModel           = this;
            eventAggregator                     = Globals.EventAggregator;

            RefreshSynchronizationData();
        }
Example #4
0
        public ActionsViewModel(IEventAggregator ea, UIpp uipp)
        {
            _eventAggregator = ea;
            _eventAggregator.Subscribe(this);
            Globals.EventAggregator = ea;
            UIpp = uipp;

            FontFamilies = new List <string>();
            foreach (FontFamily f in Fonts.SystemFontFamilies)
            {
                FontFamilies.Add(f.Source);
            }

            ActionsTreeView = UIpp.Actions.actions;
        }
Example #5
0
        private void LoadXML(string path)
        {
            // Load XML
            XmlDocument load = new XmlDocument();

            load.Load(path);

            // Convert XML to UIpp
            uipp = XMLToClassModel.GenerateUIpp(load, path);

            // Reload Children
            _actionsViewModel         = new Menus.ActionsViewModel(_eventAggregator, uipp);
            _configurationViewModel   = new Menus.ConfigurationViewModel(_eventAggregator, uipp);
            _softwareViewModel        = new Menus.SoftwareViewModel(uipp, _settingsViewModel);
            Globals.SoftwareViewModel = _softwareViewModel;
            _statusMessageViewModel   = new Menus.StatusMessageViewModel(uipp);
            _softwareViewModel.RefreshSoftwareList();
            _configurationViewModel.RefreshConfiguration();
            Globals.EventAggregator.BeginPublishOnUIThread(new ChangeUI("ImportComplete", null));
            Globals.EventAggregator.BeginPublishOnUIThread(new ChangeUI("SoftwareChange", null));
            Globals.EventAggregator.BeginPublishOnUIThread(new ChangeUI("AppTreeChange", null));
        }
Example #6
0
 public ConfigurationViewModel(IEventAggregator ea, UIpp uipp)
 {
     _eventAggregator = ea;
     UIpp             = uipp;
     ConfigFont       = "Tahoma";
 }
Example #7
0
 public StatusMessageViewModel(UIpp u)
 {
     uipp = u;
     StatusMessageDataGrid = uipp.Messages.MessageCollection;
 }