Exemplo n.º 1
0
 //private void ParsePublishersInformation(NotificationDetailsViewModel currentNode, List<ChannelComponent> availablePublishers)
 //{
 //    currentNode.NotificationDetailsCollection=new ObservableCollection<NotificationDetailsViewModel>();
 //    foreach(var publisher in availablePublishers)
 //    {
 //        var currentPublisherNode = new NotificationDetailsViewModel
 //                                       {
 //                                           Name = publisher.InstanceName,
 //                                           Type = ComponentType.Publisher,
 //                                           IsExpanded=true,
 //                                           TypeColor=Brushes.SeaGreen,
 //                                           Status=publisher.Status
 //                                       };
 //        currentNode.NotificationDetailsCollection.Add(currentPublisherNode);
 //        currentPublisherNode.NotificationDetailsCollection= new ObservableCollection<NotificationDetailsViewModel>();
 //        ParsePackagesInformation(currentPublisherNode.NotificationDetailsCollection, publisher.Packages,ComponentType.PublisherPackage);
 //        ParseSubscriberInformation(currentPublisherNode.NotificationDetailsCollection, publisher.DependentComponents);
 //    }
 //}
 //private void ParseSubscriberInformation(ObservableCollection<NotificationDetailsViewModel> notificationDetailsCollection, List<ChannelComponent> dependentComponents)
 //{
 //    foreach (var subscriber in dependentComponents)
 //    {
 //        var currentSubscriberNode = new NotificationDetailsViewModel
 //                                        {
 //                                            Name = subscriber.InstanceName,
 //                                            Type = ComponentType.Subscriber,
 //                                            IsExpanded=true,
 //                                            TypeColor=Brushes.SkyBlue,
 //                                            Status=subscriber.Status
 //                                        };
 //        notificationDetailsCollection.Add(currentSubscriberNode);
 //        currentSubscriberNode.NotificationDetailsCollection= new ObservableCollection<NotificationDetailsViewModel>();
 //        ParsePackagesInformation(currentSubscriberNode.NotificationDetailsCollection,subscriber.Packages,ComponentType.SubscriberPackage);
 //    }
 //}
 private void ParsePackagesInformation(ObservableCollection<NotificationDetailsViewModel> notificationDetailsCollection,
     List<Package> packages,ComponentType packageType)
 {
     if (packages != null)
     {
         foreach (var package in packages)
         {
             var currentPackageNode = new NotificationDetailsViewModel
                                          {
                                              Name = package.Id.ToString(),
                                              Type = packageType,
                                              State = Enum.GetName(typeof (State), package.State),
                                              TypeColor = Brushes.YellowGreen,
                                              IsExpanded=true
                                          };
             notificationDetailsCollection.Add(currentPackageNode);
             currentPackageNode.NotificationDetailsCollection= new ObservableCollection<NotificationDetailsViewModel>();
             //ParseMessagesInformation(currentPackageNode.NotificationDetailsCollection, package.PackageMessages);
         }
     }
 }
Exemplo n.º 2
0
 private void ParseDistributorInformation(ListAvailableChannelsResponse distributorInformation)
 {
     var currentNode = new NotificationDetailsViewModel
                           {Name = distributorInformation.Name, Type = ComponentType.Distributor,IsExpanded=true,TypeColor=Brushes.Peru};
     NotificationDetailsCollection.Add(currentNode);
     //ParsePublishersInformation(currentNode, distributorInformation.Channels);
 }