Ejemplo n.º 1
0
 public void ReadFromConfiguration(IConfigurationObject configurationObject)
 {
     for (int index = 0; index < this.Items.Count; ++index)
     {
         ExpandoListItemModel expandoListItemModel = this.Items[index] as ExpandoListItemModel;
         if (expandoListItemModel != null)
         {
             IConfigurationObject configurationObject1 = (IConfigurationObject)configurationObject.GetProperty(expandoListItemModel.Identifier);
             if (configurationObject1 != null)
             {
                 expandoListItemModel.ReadFromConfiguration(configurationObject1);
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void WriteToConfiguration(IConfigurationObject configurationObject)
 {
     for (int index = 0; index < this.Items.Count; ++index)
     {
         ExpandoListItemModel expandoListItemModel = this.Items[index] as ExpandoListItemModel;
         if (expandoListItemModel != null)
         {
             IConfigurationObject configurationObject1 = (IConfigurationObject)configurationObject.GetProperty(expandoListItemModel.Identifier);
             if (configurationObject1 == null)
             {
                 configurationObject1 = configurationObject.CreateConfigurationObject();
                 configurationObject.SetProperty(expandoListItemModel.Identifier, (object)configurationObject1);
             }
             expandoListItemModel.WriteToConfiguration(configurationObject1);
         }
     }
 }
Ejemplo n.º 3
0
        private void UpdateGrid()
        {
            Grid grid = this.GetTemplateChild("PART_MainGrid") as Grid;
            bool flag = this.Orientation == Orientation.Vertical;

            if (grid == null)
            {
                return;
            }
            this.previousGrid = grid;
            foreach (FrameworkElement frameworkElement in grid.Children)
            {
                ExpandoListItem expandoListItem = frameworkElement as ExpandoListItem;
                if (expandoListItem != null)
                {
                    expandoListItem.Content = (object)null;
                }
            }
            grid.Children.Clear();
            grid.ColumnDefinitions.Clear();
            grid.RowDefinitions.Clear();
            int num = 0;

            for (int index = 0; index < this.Items.Count; ++index)
            {
                ExpandoListItemModel expandoListItemModel = this.Items[index] as ExpandoListItemModel;
                if (expandoListItemModel == null || !expandoListItemModel.IsForcedInvisible)
                {
                    ExpandoListItem expandoListItem = new ExpandoListItem();
                    expandoListItem.SetValue(AutomationElement.IdProperty, (object)("Expando_Item_" + (object)index));
                    expandoListItem.DataContext = (object)expandoListItemModel;
                    expandoListItem.Style       = this.ExpandoListItemStyle;
                    if (flag)
                    {
                        Grid.SetRow((UIElement)expandoListItem, num);
                    }
                    else
                    {
                        Grid.SetColumn((UIElement)expandoListItem, num);
                    }
                    grid.Children.Add((UIElement)expandoListItem);
                    if (flag)
                    {
                        RowDefinition rowDefinition = new RowDefinition();
                        rowDefinition.DataContext = (object)expandoListItemModel;
                        rowDefinition.Style       = this.ExpandoDefinitionStyle;
                        grid.RowDefinitions.Add(rowDefinition);
                    }
                    else
                    {
                        ColumnDefinition columnDefinition = new ColumnDefinition();
                        columnDefinition.DataContext = (object)expandoListItemModel;
                        columnDefinition.Style       = this.ExpandoDefinitionStyle;
                        grid.ColumnDefinitions.Add(columnDefinition);
                    }
                    if (grid.Children.Count > 1)
                    {
                        ExpandoSplitter expandoSplitter = new ExpandoSplitter();
                        expandoSplitter.SetValue(AutomationElement.IdProperty, (object)("Expando_Splitter_" + (object)index));
                        expandoSplitter.Style = this.ExpandoSplitterStyle;
                        if (flag)
                        {
                            expandoSplitter.VerticalAlignment = VerticalAlignment.Top;
                            Grid.SetRow((UIElement)expandoSplitter, num);
                        }
                        else
                        {
                            expandoSplitter.HorizontalAlignment = HorizontalAlignment.Left;
                            Grid.SetColumn((UIElement)expandoSplitter, num);
                        }
                        grid.Children.Add((UIElement)expandoSplitter);
                    }
                    ++num;
                }
            }
        }