Merge branch 'client-csharp' of https://github.com/mattuylee/stormchat.git
This commit is contained in:
@@ -25,7 +25,7 @@ namespace StormChatWPF
|
|||||||
public LogWindow()
|
public LogWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Instence = this;
|
Instence = this;
|
||||||
}
|
}
|
||||||
private void Login_button_Click(object sender, RoutedEventArgs e)
|
private void Login_button_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
<ScrollViewer.Content>
|
<ScrollViewer.Content>
|
||||||
<StackPanel x:Name="OutBox" Margin="0,0,0,0" Grid.ColumnSpan="3" Grid.Column="1" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
|
<StackPanel x:Name="OutBox" Margin="0,0,0,0" Grid.ColumnSpan="3" Grid.Column="1" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
|
||||||
</ScrollViewer.Content>
|
</ScrollViewer.Content>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
<Button x:Name="button" Content="Button" Grid.Column="2" HorizontalAlignment="Left" Margin="73,31,0,0" Grid.Row="2" VerticalAlignment="Top" Width="75" Click="button_Click_1"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,17 +1,8 @@
|
|||||||
using Interact;
|
using Interact;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
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 StormChatWPF
|
namespace StormChatWPF
|
||||||
{
|
{
|
||||||
@@ -65,7 +56,7 @@ namespace StormChatWPF
|
|||||||
if (message.To == User.Me)
|
if (message.To == User.Me)
|
||||||
{
|
{
|
||||||
App.Current.Dispatcher.Invoke(
|
App.Current.Dispatcher.Invoke(
|
||||||
delegate ()
|
(Action)delegate()
|
||||||
{
|
{
|
||||||
OutBox.Children.Add(new ChatBubble(message,HorizontalAlignment.Left));
|
OutBox.Children.Add(new ChatBubble(message,HorizontalAlignment.Left));
|
||||||
});
|
});
|
||||||
@@ -73,11 +64,20 @@ namespace StormChatWPF
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
App.Current.Dispatcher.Invoke(
|
App.Current.Dispatcher.Invoke(
|
||||||
delegate ()
|
(Action)delegate()
|
||||||
{
|
{
|
||||||
OutBox.Children.Add(new ChatBubble(message,HorizontalAlignment.Right));
|
OutBox.Children.Add(new ChatBubble(message, HorizontalAlignment.Right));
|
||||||
});
|
});
|
||||||
}//发送的的消息
|
}//发送的的消息
|
||||||
}//将消息展现于UI界面
|
}//将消息展现于UI界面
|
||||||
|
|
||||||
|
private void button_Click_1(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
App.Current.Dispatcher.Invoke(
|
||||||
|
(Action)delegate ()
|
||||||
|
{
|
||||||
|
OutBox.Children.Add(new HeadPicture());
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,124 +1,133 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}</ProjectGuid>
|
<ProjectGuid>{CF4D6BE0-A862-401F-A3A6-4FDAC32F5B70}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>StormChatWPF</RootNamespace>
|
<RootNamespace>StormChatWPF</RootNamespace>
|
||||||
<AssemblyName>StormChatWPF</AssemblyName>
|
<AssemblyName>StormChatWPF</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<StartupObject>StormChatWPF.App</StartupObject>
|
<StartupObject>StormChatWPF.App</StartupObject>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="System.Xaml">
|
<Reference Include="System.Xaml">
|
||||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ApplicationDefinition Include="App.xaml">
|
<ApplicationDefinition Include="App.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Compile Include="Chat.cs" />
|
<Compile Include="Chat.cs" />
|
||||||
<Compile Include="MainWindow.xaml.cs">
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ScrollViewer.cs" />
|
<Compile Include="ScrollViewer.cs" />
|
||||||
<Compile Include="UI\ChatBubble.cs" />
|
<Compile Include="UI\ChatBubble.cs" />
|
||||||
<Page Include="LogWindow.xaml">
|
<Compile Include="UI\HeadPicture.cs" />
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Compile Include="UI\UserInfo.cs" />
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="Window1.xaml.cs">
|
||||||
</Page>
|
<DependentUpon>Window1.xaml</DependentUpon>
|
||||||
<Compile Include="App.xaml.cs">
|
</Compile>
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<Page Include="LogWindow.xaml">
|
||||||
<SubType>Code</SubType>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Compile>
|
<SubType>Designer</SubType>
|
||||||
<Compile Include="LogWindow.xaml.cs">
|
</Page>
|
||||||
<DependentUpon>LogWindow.xaml</DependentUpon>
|
<Compile Include="App.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
<SubType>Code</SubType>
|
||||||
<Page Include="MainWindow.xaml">
|
</Compile>
|
||||||
<SubType>Designer</SubType>
|
<Compile Include="LogWindow.xaml.cs">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<DependentUpon>LogWindow.xaml</DependentUpon>
|
||||||
</Page>
|
<SubType>Code</SubType>
|
||||||
</ItemGroup>
|
</Compile>
|
||||||
<ItemGroup>
|
<Page Include="MainWindow.xaml">
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
<SubType>Designer</SubType>
|
||||||
<SubType>Code</SubType>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Compile>
|
</Page>
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
<Page Include="Window1.xaml">
|
||||||
<AutoGen>True</AutoGen>
|
<SubType>Designer</SubType>
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
</Page>
|
||||||
</Compile>
|
</ItemGroup>
|
||||||
<None Include="Properties\Settings.settings">
|
<ItemGroup>
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<SubType>Code</SubType>
|
||||||
</None>
|
</Compile>
|
||||||
</ItemGroup>
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
<ItemGroup>
|
<AutoGen>True</AutoGen>
|
||||||
<None Include="App.config" />
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
</ItemGroup>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<ItemGroup>
|
</Compile>
|
||||||
<ProjectReference Include="..\Interact\Interact.csproj">
|
<None Include="Properties\Settings.settings">
|
||||||
<Project>{cef054af-95b7-4b88-934e-02705feea554}</Project>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<Name>Interact</Name>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
</ProjectReference>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="UI\Resources\登录界面底.png" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="UI\Resources\闪电.png" />
|
<ProjectReference Include="..\Interact\Interact.csproj">
|
||||||
</ItemGroup>
|
<Project>{cef054af-95b7-4b88-934e-02705feea554}</Project>
|
||||||
<ItemGroup>
|
<Name>Interact</Name>
|
||||||
<Resource Include="UI\Resources\聊天气泡.png" />
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<Resource Include="UI\Resources\登录界面底.png" />
|
||||||
<SubType>Designer</SubType>
|
</ItemGroup>
|
||||||
</EmbeddedResource>
|
<ItemGroup>
|
||||||
</ItemGroup>
|
<Resource Include="UI\Resources\闪电.png" />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="UI\Resources\聊天气泡.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Media;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace StormChatWPF
|
||||||
|
{
|
||||||
|
class HeadPicture : Image
|
||||||
|
{
|
||||||
|
public HeadPicture(/*Stream imgstream*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
FileStream fileStream = new FileStream(@"C:\Users\Administrator\Desktop\闪电.png", FileMode.Open);
|
||||||
|
|
||||||
|
Source = new BitmapImage()
|
||||||
|
{
|
||||||
|
StreamSource = fileStream
|
||||||
|
};
|
||||||
|
//border.Content = this;
|
||||||
|
}
|
||||||
|
private Label border = new Label()
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using Interact;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace StormChatWPF
|
||||||
|
{
|
||||||
|
class UserInfo:Label
|
||||||
|
{
|
||||||
|
public UserInfo(User user)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
private Image headpicture = new Image
|
||||||
|
{
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Left
|
||||||
|
};
|
||||||
|
private TextBlock UserNmae=new TextBlock
|
||||||
|
{
|
||||||
|
FontFamily = new FontFamily("Comic Sans MS"),
|
||||||
|
HorizontalAlignment = HorizontalAlignment.Right,
|
||||||
|
VerticalAlignment=VerticalAlignment.Top
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<Window x:Class="StormChatWPF.Window1"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:StormChatWPF"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="Window1" Height="300" Width="300">
|
||||||
|
<Grid>
|
||||||
|
<Label x:Name="label" HorizontalAlignment="Left" Margin="76,101,0,0" VerticalAlignment="Top" Width="86" Height="41">
|
||||||
|
<Image x:Name="image" Height="31" Width="36" Source="UI/Resources/闪电.png" Margin="0,0,0,0" HorizontalAlignment="Left" RenderTransformOrigin="0.553,0.5" VerticalAlignment="Center">
|
||||||
|
<Image.OpacityMask>
|
||||||
|
<ImageBrush ImageSource="UI/Resources/聊天气泡.png"/>
|
||||||
|
</Image.OpacityMask>
|
||||||
|
</Image>
|
||||||
|
</Label>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
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 StormChatWPF
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Window1.xaml 的交互逻辑
|
||||||
|
/// </summary>
|
||||||
|
public partial class Window1 : Window
|
||||||
|
{
|
||||||
|
public Window1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user