Click here to Skip to main content
15,897,371 members
Articles / Desktop Programming / WPF

Reflection Studio - Part 1 - Introduction: Architecture and Design

Rate me:
Please Sign up or sign in to vote.
4.83/5 (23 votes)
22 Sep 2010GPL36 min read 60.1K   6.9K   111  
Reflection Studio is a "developer" application for assembly, database, performance, and code generation, written in C# under WPF 4.0.
<UserControl x:Class="ReflectionStudio.Components.UserControls.AssemblyDetail"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
    >
    <UserControl.Resources>
        <ResourceDictionary>
            
        <Style x:Key="TreeViewItemStyle" TargetType="TreeViewItem">
            <Setter Property="IsExpanded" Value="False" />
            <Setter Property="KeyboardNavigation.AcceptsReturn" Value="True" />
            <Setter Property="Controls:VirtualToggleButton.IsVirtualToggleButton" Value="True" />
            <Setter Property="Controls:VirtualToggleButton.IsChecked" Value="{Binding IsChecked}" />
        </Style>

            <HierarchicalDataTemplate  x:Key="CheckBoxItemTemplate" ItemsSource="{Binding Children, Mode=TwoWay}" >
                <StackPanel Orientation="Horizontal">
                    <CheckBox Focusable="False" VerticalAlignment="Center"
                        IsChecked="{Binding IsChecked}" />
                    <ContentPresenter Margin="2,0"
                        Content="{Binding DisplayName, Mode=OneWay}" />
                </StackPanel>
            </HierarchicalDataTemplate>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid Margin="5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Controls:StandaloneHeader Image="/ReflectionStudio;component/Resources/Images/32x32/assembly.png" 
            Title="{Binding ElementName=AssemblyComboBox, Path=SelectedItem.Name, StringFormat=Assembly details: \{0:S\}}" 
            Description="Assembly details display all class and function inside an assembly. Choose what to inject..." 
            Grid.ColumnSpan="2"/>
        
        <ComboBox Name="AssemblyComboBox" Grid.ColumnSpan="2" Height="22" VerticalAlignment="Top" HorizontalAlignment="Right"
                  ItemsSource="{Binding Project.Assemblies}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True" />
        
        <GroupBox Margin="5" Grid.Row="1"  Header="Assembly content" x:Name="groupBox1"
                  DataContext="{Binding ElementName=AssemblyComboBox, Path=SelectedItem}">
            
                <TreeView Name="treeViewAssembly" Margin="5"
                          DataContext="{Binding Path=Children}"
                          ItemContainerStyle="{StaticResource TreeViewItemStyle}"
                          ItemsSource="{Binding Mode=OneTime}"
                          ItemTemplate="{StaticResource CheckBoxItemTemplate}"/>
        </GroupBox>
        <GridSplitter Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" Width="4"></GridSplitter>
        <GroupBox Margin="5" Grid.Row="1" Grid.Column="2" Header="Details" x:Name="groupBox2"
                  DataContext="{Binding ElementName=AssemblyComboBox, Path=SelectedItem}">
            
            <StackPanel Orientation="Vertical">
               <TextBlock Text="Original values" ></TextBlock>
               <Grid Margin="5" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="110" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Vertical" Grid.Column="0">
                        <TextBlock Text="Version" ></TextBlock>
                        <TextBlock Text="Size" ></TextBlock>
                        <TextBlock Text="Culture" ></TextBlock>
                        <TextBlock Text="PublicKey" ></TextBlock>
                        <TextBlock Text="PublicKeyToken" ></TextBlock>
                        <TextBlock Text="Hash" ></TextBlock>
                        <TextBlock Text="HashAlgorithm" ></TextBlock>
                        <TextBlock Text="Main module" ></TextBlock>
                        <TextBlock Text="Entry point" ></TextBlock>
                        <TextBlock Text="Target runtime" ></TextBlock>
                        <TextBlock Text="Kind" ></TextBlock>
                        <TextBlock Text="Class count" ></TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Grid.Column="1">
                        <TextBlock Text="{Binding Version, Mode=OneTime}" TextWrapping="Wrap"></TextBlock>
                        <TextBlock Text="{Binding Size, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding Culture, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding PublicKey, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding PublicKeyToken, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding Hash, Mode=OneTime}"  TextWrapping="Wrap"></TextBlock>
                        <TextBlock Text="{Binding HashAlgorithm, Mode=OneTime}"  TextWrapping="Wrap"></TextBlock>
                        <TextBlock Text="{Binding Name, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding EntryPoint, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding TargetRuntime, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding Kind, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding Children.Count, Mode=OneTime}" ></TextBlock>
                    </StackPanel>
                </Grid>
                <TextBlock Text="Build values" ></TextBlock>
                <Grid Margin="5" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <StackPanel Orientation="Vertical" Grid.Column="0">
                        <TextBlock Text="Size" ></TextBlock>
                        <TextBlock Text="Profiled class" ></TextBlock>
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Grid.Column="1">
                        <TextBlock Text="{Binding Size, Mode=OneTime}" ></TextBlock>
                        <TextBlock Text="{Binding Children.Count, Mode=OneTime}" ></TextBlock>
                    </StackPanel>
                </Grid>
            </StackPanel>
        </GroupBox>
    </Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Architect
France France
WPF and MVVM fan, I practice C # in all its forms from the beginning of the NET Framework without mentioning C ++ / MFC and other software packages such as databases, ASP, WCF, Web & Windows services, Application, and now Core and UWP.
In my wasted hours, I am guilty of having fathered C.B.R. and its cousins C.B.R. for WinRT and UWP on the Windows store.
But apart from that, I am a great handyman ... the house, a rocket stove to heat the jacuzzi and the last one: a wood oven for pizza, bread, and everything that goes inside

https://guillaumewaser.wordpress.com/
https://fouretcompagnie.wordpress.com/

Comments and Discussions