Ejemplo n.º 1
0
 private void BT_Write_Click(object sender, RoutedEventArgs e)
 {
     if (!IsLoggedIn && !IsOffline)
     {
         GlobalHelper.ShowOfflineMessage();
     }
     else
     {
         if (StoryWriteWindow == null)
         {
             StoryWriteWindow = new StoryWriteWindow();
             StoryWriteWindow.Show();
             //storyWriteWindow.Activate();
         }
         else
         {
             StoryWriteWindow.Show();
             StoryWriteWindow.Activate();
         }
     }
 }
Ejemplo n.º 2
0
        public StoryWriteWindow()
        {
            InitializeComponent();
            instance = this;
            isEdit   = false;

            MainWindow.SetClickObject(BT_Link);
            MainWindow.SetClickObject(BT_LinkShow);
            MainWindow.SetClickObject(BT_Pic);
            MainWindow.SetClickObject(BT_WithFriend);
            MainWindow.SetClickObject(BT_QuoteFriend);
            MainWindow.SetClickObject(BT_Menu);
            if (!Properties.Settings.Default.DefaultFriendOnly)
            {
                ComboRange.SelectedIndex = 0;
            }
            else
            {
                ComboRange.SelectedIndex = 1;
            }
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ContextIdle, new Action(() => TB_Main.Focus()));
            isInit = true;

            if (!Properties.Settings.Default.AutoPicDir.Equals("DOGE"))
            {
                try
                {
                    string[] files = Directory.GetFiles(Properties.Settings.Default.AutoPicDir);
                    foreach (string path in files)
                    {
                        AddAsset(path);
                    }
                    ValidatePanelHeight();
                }
                catch (Exception)
                {
                    ValidatePanelHeight();
                }
            }
        }
Ejemplo n.º 3
0
        public StoryWriteWindow(string feedID, bool isAllRead)
        {
            InitializeComponent();
            instance               = this;
            BT_Pic.IsEnabled       = false;
            BT_Pic.Foreground      = Brushes.LightGray;
            BT_LinkShow.IsEnabled  = false;
            BT_LinkShow.Foreground = Brushes.LightGray;
            BT_Link.IsEnabled      = false;

            isEdit      = false;
            isShare     = true;
            shareFeedID = feedID;
            Title       = "글 공유하기";
            TextBoxHelper.SetWatermark(TB_Main, "친구들에게 공유할 내용을 적어주세요");

            MainWindow.SetClickObject(BT_Link);
            MainWindow.SetClickObject(BT_LinkShow);
            MainWindow.SetClickObject(BT_Pic);
            MainWindow.SetClickObject(BT_WithFriend);
            MainWindow.SetClickObject(BT_QuoteFriend);
            MainWindow.SetClickObject(BT_Menu);

            if (!Properties.Settings.Default.DefaultFriendOnly)
            {
                ComboRange.SelectedIndex = 0;
            }
            else
            {
                ComboRange.SelectedIndex = 1;
            }

            if (!isAllRead)
            {
                CBI_All.Visibility       = Visibility.Collapsed;
                ComboRange.SelectedIndex = 1;
            }
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ContextIdle, new Action(() => TB_Main.Focus()));
            isInit = true;
        }
Ejemplo n.º 4
0
        public StoryWriteWindow(string feedID, string text, string permission, List <CommentData.Medium> medias, bool isShared)
        {
            InitializeComponent();
            instance = this;

            BT_LinkShow.IsEnabled  = false;
            BT_LinkShow.Foreground = Brushes.LightGray;
            BT_Link.IsEnabled      = false;
            isEdit     = true;
            editFeedID = feedID;
            if (medias != null)
            {
                foreach (var media in medias)
                {
                    string path = "video2.png";
                    if (media.url_hq == null)
                    {
                        path = System.IO.Path.GetTempFileName();
                        WebClient client = new WebClient();
                        client.DownloadFile(media.origin_url, path);
                        AddAsset(path, media.media_path);
                        editOldMediaPath.Add(media.media_path);
                    }
                    else
                    {
                        AddAsset(path, media.key);
                        editOldMediaPath.Add(media.url);
                    }
                }
                ValidatePanelHeight();
            }
            this.isShared = isShared;
            if (isShared)
            {
                BT_Pic.IsEnabled  = false;
                BT_Pic.Foreground = Brushes.LightGray;
            }

            MainWindow.SetClickObject(BT_Link);
            MainWindow.SetClickObject(BT_LinkShow);
            MainWindow.SetClickObject(BT_Pic);
            MainWindow.SetClickObject(BT_WithFriend);
            MainWindow.SetClickObject(BT_QuoteFriend);
            MainWindow.SetClickObject(BT_Menu);

            if (permission.Equals("A"))
            {
                ComboRange.SelectedIndex = 0;
            }
            if (permission.Equals("F"))
            {
                ComboRange.SelectedIndex = 1;
            }
            if (permission.Equals("P"))
            {
                ComboRange.SelectedIndex = 2;
            }
            if (permission.Equals("M"))
            {
                ComboRange.SelectedIndex = 3;
            }

            TB_Main.Text = text;
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ContextIdle, new Action(() => TB_Main.Focus()));
            isInit = true;
        }