예제 #1
0
        public FormEditor()
        {
            InitializeComponent();

            this.Load += new EventHandler(FormEditor_Load);
            popupTypeToolStripMenuItem.Visible = false;

            tabControlEditor.SelectedIndexChanged += new EventHandler(tabControlEditor_SelectedIndexChanged);
            textAliases.KeyDown += new KeyEventHandler(OnKeyDown);
            textPopups.KeyDown += new KeyEventHandler(OnKeyDown);

            //load the aliases
            aliasList = FormMain.Instance.IceChatAliases;
            LoadAliases();

            //load the popups
            popupList = FormMain.Instance.IceChatPopupMenus;
            nickListPopup = LoadPopupMenu("NickList");
            consolePopup = LoadPopupMenu("Console");
            channelPopup = LoadPopupMenu("Channel");
            queryPopup = LoadPopupMenu("Query");

            //load the nicklist by default into popup editor
            LoadPopups(nickListPopup);
            nickListToolStripMenuItem.Checked = true;
            currentPopup = "NickList";
            currentPopupMenu = nickListToolStripMenuItem;

            this.Activated += new EventHandler(FormEditor_Activated);

            ApplyLanguage();
        }
예제 #2
0
 private void ReLoadAliases()
 {
     if (File.Exists(FormMain.Instance.AliasesFile))
     {
         XmlSerializer deserializer = new XmlSerializer(typeof(IceChatAliases));
         TextReader textReader = new StreamReader(FormMain.Instance.AliasesFile);
         aliasList = (IceChatAliases)deserializer.Deserialize(textReader);
         textReader.Close();
         textReader.Dispose();
     }
     else
     {
         aliasList = new IceChatAliases();
     }
 }
예제 #3
0
 private void LoadAliases()
 {
     if (File.Exists(aliasesFile))
     {
         XmlTextReader textReader = null;
         try
         {
             XmlSerializer deserializer = new XmlSerializer(typeof(IceChatAliases));
             textReader = new XmlTextReader(aliasesFile);
             iceChatAliases = (IceChatAliases)deserializer.Deserialize(textReader);
             textReader.Close();
         }
         catch (Exception)
         {
             textReader.Close();
             errorMessages.Add("There was a problem loading IceChatAliases.xml. Default aliases loaded");
             iceChatAliases = new IceChatAliases();
             SaveAliases();
         }
     }
     else
     {
         iceChatAliases = new IceChatAliases();
         SaveAliases();
     }
 }