示例#1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            //m_bInThisApp = true;

            if (!m_bFirstLoad)
            {
                return;
            }
            m_bFirstLoad = false;

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput("RscViewer_JSonV10");
            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                m_iIndex = 0;
                if (!Int32.TryParse(m_AppInput.GetFlag(0), out m_iIndex))
                {
                    return;
                }

                m_aPathes.Clear();
                for (int i = 0; i < m_AppInput.DataCount; i++)
                {
                    string sPath = m_AppInput.GetData(i);

                    m_aPathes.Add(sPath);
                }
                if (m_aPathes.Count == 0)
                {
                    return;
                }

                m_iIndex = Math.Min(m_iIndex, m_AppInput.DataCount - 1);
                m_iIndex = Math.Max(m_iIndex, 0);

                //appArgsMgr.Vipe();

                _ReadTextFile();
            }
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            m_bInThisApp = true;

            if (!m_bFirstLoad)
            {
                return;
            }
            m_bFirstLoad = false;

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput("RscViewer_HexaV10");
            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                if (m_stream != null)
                {
                    m_stream.Close();
                    m_stream = null;
                }
                m_lPos = 0;

                m_sPath = m_AppInput.GetData(0);

                //appArgsMgr.Vipe();

                RscStore store = new RscStore();
                try
                {
                    m_stream = store.GetReaderStream(m_sPath);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    m_stream = null;
                }

                _ShowDump();
            }
        }
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            base.OnBackKeyPress(e);

            if (m_AppInput != null)
            {
                RscPageArgsRet appOutput = m_AppInput.CreateOutPut();
                appOutput.SetFlag(0, "Back");
                appOutput.SetOutput();
            }

            if (m_stream != null)
            {
                m_stream.Close();
                m_stream = null;
                m_lPos   = 0;
            }

            //e.Cancel = true;
        }
示例#4
0
        private void m_btnCleanUp_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (MessageBoxResult.OK != MessageBox.Show("Do you really want to delete all saved response file (.json)?\n\n(Press Back to Cancel...)"))
            {
                return;
            }

            // //
            //

            logGrid.Visibility = Rsc.Collapsed;

            m_aTI.CollapseAll(true);

            //
            // //
            //

            if (m_sUserIDlast.Length > 0)
            {
                RscPageArgsRet appInput = new RscPageArgsRet(m_AppArgs,
                                                             m_AppFrame.AppTitle, m_AppFrame.AppIconRes, "CleanUp");

                appInput.SetData(0, csSecretsFolder + "\\" + m_sUserIDlast);
                appInput.SetData(1, "*.json");
                appInput.SetData(2, "recurse");
                //appInput.SetData( 2, "" );

                appInput.SetData(3, "showHidden");
                //appInput.SetData( 3, "" );

                appInput.SetData(4, "AutoDelete");

                appInput.SetInput("RscViewer_FindFilesV12");

                this.NavigationService.Navigate(appInput.GetNavigateUri(csViewersAssy));
            }

            //
            // //
        }
示例#5
0
        private void m_tmrSend_Tick(object sender, System.EventArgs e)
        {
            m_tmrSend.Stop();

            string strCallerAppTitle   = m_AppFrame.AppTitle;
            string strCallerAppIconRes = m_AppFrame.AppIconRes;

            RscPageArgsRet appInput = new RscPageArgsRet(m_AppArgs,
                                                         strCallerAppTitle, strCallerAppIconRes, m_sSendID);

            appInput.SetFlag(0, "*");               //FileType Filter (if empty, folder path browsed)

            /*
             * appInput.SetFlag( 1, "NoEmpty" );
             * appInput.SetFlag( 2, "FileName" );
             * appInput.SetData( 0, m_Root.FullPath );
             */
            appInput.SetInput("RscViewer_FsV12");

            this.NavigationService.Navigate(appInput.GetNavigateUri(csViewersAssy));
        }
示例#6
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();
            }
        }
        private void m_tmrRename_Tick(object sender, System.EventArgs e)
        {
            m_tmrRename.Stop();

            if (m_files.Count != 1)
            {
                return;
            }
            RscFileItemDesc it = m_files[0];

            RscPageArgsRet appInput = new RscPageArgsRet(m_AppArgs,
                                                         m_AppFrame.AppTitle, m_AppFrame.AppIconRes, "txRenameTo");

            appInput.SetFlag(0, it.strFileName);
            appInput.SetFlag(1, "NoEmpty");
            appInput.SetFlag(2, "FileName");
            appInput.SetFlag(3, "no history");
            appInput.SetData(0, it.strFileName);
            appInput.SetInput("RscDlg_TxtInputV10");

            this.NavigationService.Navigate(appInput.GetNavigateUri(csDlgsAssy));
        }
示例#8
0
        public RscDlg_FolderInputV10()
        {
            InitializeComponent();

            m_AppFrame = new RscAppFrame("Ressive.Hu", "Folder Input 1.0", "Images/Ico001_Ressive.jpg"
                                         , this, AppTitleBar, AppStatusBar);
            // ///////////////
            m_AppFrame.OnNext += new Ressive.FrameWork.RscAppFrame.OnNext_EventHandler(m_AppFrame_OnNext);
            m_AppFrame.OnExit += new Ressive.FrameWork.RscAppFrame.OnExit_EventHandler(m_AppFrame_OnExit);

            m_tmrBrowse          = new DispatcherTimer();
            m_tmrBrowse.Interval = new TimeSpan(500);
            m_tmrBrowse.Tick    += new System.EventHandler(m_tmrBrowse_Tick);

            m_AppArgs = new RscPageArgsRetManager();

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput(csClsName);
            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                lbStr.Text = m_AppInput.GetFlag(0);
                txStr.Text = m_AppInput.GetData(0);

                if (txStr.Text.Length == 0)
                {
                    string sPath = "Software\\Ressive.Hu\\" + csClsName + "\\History";
                    sPath     += "\\" + m_AppInput.CallerAppTitle;
                    sPath     += "\\" + m_AppInput.ID;
                    txStr.Text = RscRegistry.ReadString(HKEY.HKEY_CURRENT_USER, sPath, "LastOk", "");
                }

                _LoadHistory();
            }
        }
        public RscDlg_TxtInputV10()
        {
            InitializeComponent();

            m_AppFrame = new RscAppFrame("Ressive.Hu", "Text Input 1.0", "Images/Ico001_Ressive.jpg"
                                         , this, AppTitleBar, AppStatusBar);
            // ///////////////
            m_AppFrame.OnNext += new Ressive.FrameWork.RscAppFrame.OnNext_EventHandler(m_AppFrame_OnNext);
            m_AppFrame.OnExit += new Ressive.FrameWork.RscAppFrame.OnExit_EventHandler(m_AppFrame_OnExit);

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput(csClsName);
            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                lbStr.Text = m_AppInput.GetFlag(0);
                txStr.Text = m_AppInput.GetData(0);

                m_bUseHistory = (m_AppInput.GetFlag(3).Length == 0);

                lbHis.Visibility = Rsc.ConditionalVisibility(m_bUseHistory);
                scrl.Visibility  = Rsc.ConditionalVisibility(m_bUseHistory);

                if (txStr.Text.Length == 0 && m_bUseHistory)
                {
                    string sPath = "Software\\Ressive.Hu\\" + csClsName + "\\History";
                    sPath     += "\\" + m_AppInput.CallerAppTitle;
                    sPath     += "\\" + m_AppInput.ID;
                    txStr.Text = RscRegistry.ReadString(HKEY.HKEY_CURRENT_USER, sPath, "LastOk", "");
                }

                _LoadHistory();
            }
        }
        public RscDlg_FtpHostInputV10()
        {
            InitializeComponent();

            m_AppFrame = new RscAppFrame("Ressive.Hu", "FTP Host Input 1.0", "Images/Ico001_Ressive.jpg"
                                         , this, AppTitleBar, AppStatusBar);
            // ///////////////
            m_AppFrame.OnNext += new Ressive.FrameWork.RscAppFrame.OnNext_EventHandler(m_AppFrame_OnNext);
            m_AppFrame.OnExit += new Ressive.FrameWork.RscAppFrame.OnExit_EventHandler(m_AppFrame_OnExit);
            // ///////////////
            imgIpUpIco.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Inc.jpg");
            imgIpDnIco.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Dec.jpg");

            txSvrIP.Text = "";

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput(csClsName);
            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                //lbStr.Text = m_AppInput.GetFlag(0);
                //txSvrIP.Text = m_AppInput.GetData(0);

                if (txSvrIP.Text.Length == 0)
                {
                    string sPath = "Software\\Ressive.Hu\\" + csClsName + "\\History";
                    sPath       += "\\" + m_AppInput.CallerAppTitle;
                    sPath       += "\\" + m_AppInput.ID;
                    txSvrIP.Text = RscRegistry.ReadString(HKEY.HKEY_CURRENT_USER, sPath, "LastOk", "");
                }

                _LoadHistory();
            }
        }
        private void DoOk(string sCustRes = "")
        {
            string sPath = "Software\\Ressive.Hu\\" + csClsName + "\\History";

            sPath += "\\" + m_AppInput.CallerAppTitle;
            sPath += "\\" + m_AppInput.ID;
            RscRegistry.WriteString(HKEY.HKEY_CURRENT_USER, sPath, "LastOk", txSvrIP.Text);

            m_RegHistory.Add(txSvrIP.Text);
            m_RegHistory.Flush();

            if (sCustRes.Length == 0)
            {
                sCustRes = txSvrIP.Text;
            }

            RscPageArgsRet appOutput = m_AppInput.CreateOutPut();

            appOutput.SetFlag(0, "Ok");
            appOutput.SetData(0, sCustRes);               //txSvrIP.Text );
            appOutput.SetOutput();

            this.NavigationService.GoBack();
        }
