Skip to content

Instantly share code, notes, and snippets.

@jflam
Created May 18, 2009 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jflam/113483 to your computer and use it in GitHub Desktop.
Save jflam/113483 to your computer and use it in GitHub Desktop.
Index: Witty/Witty/ConsoleWindow.xaml
===================================================================
--- Witty/Witty/ConsoleWindow.xaml (revision 0)
+++ Witty/Witty/ConsoleWindow.xaml (revision 0)
@@ -0,0 +1,15 @@
+<Window x:Class="Witty.ConsoleWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:core="clr-namespace:Core;assembly=Core"
+ Title="ConsoleWindow" Height="800" Width="500">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <core:Repl Name="MainRepl" Grid.Row="0" Grid.Column="0" />
+ </Grid>
+</Window>
Index: Witty/Witty/ConsoleWindow.xaml.cs
===================================================================
--- Witty/Witty/ConsoleWindow.xaml.cs (revision 0)
+++ Witty/Witty/ConsoleWindow.xaml.cs (revision 0)
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace Witty {
+ /// <summary>
+ /// Interaction logic for ConsoleWindow.xaml
+ /// </summary>
+ public partial class ConsoleWindow : Window {
+ public ConsoleWindow() {
+ InitializeComponent();
+ }
+ }
+}
Index: Witty/Witty/MainWindow.xaml
===================================================================
--- Witty/Witty/MainWindow.xaml (revision 468)
+++ Witty/Witty/MainWindow.xaml (working copy)
@@ -61,6 +61,8 @@
<Border Name="WindowButtonsPlaceholder" HorizontalAlignment="Right" VerticalAlignment="Top" DockPanel.Dock="Right" Margin="0" />
<Button Content="Refresh" Height="15" x:Name="RefreshButton" Click="RefreshButton_Click" IsEnabled="False" MinWidth="25" MinHeight="20" FontSize="9" DockPanel.Dock="Right" Margin="0,0,10,0" Width="50" ToolTip="Refresh Tweets" />
<Button Content="Options" Height="15" x:Name="OptionsButton" Click="OptionsButton_Click" MinWidth="25" MinHeight="20" FontSize="9" DockPanel.Dock="Right" Margin="0,0,5,0" IsEnabled="True" Width="50" ToolTip="Show Options Window" />
+ <Button Content="Console" Height="20" x:Name="ConsoleButton" Click="ConsoleButton_Click" MinWidth="25" MinHeight="20" FontSize="9" DockPanel.Dock="Right" Margin="0,0,10,0" IsEnabled="True" Width="50" ToolTip="Show Console Window" />
+
<ToggleButton Content="Filter" Height="25" x:Name="FilterToggleButton" MinWidth="25" MinHeight="20" FontSize="9" IsEnabled="False" Width="55" ToolTip="Display Filter Panel" DockPanel.Dock="Right" BorderThickness="1,1,1,1" Margin="0,0,10,0" IsChecked="False" Unchecked="FilterToggleButton_Unchecked" Background="{DynamicResource NormalBrush}" Foreground="{DynamicResource LightBrush}" BorderBrush="{DynamicResource NormalBorderBrush}" Visibility="Collapsed">
<ToggleButton.Clip>
<RectangleGeometry Rect="3,3,50,20" RadiusX="5" RadiusY="5" />
Index: Witty/Witty/MainWindow.xaml.cs
===================================================================
--- Witty/Witty/MainWindow.xaml.cs (revision 468)
+++ Witty/Witty/MainWindow.xaml.cs (working copy)
@@ -1178,7 +1178,7 @@
#region User Timeline
- private void DelegateUserTimelineFetch(string userId)
+ public void DelegateUserTimelineFetch(string userId)
{
displayUser = userId;
@@ -1980,6 +1980,14 @@
ShowOptions();
}
+ private void ConsoleButton_Click(object sender, RoutedEventArgs e)
+ {
+ var console = new ConsoleWindow();
+ console.MainRepl.AddExternalObject("T", twitter);
+ console.MainRepl.AddExternalObject("U", this);
+ console.Show();
+ }
+
private void ShowOptions()
{
Options options = new Options();
Index: Witty/Witty/ReplResources.xaml
===================================================================
--- Witty/Witty/ReplResources.xaml (revision 0)
+++ Witty/Witty/ReplResources.xaml (revision 0)
@@ -0,0 +1,49 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+ <Style x:Key="NumericLiteral">
+ <Setter Property="Control.Foreground" Value="#FFEE98" />
+ </Style>
+ <Style x:Key="Keyword">
+ <Setter Property="Control.Foreground" Value="#FF6600" />
+ </Style>
+ <Style x:Key="Identifier">
+ <Setter Property="Control.Foreground" Value="#FFCC00" />
+ </Style>
+ <Style x:Key="StringLiteral">
+ <Setter Property="Control.Foreground" Value="#66FF00" />
+ </Style>
+ <Style x:Key="Comment">
+ <Setter Property="Control.Foreground" Value="#9933CC" />
+ </Style>
+ <Style x:Key="Error">
+ <Setter Property="Control.Foreground" Value="#FF0000" />
+ </Style>
+ <Style x:Key="None">
+ <Setter Property="Control.Foreground" Value="#FFFFFF" />
+ </Style>
+ <Style x:Key="TextStyle">
+ <Setter Property="Control.FontFamily" Value="Consolas" />
+ <Setter Property="Control.Foreground" Value="White" />
+ <Setter Property="Control.Background" Value="Black" />
+ <Setter Property="Control.FontSize" Value="20" />
+ </Style>
+ <Style x:Key="WindowStyle">
+ <Setter Property="Control.Background" Value="Black" />
+ <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
+ </Style>
+ <Style TargetType="{x:Type ListBoxItem}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type ListBoxItem}">
+ <TextBlock Name="TheBGControl"><ContentPresenter /></TextBlock>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsSelected" Value="True">
+ <Setter Property="Foreground" Value="Black" TargetName="TheBGControl" />
+ <Setter Property="Background" Value="Yellow" TargetName="TheBGControl" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary>
\ No newline at end of file
Index: Witty/Witty/Witty.csproj
===================================================================
--- Witty/Witty/Witty.csproj (revision 468)
+++ Witty/Witty/Witty.csproj (working copy)
@@ -66,6 +66,10 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\core.dll</HintPath>
+ </Reference>
<Reference Include="CustomWindow, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ExternalDependencies\CustomWindow.dll</HintPath>
@@ -86,6 +90,22 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ExternalDependencies\Growl.CoreLibrary.dll</HintPath>
</Reference>
+ <Reference Include="IronPython, Version=2.6.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\IronPython.dll</HintPath>
+ </Reference>
+ <Reference Include="IronPython.Modules, Version=2.6.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\IronPython.Modules.dll</HintPath>
+ </Reference>
+ <Reference Include="IronRuby, Version=0.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\IronRuby.dll</HintPath>
+ </Reference>
+ <Reference Include="IronRuby.Libraries, Version=0.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\IronRuby.Libraries.dll</HintPath>
+ </Reference>
<Reference Include="J832.Common, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ExternalDependencies\BagOfTricks\J832.Common.dll</HintPath>
@@ -98,6 +118,22 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\ExternalDependencies\log4net.dll</HintPath>
</Reference>
+ <Reference Include="Microsoft.Dynamic, Version=0.9.5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\Microsoft.Dynamic.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Scripting, Version=0.9.5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\Microsoft.Scripting.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Scripting.Core, Version=0.9.5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\Microsoft.Scripting.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Scripting.ExtensionAttribute, Version=0.9.5.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\Libs\Microsoft.Scripting.ExtensionAttribute.dll</HintPath>
+ </Reference>
<Reference Include="mscorlib" />
<Reference Include="Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -133,6 +169,10 @@
<Reference Include="System.ServiceModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.IdentityModel" />
+ <Page Include="ConsoleWindow.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Controls\Options\AboutOptions.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -157,6 +197,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <None Include="ReplResources.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
<Page Include="Resources\Storyboards.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -204,6 +249,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
+ <Compile Include="ConsoleWindow.xaml.cs">
+ <DependentUpon>ConsoleWindow.xaml</DependentUpon>
+ </Compile>
<Compile Include="Controls\Options\AboutOptions.xaml.cs">
<DependentUpon>AboutOptions.xaml</DependentUpon>
</Compile>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment