示例#1
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 = "\\/:*?\"<>|";
                    foreach (char cChk in strChk)
                    {
                        if (strRes.IndexOf(cChk) >= 0)
                        {
                            MessageBox.Show("Value must not contain characters of '" + strChk + "'!");
                            return;
                        }
                    }
                }

                /*
                 * if( m_bUseHistory )
                 * {
                 *      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();
        }
示例#2
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();
            }
        }
示例#3
0
        /*
         * RscRegistryValueList m_RegHistory;
         *
         * bool m_bUseHistory = true;
         */

        public RscDlg_BigInputV10()
        {
            InitializeComponent();

            m_AppFrame = new RscAppFrame("Ressive.Hu", "Big 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);

                //FileName...
                if (m_AppInput.GetFlag(1).Length > 0)
                {
                    btnClearFn.Visibility = Rsc.Visible;
                }


                /*
                 * 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();
                 */
            }
        }
        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...";
            }
        }
示例#5
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();
            }
        }
示例#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();
            }
        }
示例#7
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();
            }
        }
示例#8
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();
            }
        }
        private void OnOK()
        {
            bool bGoBack = true;

            if (!DeviceNetworkInformation.IsNetworkAvailable)
            {
                ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();
                connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi;
                connectionSettingsTask.Show();

                return;
            }

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

                bGoBack = false;

                if (RscUtils.IsIpAddress(strRes))
                {
                    /*
                     * MessageBox.Show("IP Address is not allowed here!");
                     * return;
                     */

                    DoOk();
                }
                else
                {
                    prsBar.Visibility = Rsc.Visible;

                    var endpoint = new DnsEndPoint(strRes, 0);
                    DeviceNetworkInformation.ResolveHostNameAsync(endpoint, OnHostResolved, null);
                }
            }

            if (bGoBack)
            {
                this.NavigationService.GoBack();
            }
        }
示例#11
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();
            }
        }
示例#12
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)
                    {
                    }
                }
            }
        }
        //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();
            }
        }
        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();
            }
        }
        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();
                }
            }
        }