示例#12
0
        private void m_btnLogOut_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (MessageBoxResult.OK != MessageBox.Show("Do you really want to log out\nand to delete all saved response files (.json)\nand browser chache?\n\n(Press Back to Cancel...)"))
            {
                return;
            }

            // //
            //

            logGrid.Visibility = Rsc.Collapsed;

            m_aTI.CollapseAll(true);

            //
            // //
            //

            m_gAuth.Logout();

            RscStore store = new RscStore();

            store.CreateFolderPath(csSecretsFolder);
            //Otherwise able to logon on next run...
            store.DeleteFile(csSecretsFolder + "\\" + "AUTH.xml");

            //
            // //
            //

            //NOTE: Deleting all IE folders WILL NOT force the user to reenter eMail + Pw!!!

            string sIeCacheFolders = ";" + RscStore_IsoStore.Get_IE_Cache_FolderList(';');

            sIeCacheFolders = sIeCacheFolders.Replace(";", ";A:\\");

            //
            // //
            //

            if (m_sUserIDlast.Length > 0)
            {
                RscPageArgsRet appInput = new RscPageArgsRet(m_AppArgs,
                                                             m_AppFrame.AppTitle, m_AppFrame.AppIconRes, "LogOut");

                appInput.SetData(0, csSecretsFolder + "\\" + m_sUserIDlast + sIeCacheFolders);
                appInput.SetData(1, "*.*");
                appInput.SetData(2, "recurse");
                //appInput.SetData( 2, "" );

                appInput.SetData(3, "showHidden");
                //appInput.SetData( 3, "" );

                appInput.SetData(4, "AutoDelete");

                appInput.SetInput("RscViewer_FindFilesV12");

                this.NavigationService.Navigate(appInput.GetNavigateUri(csViewersAssy));
            }

            //
            // //
        }
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            m_bInThisApp = true;

            if (!m_bFirstLoad)
            {
                return;
            }
            m_bFirstLoad = false;

            IDictionary <string, string> parameters = this.NavigationContext.QueryString;

            if (parameters.ContainsKey("folder"))
            {
                RscStore store = new RscStore();

                string sFolder;
                sFolder = parameters["folder"];

                switch (sFolder)
                {
                case "A:\\Contacts":
                {
                    m_AppFrame.AppTitle   = "Contacts";
                    m_AppFrame.AppIconRes = "Images/IcoSm001_Contacts.jpg";

                    store.CreateFolderPath(sFolder);

                    string [] asFns = RscSort.OrderBy(store.GetFileNames(sFolder, "*.vcf"));

                    foreach (string sFn in asFns)
                    {
                        string sPath = sFolder + "\\" + sFn;

                        m_aPathes.Add(sPath);
                    }

                    break;
                }

                case "A:\\System\\Events":
                {
                    m_AppFrame.AppTitle   = "Events";
                    m_AppFrame.AppIconRes = "Images/IcoSm001_EventViewer.jpg";

                    store.CreateFolderPath(sFolder);

                    //INFs
                    string [] asFns = RscSort.OrderBy(store.GetFileNames(sFolder, "*.info"));
                    foreach (string sFn in asFns)
                    {
                        string sPath = sFolder + "\\" + sFn;

                        m_aPathes.Add(sPath);
                    }

                    //ERRORs
                    asFns = RscSort.OrderBy(store.GetFileNames(sFolder, "*.error"));
                    foreach (string sFn in asFns)
                    {
                        string sPath = sFolder + "\\" + sFn;

                        m_aPathes.Add(sPath);
                    }

                    break;
                }

                default:
                {
                    store.CreateFolderPath(sFolder);

                    string [] asFns = RscSort.OrderBy(store.GetFileNames(sFolder, "*.txt"));

                    foreach (string sFn in asFns)
                    {
                        string sPath = sFolder + "\\" + sFn;

                        m_aPathes.Add(sPath);
                    }

                    break;
                }
                }

                if (m_aPathes.Count > 0)
                {
                    m_iIndex = 0;
                    _ReadTextFile();
                }
            }
            else if (parameters.ContainsKey("file"))
            {
                m_AppFrame.AppTitle   = "Contact";
                m_AppFrame.AppIconRes = "Images/IcoSm001_Contacts.jpg";

                string sPath = parameters["file"];
                if (sPath.Length > 0)
                {
                    m_aPathes.Add(sPath);

                    m_iIndex = 0;
                    _ReadTextFile();
                }
            }
            else
            {
                RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();
                m_AppInput = appArgsMgr.GetInput("RscViewer_TextV10");
                if (m_AppInput != null)
                {
                    m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                    m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                    m_iIndex = 0;
                    if (!Int32.TryParse(m_AppInput.GetFlag(0), out m_iIndex))
                    {
                        return;
                    }

                    m_aPathes.Clear();
                    for (int i = 0; i < m_AppInput.DataCount; i++)
                    {
                        string sPath = m_AppInput.GetData(i);

                        m_aPathes.Add(sPath);
                    }
                    if (m_aPathes.Count == 0)
                    {
                        return;
                    }

                    m_iIndex = Math.Min(m_iIndex, m_AppInput.DataCount - 1);
                    m_iIndex = Math.Max(m_iIndex, 0);

                    //appArgsMgr.Vipe();

                    _ReadTextFile();
                }
            }
        }
        private void DoLoad()
        {
            vidFull.MediaFailed         += new System.EventHandler <System.Windows.ExceptionRoutedEventArgs>(vidFull_MediaFailed);
            vidFull.MediaOpened         += new RoutedEventHandler(vidFull_MediaOpened);
            vidFull.CurrentStateChanged += new System.Windows.RoutedEventHandler(vidFull_CurrentStateChanged);
            vidFull.MediaEnded          += new System.Windows.RoutedEventHandler(vidFull_MediaEnded);

            m_currentPosition.Tick += new System.EventHandler(m_currentPosition_Tick);

            vidFull.Volume            = GetVol();
            m_btnMuteOnOff.Visibility = Rsc.Visible;

            try
            {
                RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();
                appInput = appArgsMgr.GetInput("RscViewer_MediaV10");

                if (appInput != null)
                {
                    ApplicationTitle.Text = appInput.CallerAppTitle;
                    AppIcon.Source        = m_Theme.GetImage(appInput.CallerAppIconRes);

                    m_iIndex = 0;
                    if (!Int32.TryParse(appInput.GetFlag(0), out m_iIndex))
                    {
                        return;
                    }

                    //NOT NEEDED...

                    /*
                     * if( !double.TryParse( appInput.GetFlag(1), out dWidth ) ) return;
                     * if( !double.TryParse( appInput.GetFlag(2), out dHeight ) ) return;
                     */

                    m_aVideos.Clear();
                    for (int i = 0; i < appInput.DataCount; i++)
                    {
                        string sPath = appInput.GetData(i);

                        m_aVideos.Add(sPath);
                    }
                    if (m_aVideos.Count == 0)
                    {
                        return;
                    }

                    m_iIndex = Math.Min(m_iIndex, appInput.DataCount - 1);
                    m_iIndex = Math.Max(m_iIndex, 0);
                }
            }
            catch (Exception e)
            {
                txImgDetails.Text = e.Message;
            }

            if (m_aVideos.Count != 0)
            {
                _ShowVideo(m_aVideos[m_iIndex]);
                _SetNextAndPrevBtn();
            }
        }
        private void m_btnSaveToPhone_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (m_iIndex < 0)
            {
                return;
            }
            if (m_iIndex >= m_aVideos.Count)
            {
                return;
            }

            string sPath = m_aVideos[m_iIndex];

            // //
            //

            string sTnPath = "";
            int    iPos    = sPath.LastIndexOf('\\');

            if (iPos < 0)
            {
                iPos = 0;
            }
            else
            {
                iPos++;
            }
            int iPos2 = sPath.LastIndexOf('.');

            if (iPos2 >= 0)
            {
                if (iPos > 0)
                {
                    sTnPath += sPath.Substring(0, iPos);
                }
                sTnPath += "tn\\";
                sTnPath += sPath.Substring(iPos, iPos2 - iPos);
                sTnPath += ".tn";
                sTnPath += ".jpg";                 //sPath.Substring( iPos2 );
            }

            //
            // //

            RscStore store = new RscStore();

            if (!store.FileExists(sTnPath))
            {
                sTnPath = "";
            }

            //MessageBox.Show( sPath + "\r\n" + sTnPath );

            RscPageArgsRet appInput = new RscPageArgsRet(m_AppArgs,
                                                         ApplicationTitle.Text, "Images/Ico001_Ressive.jpg", "SaveToPhone");

            appInput.SetData(0, sPath);
            appInput.SetData(1, sTnPath);

            appInput.SetInput("RscDC_FlashV10");

            this.NavigationService.Navigate(appInput.GetNavigateUri("RscDC"));
        }
示例#16
0
        private void OnOK()
        {
            if (m_AppInput != null)
            {
                string strRes = txStr.Text;

                //NoEmpty...
                if (m_AppInput.GetFlag(1).Length > 0)
                {
                    strRes = strRes.Trim();

                    if (strRes.Length == 0)
                    {
                        MessageBox.Show("Value must not be empty!");
                        return;
                    }
                }

                //FileName...
                if (m_AppInput.GetFlag(1).Length > 0)
                {
                    strRes = strRes.Trim();

                    //string strChk = "\\/:*?\"<>|";
                    //string strChk = "/:*?\"<>|";
                    string strChk = "/*?\"<>|";
                    foreach (char cChk in strChk)
                    {
                        if (strRes.IndexOf(cChk) >= 0)
                        {
                            MessageBox.Show("Value must not contain characters of '" + strChk + "'!");
                            return;
                        }
                    }
                }

                //Folder exits...
                {
                    RscStore store = new RscStore();

                    strRes = strRes.Trim();

                    if (!store.FolderExists(strRes))
                    {
                        MessageBox.Show("Folder does not exist!");
                        return;
                    }
                }

                string sPath = "Software\\Ressive.Hu\\" + csClsName + "\\History";
                sPath += "\\" + m_AppInput.CallerAppTitle;
                sPath += "\\" + m_AppInput.ID;
                RscRegistry.WriteString(HKEY.HKEY_CURRENT_USER, sPath, "LastOk", txStr.Text);

                m_RegHistory.Add(txStr.Text);
                m_RegHistory.Flush();

                RscPageArgsRet appOutput = m_AppInput.CreateOutPut();
                appOutput.SetFlag(0, "Ok");
                appOutput.SetData(0, txStr.Text);
                appOutput.SetOutput();
            }

            this.NavigationService.GoBack();
        }
