Пример #1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (m_AppArgs.Waiting)
            {
                RscPageArgsRet appOutput = m_AppArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "BrowseForFolder":

                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            txStr.Text = appOutput.GetData(0);
                        }
                        else
                        {
                            //NOP...
                        }

                        m_AppArgs.Vipe();

                        break;
                    }
                }

                m_AppArgs.Clear();
            }
        }
Пример #2
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (m_AppArgs.Waiting)
            {
                RscStore store = new RscStore();

                RscPageArgsRet appOutput = m_AppArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "CleanUp":

                        m_AppArgs.Vipe();

                        //Tools called...

                        m_AppArgs.Clear();

                        if (store.FolderExists(csSecretsFolder + "\\" + m_sUserIDlast))
                        {
                            MessageBox.Show("Unable to delete files!");
                        }
                        else
                        {
                            m_btnCleanUp.Visibility = Rsc.Collapsed;
                        }

                        break;

                    case "LogOut":

                        m_AppArgs.Vipe();

                        //Tools called...

                        m_AppArgs.Clear();

                        if (store.FolderExists(csSecretsFolder + "\\" + m_sUserIDlast))
                        {
                            MessageBox.Show("Unable to delete files!");
                        }

                        /*
                         * else
                         * {
                         */
                        m_btnCleanUp.Visibility = Rsc.Collapsed;
                        m_btnLogOut.Visibility  = Rsc.Collapsed;

                        /*
                         * }
                         */

                        break;
                    }
                }
            }
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (appArgs.Waiting)
            {
                RscPageArgsRet appOutput = appArgs.GetOutput();
                if (appOutput != null)
                {
                    txOut.Text = appOutput.ID + " | " + appOutput.GetFlag(0);
                }

                appArgs.Clear();
            }
            else
            {
                txOut.Text = "OnNavigatedTo...";
            }
        }
Пример #4
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            m_bInThisApp = true;

            if (appArgs.Waiting)
            {
                RscPageArgsRet appOutput = appArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "FullPath":
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            string sPath = appOutput.GetData(0);

                            m_Root = new RscStoreItemFolder(sPath);

                            m_btnUp.Visibility = Rsc.Collapsed;

                            m_iTop = 0;

                            m_iYCur = -1;
                            m_iXCur = -1;

                            m_bIsInSwipe = false;

                            BuildListEx();
                        }
                        else
                        {
                            //NOP...
                        }
                        break;
                    }
                }

                appArgs.Clear();
            }
        }
