Example #1
0
        public void MoveSoftware(string direction)
        {
            int oldIndex = XMLSoftware.IndexOf(SelectedXMLSoftware);
            int newIndex;

            switch (direction)
            {
            case "top":
                newIndex = 0;
                break;

            case "up":
                newIndex = (oldIndex == 0) ? 0 : oldIndex - 1;
                break;

            case "down":
                newIndex = (oldIndex == (XMLSoftware.Count - 1)) ? XMLSoftware.Count - 1 : newIndex = oldIndex + 1;
                break;

            case "bottom":
                newIndex = XMLSoftware.Count - 1;
                break;

            default:
                newIndex = oldIndex;
                break;
            }
            XMLSoftware.Move(oldIndex, newIndex);
        }
Example #2
0
 public void AESubmit()
 {
     if (AEFunction == "Edit")
     {
         SelectedXMLSoftware.Id        = AEID;
         SelectedXMLSoftware.IncludeID = AEIncludeID;
         SelectedXMLSoftware.Label     = AELabel;
         if (AEType)
         {
             (SelectedXMLSoftware as Application).Name = AEName;
         }
         else
         {
             (SelectedXMLSoftware as Package).PkgId       = AEPkgID;
             (SelectedXMLSoftware as Package).ProgramName = AEProgramName;
         }
     }
     else
     {
         if (AEType)
         {
             Application app = new Application()
             {
                 Id        = AEID,
                 IncludeID = AEIncludeID,
                 Label     = AELabel,
                 Name      = AEName
             };
             XMLSoftware.Add(app);
         }
         else
         {
             Package pkg = new Package()
             {
                 Id          = AEID,
                 IncludeID   = AEIncludeID,
                 Label       = AELabel,
                 PkgId       = AEPkgID,
                 ProgramName = AEProgramName
             };
             XMLSoftware.Add(pkg);
         }
     }
     CanToggleType  = true;
     AddVisibleBool = false;
     eventAggregator.BeginPublishOnUIThread(new EventAggregators.ChangeUI("SoftwareChange", null));
 }
Example #3
0
 public void RemoveSoftware()
 {
     XMLSoftware.Remove(SelectedXMLSoftware);
 }