示例#17
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();
            }
        }
        //NOT WORKING!!!

        /*
         * DispatcherTimer m_tmrGif;
         * int m_iFrameGif = 0;
         */

        public RscViewer_ImageV10()
        {
            InitializeComponent();

            try
            {
                //MemUsage Optimization...
                Button GlobalDILholder = Application.Current.Resources["GlobalDIL"] as Button;
                m_Theme = (RscTheme)GlobalDILholder.Tag;
                //m_dil = new RscDefaultedImageList( "Theme", "Current", "Default" );

                AppIcon.Source      = m_Theme.GetImage("Images/Ico001_Ressive.jpg");
                AppCloseIcon.Source = m_Theme.GetImage("Images/Btn001_Close.jpg");
                //AppNextIcon.Source = m_Theme.GetImage("Images/Btn001_Next.jpg");
                // ///////////////
                m_isDummy       = m_Theme.GetImage("Images/Img001_Dummy.jpg");
                m_isSaveToPhone = m_Theme.GetImage("Images/Btn001_Save.jpg");
                // ///////////////
                imgPrev.Source = m_Theme.GetImage("Images/BtnDrk001_SkipPrev.jpg");
                imgNext.Source = m_Theme.GetImage("Images/BtnDrk001_SkipNext.jpg");

                m_btnExtOpen = new RscIconButton(RightBtns, Grid.RowProperty, 1, 54, 54, Rsc.Visible);
                m_btnExtOpen.Image.Source = m_Theme.GetImage("Images/BtnDrk001_Open.jpg");;
                m_btnExtOpen.Click       += new System.Windows.RoutedEventHandler(m_btnExtOpen_Click);

                m_btnSaveToPhone = new RscIconButton(LeftBtns, Grid.RowProperty, 1, 54, 54, Rsc.Visible);
                m_btnSaveToPhone.Image.Source = m_isSaveToPhone;
                m_btnSaveToPhone.Click       += new System.Windows.RoutedEventHandler(m_btnSaveToPhone_Click);

                //NOT WORKING!!!

                /*
                 * m_tmrGif = new DispatcherTimer();
                 * m_tmrGif.Interval = System.TimeSpan.FromSeconds(1);
                 * m_tmrGif.Tick +=new System.EventHandler(m_tmrGif_Tick);
                 */
            }
            catch (Exception e)
            {
                m_strInitErr      = e.Message;
                txImgDetails.Text = m_strInitErr;
            }

            double dWidth  = 480;
            double dHeight = 800;

            try
            {
                RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();
                appInput = appArgsMgr.GetInput("RscViewer_ImageV10");

                if (appInput != null)
                {
                    ApplicationTitle.Text = appInput.CallerAppTitle;
                    AppIcon.Source        = m_Theme.GetImage(appInput.CallerAppIconRes);

                    m_iIndex = 0;
                    if (!Int32.TryParse(appInput.GetFlag(0), out m_iIndex))
                    {
                        return;
                    }

                    if (!double.TryParse(appInput.GetFlag(1), out dWidth))
                    {
                        return;
                    }
                    if (!double.TryParse(appInput.GetFlag(2), out dHeight))
                    {
                        return;
                    }

                    m_aImages.Clear();
                    for (int i = 0; i < appInput.DataCount; i++)
                    {
                        string sPath = appInput.GetData(i);

                        m_aImages.Add(sPath);
                    }
                    if (m_aImages.Count == 0)
                    {
                        return;
                    }

                    m_iIndex = Math.Min(m_iIndex, appInput.DataCount - 1);
                    m_iIndex = Math.Max(m_iIndex, 0);
                }
            }
            catch (Exception e)
            {
                txImgDetails.Text = e.Message;
            }

            if (m_aImages.Count == 0)
            {
                imgFull.Stretch = Stretch.None;
                imgFull.Source  = m_isDummy;
            }
            else
            {
                _ShowImage(m_aImages[m_iIndex], new Size(dWidth, dHeight));
                _SetNextAndPrevBtn();
            }
        }
