Esempio n. 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Window f = new auth();

            f.ShowDialog();
            update_account();
        }
Esempio n. 2
0
        private void tweetWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //インターネット接続確認
            if (Internet_Check())
            {
                //bmp読み込み
                //http://neareal.net/index.php?Programming%2F.NetFramework%2FWPF%2FWriteableBitmap%2FLoadReleaseableBitmapImage
                MemoryStream    data = new MemoryStream(File.ReadAllBytes(filepath));
                WriteableBitmap wbmp = new WriteableBitmap(BitmapFrame.Create(data));
                data.Close();

                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource = wbmp;
                imageBrush.Stretch     = Stretch.Uniform;
                tweetWindow.Background = imageBrush;

                if (Properties.Settings.Default.AccessToken == "")
                {
                    Window f = new auth();
                    f.ShowDialog();
                }
                update_account();
            }
            else
            {
                MessageBox.Show("このアプリケーションをオフラインで使用することはできません。終了します。", "エラー", MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
                Application.Current.Shutdown();
            }
        }