Ejemplo n.º 1
0
        private void cMenAppsAdd_Click(object sender, EventArgs e)
        {
            try
            {
                Tools.QuickText nExtA = new Tools.QuickText();
                Runtime.QuickTexts.Add(nExtA);
                LoadQT();
                lvApps.SelectedItems.Clear();

                foreach (ListViewItem lvItem in lvApps.Items)
                {
                    if (lvItem.Tag == nExtA)
                    {
                        lvItem.Selected = true;
                        txtDisplayName.Focus();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                    (string)
                                                    ("AddNewApp failed (UI.Window.ExternalApps)" +
                                                        Constants.vbNewLine + ex.Message), true);
            }
        }
Ejemplo n.º 2
0
        private void cMenAppsAdd_Click(object sender, EventArgs e)
        {
            try
            {
                Tools.QuickText nExtA = new Tools.QuickText();
                Runtime.QuickTexts.Add(nExtA);
                LoadQT();
                lvApps.SelectedItems.Clear();

                foreach (ListViewItem lvItem in lvApps.Items)
                {
                    if (lvItem.Tag == nExtA)
                    {
                        lvItem.Selected = true;
                        txtDisplayName.Focus();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                    (string)
                                                    ("AddNewApp failed (UI.Window.ExternalApps)" +
                                                     Constants.vbNewLine + ex.Message), true);
            }
        }
Ejemplo n.º 3
0
 private void GetAppProperties(Tools.QuickText SelApp)
 {
     try
     {
         if (SelApp != null)
         {
             txtDisplayName.Text = (string)SelApp.DisplayName;
             txtFilename.Text    = (string)SelApp.Text;
             _SelApp             = SelApp;
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                             (string)
                                             ("GetAppProperties failed (UI.Window.ExternalApps)" +
                                              Constants.vbNewLine + ex.Message), true);
     }
 }
Ejemplo n.º 4
0
        private void SetAppProperties(Tools.QuickText SelApp)
        {
            try
            {
                if (SelApp != null)
                {
                    SelApp.DisplayName = txtDisplayName.Text;
                    SelApp.Text        = txtFilename.Text;

                    LoadQT();
                }
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                                    (string)
                                                    ("SetAppProperties failed (UI.Window.QT)" +
                                                     Constants.vbNewLine + ex.Message), true);
            }
        }
Ejemplo n.º 5
0
            public void LoadQuickTextsFromXML()
            {
                string oldPath =
                    (string)
                    (System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + "\\" +
                     (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName +
                     "\\" + mRemoteNC.AppInfo.Settings.QuickTextsFilesName);
                string newPath =
                    (string)
                    (mRemoteNC.AppInfo.Settings.SettingsPath + "\\" + mRemoteNC.AppInfo.Settings.QuickTextsFilesName);
                XmlDocument xDom = new XmlDocument();

                if (File.Exists(newPath))
                {
                    xDom.Load(newPath);
                }
                else
                {
                    if ((!AppInfo.General.IsPortable) && File.Exists(oldPath))
                    {
                        xDom.Load(oldPath);
                    }
                    else
                    {
                        return;
                    }
                }

                foreach (XmlElement xEl in xDom.DocumentElement.ChildNodes)
                {
                    Tools.QuickText extA = new Tools.QuickText();
                    extA.DisplayName = xEl.Attributes["DisplayName"].Value;
                    extA.Text        = xEl.Attributes["Text"].Value;
                    Runtime.QuickTexts.Add(extA);
                }

                xDom = null;

                frmMain.Default.AddQuickTextsToToolBar();
            }
Ejemplo n.º 6
0
            public void LoadQuickTextsFromXML()
            {
                string oldPath =
                    (string)
                    (System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + "\\" +
                     (new Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase()).Info.ProductName +
                     "\\" + mRemoteNC.AppInfo.Settings.QuickTextsFilesName);
                string newPath =
                    (string)
                    (mRemoteNC.AppInfo.Settings.SettingsPath + "\\" + mRemoteNC.AppInfo.Settings.QuickTextsFilesName);
                XmlDocument xDom = new XmlDocument();
                if (File.Exists(newPath))
                {
                    xDom.Load(newPath);
                #if !PORTABLE
                }
                else if (File.Exists(oldPath))
                {
                    xDom.Load(oldPath);
                #endif
                }
                else
                {
                    return;
                }

                foreach (XmlElement xEl in xDom.DocumentElement.ChildNodes)
                {
                    Tools.QuickText extA = new Tools.QuickText();
                    extA.DisplayName = xEl.Attributes["DisplayName"].Value;
                    extA.Text = xEl.Attributes["Text"].Value;
                    Runtime.QuickTexts.Add(extA);
                }

                xDom = null;

                frmMain.Default.AddQuickTextsToToolBar();
            }
Ejemplo n.º 7
0
 private void GetAppProperties(Tools.QuickText SelApp)
 {
     try
     {
         if (SelApp != null)
         {
             txtDisplayName.Text = (string)SelApp.DisplayName;
             txtFilename.Text = (string)SelApp.Text;
             _SelApp = SelApp;
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg,
                                             (string)
                                             ("GetAppProperties failed (UI.Window.ExternalApps)" +
                                              Constants.vbNewLine + ex.Message), true);
     }
 }