示例#19
0
        private void RscViewer_SoundV10_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            m_AppFrame.SetNoSleep(true);

            if (m_bLoaded)
            {
                return;
            }
            m_bLoaded = true;

            m_currentPosition.Tick += new System.EventHandler(m_currentPosition_Tick);

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            appInput = appArgsMgr.GetInput(csPageName);

            if (appInput != null)
            {
                m_AppFrame.AppTitle   = appInput.CallerAppTitle;
                m_AppFrame.AppIconRes = appInput.CallerAppIconRes;

                int iIndex = 0;
                if (!Int32.TryParse(appInput.GetFlag(0), out iIndex))
                {
                    return;
                }

                //NOT NEEDED...

                /*
                 * if( !double.TryParse( appInput.GetFlag(1), out dWidth ) ) return;
                 * if( !double.TryParse( appInput.GetFlag(2), out dHeight ) ) return;
                 */

                m_siInPlayer = null;
                ClearAllSound();

                for (int i = 0; i < appInput.DataCount; i++)
                {
                    SoundInfo si = AddSound(appInput.GetData(i));
                    if (i == iIndex)
                    {
                        m_siInPlayer = si;
                    }
                }

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

                //Denie to auto-reload on next start...
                appArgsMgr.Vipe();
            }
            else
            {
                string sLastOk = RscRegistry.ReadString(HKEY.HKEY_CURRENT_USER, "Software\\Ressive.Hu\\RscViewer_SoundV11"
                                                        , "LastOk", "");
                if (sLastOk.Length > 0)
                {
                    try
                    {
                        m_siInPlayer = null;

                        //DO NOT!!!
                        //ClearAllSound();

                        RscStore store = new RscStore();

                        string[] fles = RscSort.OrderBy(store.GetFileNames(sLastOk, "*.*"));
                        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(sLastOk + "\\" + sFle);
                                if (m_siInPlayer == null)
                                {
                                    m_siInPlayer = si;
                                }
                            }
                        }

                        //DO NOT!!!

                        /*
                         * if( m_siInPlayer != null )
                         * {
                         *      DoPlay();
                         * }
                         */
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }
        public RscViewer_FindFilesV12()
        {
            InitializeComponent();

            m_AppFrame = new RscAppFrame("Ressive.Hu", "Find Files 1.2", "Images/IcoSm001_FindFiles.jpg"
                                         , this, AppTitleBar, AppStatusBar);
            // ///////////////
            m_AppFrame.OnNext  += new Ressive.FrameWork.RscAppFrame.OnNext_EventHandler(m_AppFrame_OnNext);
            m_AppFrame.OnExit  += new Ressive.FrameWork.RscAppFrame.OnExit_EventHandler(m_AppFrame_OnExit);
            m_AppFrame.OnTimer += new Ressive.FrameWork.RscAppFrame.OnTimer_EventHandler(m_AppFrame_OnTimer);

            // //

            m_btnRootFldrBrowse = new RscIconButton(rootFldrGrid, Grid.ColumnProperty, 1, 50, 50, Rsc.Visible);
            m_btnRootFldrBrowse.Image.Source = m_AppFrame.Theme.GetImage("Images/Btn001_(dir).jpg");
            m_btnRootFldrBrowse.Click       += new System.Windows.RoutedEventHandler(m_btnRootFldrBrowse_Click);

            m_txtRootFldr              = new TextBoxDenieEdit(true, true, rootFldrGrid, Grid.ColumnProperty, 2);
            m_txtRootFldr.Background   = new SolidColorBrush(Colors.LightGray);
            m_txtRootFldr.Foreground   = new SolidColorBrush(Colors.Black);
            m_txtRootFldr.FontSize     = 16;
            m_txtRootFldr.MarginOffset = new Thickness(10, 7, 10, 7);
            m_txtRootFldr.Text         = "";

            m_btnRootFldrDelete = new RscIconButton(rootFldrGrid, Grid.ColumnProperty, 3, 50, 50, Rsc.Visible);
            m_btnRootFldrDelete.Image.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Delete.jpg");
            m_btnRootFldrDelete.Click       += new System.Windows.RoutedEventHandler(m_btnRootFldrDelete_Click);

            // //

            ActionPanel.Background = new SolidColorBrush(m_AppFrame.Theme.ThemeColors.ToolBarLightBack);

            // //

            imgRename.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Empty.jpg");

            imgCopy.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Empty.jpg");

            imgMove.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Empty.jpg");

            m_btnDelete = new RscIconButton(ActionPanel, Grid.ColumnProperty, 6, 50, 50, Rsc.Visible);
            m_btnDelete.Image.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Delete.jpg");
            m_btnDelete.Click       += new System.Windows.RoutedEventHandler(m_btnDelete_Click);

            //To cycle AutoOperation...
            m_btnCycle = new RscIconButton(ActionPanel, Grid.ColumnProperty, 7, 50, 50, Rsc.Collapsed);
            //m_btnCycle.Image.Source = m_AppFrame.Theme.GetImage("Images/Btn001_Delete.jpg");
            m_btnCycle.Click += new System.Windows.RoutedEventHandler(m_btnCycle_Click);

            // //

            m_AppArgs = new RscPageArgsRetManager();

            m_files.ListBoxAsteriskWidth = 100;
            lbFiles.ItemsSource          = m_files;
            lbFiles.SizeChanged         += new System.Windows.SizeChangedEventHandler(lbFiles_SizeChanged);

            m_tmrBrowse          = new DispatcherTimer();
            m_tmrBrowse.Interval = new TimeSpan(500);
            m_tmrBrowse.Tick    += new System.EventHandler(m_tmrBrowse_Tick);

            m_tmrRename          = new DispatcherTimer();
            m_tmrRename.Interval = new TimeSpan(500);
            m_tmrRename.Tick    += new System.EventHandler(m_tmrRename_Tick);

            m_tmrCopyMove          = new DispatcherTimer();
            m_tmrCopyMove.Interval = new TimeSpan(500);
            m_tmrCopyMove.Tick    += new System.EventHandler(m_tmrCopyMove_Tick);

            txFilter.Text        = "*.*";
            chbRecurse.IsChecked = true;

            RscPageArgsRetManager appArgsMgr = new RscPageArgsRetManager();

            m_AppInput = appArgsMgr.GetInput("RscViewer_FindFilesV12");

            if (m_AppInput != null)
            {
                m_AppFrame.AppTitle   = m_AppInput.CallerAppTitle;
                m_AppFrame.AppIconRes = m_AppInput.CallerAppIconRes;

                string sInput = m_AppInput.GetData(0);
                txFilter.Text = m_AppInput.GetData(1);
                if (txFilter.Text.Length == 0)
                {
                    txFilter.Text = "*.*";
                }
                chbRecurse.IsChecked    = (m_AppInput.GetData(2) == "recurse");
                chbShowHidden.IsChecked = (m_AppInput.GetData(3) == "showHidden");

                m_sAutoOperation = m_AppInput.GetData(4);
                if (m_sAutoOperation.Length > 0)
                {
                    m_asAutoOpPathes   = sInput.Split(';');
                    m_iAutoOpPath      = 0;
                    m_txtRootFldr.Text = m_asAutoOpPathes[m_iAutoOpPath];

                    filterPanel.Visibility = Rsc.Collapsed;
                    ActionPanel.Visibility = Rsc.Collapsed;
                }
                else
                {
                    m_txtRootFldr.Text = sInput;
                }

                m_bListOnLoad = true;
            }

            this.Loaded += new System.Windows.RoutedEventHandler(RscFindFilesV10_Loaded);

            txFilter.TextChanged += new System.Windows.Controls.TextChangedEventHandler(txFilter_TextChanged);
            chbRecurse.Checked   += new System.Windows.RoutedEventHandler(chbRecurse_Checked);

            ContentPanel.SizeChanged += new System.Windows.SizeChangedEventHandler(ContentPanel_SizeChanged);
        }
