Exemplo n.º 1
0
 public void Assign(ExportConfig.FormatCodes iFc)
 {
     this.Name         = iFc.Name;
     this.Notes        = iFc.Notes;
     this.ColourOn     = iFc.ColourOn;
     this.ColourOff    = iFc.ColourOff;
     this.SizeOn       = iFc.SizeOn;
     this.SizeOff      = iFc.SizeOff;
     this.BoldOn       = iFc.BoldOn;
     this.BoldOff      = iFc.BoldOff;
     this.ItalicOn     = iFc.ItalicOn;
     this.ItalicOff    = iFc.ItalicOff;
     this.UnderlineOn  = iFc.UnderlineOn;
     this.UnderlineOff = iFc.UnderlineOff;
     this.Space        = iFc.Space;
 }
Exemplo n.º 2
0
 public void RemoveCodes(int index)
 {
     if (index > -1 & index < this.FormatCode.Length)
     {
         ExportConfig.FormatCodes[] formatCodesArray = new ExportConfig.FormatCodes[this.FormatCode.Length - 1];
         int index2 = 0;
         for (int index3 = 0; index3 < this.FormatCode.Length; index3++)
         {
             if (index3 != index)
             {
                 formatCodesArray[index2].Assign(this.FormatCode[index3]);
                 index2++;
             }
         }
         this.FormatCode = new ExportConfig.FormatCodes[formatCodesArray.Length];
         for (int index4 = 0; index4 < formatCodesArray.Length; index4++)
         {
             this.FormatCode[index4].Assign(formatCodesArray[index4]);
         }
     }
 }
        protected void forumCodeUp()
        {
            int selectedIndex = this.fcList.SelectedIndex;

            if (selectedIndex < 1)
            {
                return;
            }
            ExportConfig.FormatCodes[] formatCodesArray = new ExportConfig.FormatCodes[2];
            formatCodesArray[0].Assign(MidsContext.Config.Export.FormatCode[selectedIndex]);
            formatCodesArray[1].Assign(MidsContext.Config.Export.FormatCode[selectedIndex - 1]);
            MidsContext.Config.Export.FormatCode[selectedIndex].Assign(formatCodesArray[1]);
            MidsContext.Config.Export.FormatCode[selectedIndex - 1].Assign(formatCodesArray[0]);
            this.fcPopulateList(-1);
            if (selectedIndex - 1 > -1 & this.fcList.Items.Count > selectedIndex - 1)
            {
                this.fcList.SelectedIndex = selectedIndex - 1;
            }
            else if (this.fcList.Items.Count > 0)
            {
                this.fcList.SelectedIndex = 0;
            }
        }
Exemplo n.º 4
0
    public void RemoveCodes(int index)
    {
        if (!(index > -1 & index < this.FormatCode.Length))
        {
            return;
        }
        ExportConfig.FormatCodes[] formatCodesArray = new ExportConfig.FormatCodes[this.FormatCode.Length - 1];
        int index1 = 0;

        for (int index2 = 0; index2 < this.FormatCode.Length; ++index2)
        {
            if (index2 != index)
            {
                formatCodesArray[index1].Assign(this.FormatCode[index2]);
                ++index1;
            }
        }
        this.FormatCode = new ExportConfig.FormatCodes[formatCodesArray.Length];
        for (int index2 = 0; index2 < formatCodesArray.Length; ++index2)
        {
            this.FormatCode[index2].Assign(formatCodesArray[index2]);
        }
    }
Exemplo n.º 5
0
        protected void ForumCodeDown()
        {
            int selectedIndex = fcList.SelectedIndex;

            if (selectedIndex >= fcList.Items.Count - 1)
            {
                return;
            }
            ExportConfig.FormatCodes[] formatCodesArray = new ExportConfig.FormatCodes[2];
            formatCodesArray[0].Assign(MidsContext.Config.Export.FormatCode[selectedIndex]);
            formatCodesArray[1].Assign(MidsContext.Config.Export.FormatCode[selectedIndex + 1]);
            MidsContext.Config.Export.FormatCode[selectedIndex].Assign(formatCodesArray[1]);
            MidsContext.Config.Export.FormatCode[selectedIndex + 1].Assign(formatCodesArray[0]);
            fcPopulateList();
            if (selectedIndex + 1 > -1 & fcList.Items.Count > selectedIndex + 1)
            {
                fcList.SelectedIndex = selectedIndex + 1;
            }
            else if (fcList.Items.Count > 0)
            {
                fcList.SelectedIndex = 0;
            }
        }
Exemplo n.º 6
0
    public void LoadCodes(string fName)
    {
        if (!File.Exists(fName))
        {
            return;
        }
        bool         flag = false;
        StreamReader reader;

        try
        {
            reader = new StreamReader(fName);
        }
        catch (Exception ex)
        {
            int num = (int)MessageBox.Show(ex.Message);
            return;
        }
        int num1 = 0;

        try
        {
            string str = reader.ReadLine();
            do
            {
                ++num1;
                if (str != "#END#" && str == "#CODE#")
                {
                    int index1 = -1;
                    ExportConfig.FormatCodes iFc = new ExportConfig.FormatCodes();
                    string dest;
                    flag      = ExportConfig.GrabString(out iFc.Name, ref reader) | ExportConfig.GrabString(out iFc.Notes, ref reader) | ExportConfig.GrabString(out iFc.ColourOn, ref reader) | ExportConfig.GrabString(out iFc.ColourOff, ref reader) | ExportConfig.GrabString(out iFc.SizeOn, ref reader) | ExportConfig.GrabString(out iFc.SizeOff, ref reader) | ExportConfig.GrabString(out iFc.BoldOn, ref reader) | ExportConfig.GrabString(out iFc.BoldOff, ref reader) | ExportConfig.GrabString(out iFc.ItalicOn, ref reader) | ExportConfig.GrabString(out iFc.ItalicOff, ref reader) | ExportConfig.GrabString(out iFc.UnderlineOn, ref reader) | ExportConfig.GrabString(out iFc.UnderlineOff, ref reader) | ExportConfig.GrabString(out dest, ref reader);
                    iFc.Space = dest.IndexOf(" ", StringComparison.Ordinal) > -1 ? ExportConfig.WhiteSpace.Space : ExportConfig.WhiteSpace.Tab;
                    if (!flag)
                    {
                        for (int index2 = 0; index2 < this.FormatCode.Length; ++index2)
                        {
                            if (this.FormatCode[index2].Name == iFc.Name)
                            {
                                index1 = index2;
                            }
                        }
                        if (index1 == -1)
                        {
                            Array.Resize <ExportConfig.FormatCodes>(ref this.FormatCode, this.FormatCode.Length + 1);
                            index1 = this.FormatCode.Length - 1;
                        }
                        this.FormatCode[index1].Assign(iFc);
                        str = reader.ReadLine();
                    }
                    else
                    {
                        break;
                    }
                }
            }while (!(str == "#END#" | num1 > 1024));
            if (num1 > 1024 & !flag)
            {
                int num2 = (int)MessageBox.Show("Nonfatal error reading Forum Code Update. Couldn't find end of file!");
            }
            else if (flag)
            {
                int num3 = (int)MessageBox.Show("Nonfatal error reading Forum Code Update.");
            }
        }
        catch (Exception ex)
        {
            int num2 = (int)MessageBox.Show(ex.Message);
        }
        finally
        {
            reader.Close();
        }
    }