Пример #5
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (m_AppArgs.Waiting)
            {
                RscPageArgsRet appOutput = m_AppArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "FtpHost":
                        txSvrIP.Text = appOutput.GetData(0);
                        LoadFromReg();
                        break;

                    case "txNewFolder":
                    {
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            m_bLastFileIsFolder = true;
                            string sFile = appOutput.GetData(0);
                            SetLastFile(sFile, true);

                            RscFtpClientCommand cmd = RscFtpClientCommand.CreateFolder(sFile);

                            _Log("21", cmd.ToString());

                            m_ftpc.SendCommandToServer(cmd);
                        }
                        break;
                    }

                    case "BrowseForFile_MEM":
                    {
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            string sFilePath = appOutput.GetData(0);

                            string sFile = RscStore.FileOfPath(sFilePath);

                            RscStore store = new RscStore();

                            System.IO.Stream stream = store.GetReaderStream(sFilePath);

                            SetLastFile(sFile, false, stream.Length);
                            System.IO.MemoryStream ms = new System.IO.MemoryStream((int)stream.Length);
                            stream.CopyTo(ms);
                            stream.Close();
                            ms.Seek(0, System.IO.SeekOrigin.Begin);

                            RscFtpClientCommand cmd = RscFtpClientCommand.UploadBin(sFile, ms);

                            _SendAutoPASV(cmd);
                        }
                        else
                        {
                            //NOP...
                        }

                        m_AppArgs.Vipe();

                        break;
                    }

                    case "BrowseForFile_FLE":
                    {
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            string sFilePath = appOutput.GetData(0);

                            string sFile = RscStore.FileOfPath(sFilePath);

                            RscStore store = new RscStore();

                            System.IO.Stream stream = store.GetReaderStream(sFilePath);

                            SetLastFile(sFile, false, stream.Length);

                            /*
                             * MemoryStream ms = new MemoryStream((int) stream.Length);
                             * stream.CopyTo(ms);
                             * stream.Close();
                             * ms.Seek(0, SeekOrigin.Begin);
                             */

                            RscFtpClientCommand cmd = RscFtpClientCommand.UploadBin(sFile, null, stream);

                            _SendAutoPASV(cmd);
                        }
                        else
                        {
                            //NOP...
                        }

                        m_AppArgs.Vipe();

                        break;
                    }
                    }
                }

                m_AppArgs.Clear();
            }
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (m_AppArgs.Waiting)
            {
                RscPageArgsRet appOutput = m_AppArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "RootFldrPath":
                    {
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            m_txtRootFldr.Text = appOutput.GetData(0);
                            ListFiles();
                        }
                        else
                        {
                            //NOP...
                        }
                        break;
                    }

                    case "CopyMove":
                    {
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            m_sCopyMoveDest = appOutput.GetData(0);

                            if (chbRecurse.IsChecked.Value && (m_txtRootFldr.Text.Length == 0 || m_sCopyMoveDest.ToUpper().IndexOf(m_txtRootFldr.Text.ToUpper()) == 0))
                            {
                                MessageBox.Show("Unable to " + m_sCopyMove + " from parent folder to its' child folder.");
                            }
                            else
                            {
                                m_AppFrame.SetStatusText(m_sCopyMove + "...");
                                m_AppFrame.StartTimer("copy move files", LayoutRoot, 1, 0, true);
                            }
                        }
                        else
                        {
                            //NOP...
                        }
                        break;
                    }

                    case "txRenameTo":
                    {
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            RscFileItemDesc it = m_files[0];

                            string sNewName = appOutput.GetData(0);

                            if (it.strFileName.ToUpper().CompareTo(sNewName.ToUpper()) != 0)
                            {
                                RscStore store = new RscStore();

                                string sNewPath = it.strParent;
                                if (sNewPath.Length > 0)
                                {
                                    sNewPath += "\\";
                                }
                                sNewPath += sNewName;

                                if (store.FileExists(sNewPath))
                                {
                                    MessageBox.Show("Name already in use!\r\n\r\n" + sNewPath);
                                }
                                else
                                {
                                    if (RscStore.ExtensionOfPath(sNewPath).ToUpper().CompareTo(RscStore.ExtensionOfPath(it.Path).ToUpper()) != 0)
                                    {
                                        if (MessageBoxResult.OK != MessageBox.Show("Do you really want to change type from " + RscStore.ExtensionOfPath(it.Path)
                                                                                   + " to " + RscStore.ExtensionOfPath(sNewPath) + "?\r\n\r\n(press Back to cancel)"))
                                        {
                                            return;
                                        }
                                    }

                                    try
                                    {
                                        store.MoveFile(it.Path, sNewPath);
                                    }
                                    catch (Exception exc)
                                    {
                                        MessageBox.Show("Rename failed!\r\n\r\n" + exc.Message);
                                        return;
                                    }

                                    if (txFilter.Text == it.strFileName)
                                    {
                                        txFilter.Text = sNewName;
                                    }
                                    it.strFileName = sNewName;

                                    //ReQuery...
                                    lbFiles.ItemsSource = null;
                                    lbFiles.ItemsSource = m_files;
                                }
                            }
                        }
                        else
                        {
                            //NOP...
                        }
                        break;
                    }
                    }
                }

                m_AppArgs.Clear();
            }
        }
Пример #7
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            if (m_AppArgs.Waiting)
            {
                RscPageArgsRet appOutput = m_AppArgs.GetOutput();
                if (appOutput != null)
                {
                    switch (appOutput.ID)
                    {
                    case "SndFldrPath":
                        if (appOutput.GetFlag(0) == "Ok")
                        {
                            string sFolderIn = appOutput.GetData(0);

                            m_siInPlayer = null;
                            ClearAllSound();

                            RscStore store = new RscStore();

                            string[] fles = RscSort.OrderBy(store.GetFileNames(sFolderIn, "*.*"));
                            foreach (string sFle in fles)
                            {
                                string sExt = RscStore.ExtensionOfPath(sFle);

                                // FIX: To support Tube(HD)'s own local storage Video folder
                                //      where files are listed without extension!!!
                                bool bInclude = (sExt == "");

                                string strFileGroup = RscRegFs.GetFileGroupEx(sExt);
                                switch (strFileGroup)
                                {
                                case "Sound.Native":
                                case "Video.Native":
                                {
                                    bInclude = true;
                                    break;
                                }
                                }

                                if (bInclude)
                                {
                                    SoundInfo si = AddSound(sFolderIn + "\\" + sFle);
                                    if (m_siInPlayer == null)
                                    {
                                        m_siInPlayer = si;
                                    }
                                }
                            }

                            if (m_siInPlayer != null)
                            {
                                DoPlay();
                            }

                            RscRegistry.WriteString(HKEY.HKEY_CURRENT_USER, "Software\\Ressive.Hu\\RscViewer_SoundV11"
                                                    , "LastOk", sFolderIn);
                        }
                        else
                        {
                            //NOP...
                        }
                        break;
                    }
                }

                m_AppArgs.Clear();
            }
        }