示例#21
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();
            }
        }
示例#22
0
        private void m_Image_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (m_bIsInSwipe)
            {
                return;
            }
            m_bIsInSwipe = false;

            Button btn = (Button)sender;
            string sId = (string)btn.Tag;

            string [] asID   = sId.Split('|');
            int       iYcurr = Int32.Parse(asID[0]);
            int       iXcurr = Int32.Parse(asID[1]);

            if (m_a[iYcurr].m_a[iXcurr].FsItem.Folder)
            {
                m_iTop = 0;

                m_iYCur = -1;
                m_iXCur = -1;

                m_Root = m_a[iYcurr].m_a[iXcurr].FsItem;

                m_btnUp.Visibility = Rsc.Visible;

                BuildListEx();
            }
            else
            {
                m_iYCur = iYcurr;
                m_iXCur = iXcurr;

                string strFileGroupCurr = RscRegFs.GetFileGroupEx(m_a[iYcurr].m_a[iXcurr].FsItem.FileExt);
                switch (strFileGroupCurr)
                {
                case "Video.Native":
                case "Video":
                {
                    RscPageArgsRetManager appArgs = new RscPageArgsRetManager();

                    RscPageArgsRet appInput = new RscPageArgsRet(appArgs,
                                                                 m_AppFrame.AppTitle, m_AppFrame.AppIconRes, "Open");

                    //DeBug...
                    //m_AppFrame.TRACE = m_a.Count.ToString();

                    int iIdx = 0;
                    int i    = -1;
                    for (int iY = 0; iY < m_a.Count; iY++)
                    {
                        for (int iX = 0; iX < m_iCX; iX++)
                        {
                            if (m_a[iY].m_a[iX].Name != "blank")
                            {
                                string strFileGroup = RscRegFs.GetFileGroupEx(m_a[iY].m_a[iX].FsItem.FileExt);
                                switch (strFileGroup)
                                {
                                case "Video.Native":
                                {
                                    i++;
                                    appInput.SetData(i, m_a[iY].m_a[iX].FsItem.FullPath);

                                    if (iY == iYcurr && iX == iXcurr)
                                    {
                                        iIdx = i;
                                    }

                                    break;
                                }
                                }
                            }
                        }
                    }

                    appInput.SetFlag(0, iIdx.ToString());
                    appInput.SetFlag(1, LayoutRoot.ActualWidth.ToString());
                    appInput.SetFlag(2, LayoutRoot.ActualHeight.ToString());

                    appInput.SetInput(RscRegFs.GetViewerAppPageName(strFileGroupCurr));

                    this.NavigationService.Navigate(appInput.GetNavigateUri(RscRegFs.GetViewerAppAssyName(strFileGroupCurr)));

                    break;
                }

                default:
                    MessageBox.Show("No open action defined for file type.");
                    break;
                }
            }

            /*
             * if( m_a[ iYcurr ].m_a[ iXcurr ].Checked )
             * {
             *      MassCheck( iYcurr, iYcurr, iXcurr, iXcurr, false );
             * }
             * else
             * {
             *      MassCheck( iYcurr, iYcurr, iXcurr, iXcurr, true );
             * }
             */
        }
        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();
            }
        }