Esempio n. 1
0
        private void UpdateButton_Click(object sender, RoutedEventArgs e)
        {
            string selectedFileName = string.Empty;

            if (imageFilesGrid.SelectedItem != null)
            {
                selectedFileName = ((ImageFileData)imageFilesGrid.SelectedItem).FileName;
            }

            model.ImagesFileData = new ObservableCollection <ImageFileData>(manager.GetAllImagesInfo(false));

            if (selectedFileName != string.Empty)
            {
                ImageFileData rowObject = model.ImagesFileData.SingleOrDefault(p => p.FileName.Equals(selectedFileName));
                if (rowObject != null)
                {
                    int index = model.ImagesFileData.IndexOf(rowObject);
                    imageFilesGrid.ScrollIntoView(imageFilesGrid.Items[index]);
                    DataGridRow row = (DataGridRow)imageFilesGrid.ItemContainerGenerator.ContainerFromIndex(index);
                    row.IsSelected = true;
                }
            }
        }
    protected void ResetConnection_Click(object sender, EventArgs e)
    {
        ChannelFactory <IImageService> ChannelFactory;
        IClientNotifier Notyfier = new WebNotifier();
        IImageService   channel  = null;

        try
        {
            ChannelFactory = new ChannelFactory <IImageService>("streamingBinding");
            channel        = ChannelFactory.CreateChannel();
        }
        catch (Exception)
        {
            Notyfier.Error("Can't create client channel!");
            return;
        }
        ImageServiceClientManager   Manager        = new ImageServiceClientManager(channel, Notyfier, null);
        IEnumerable <ImageFileData> ImagesFileData = Manager.GetAllImagesInfo(false);

        Session["Manager"]        = Manager;
        Session["ImagesFileData"] = ImagesFileData;
    }