Пример #1
0
        /// <summary>
        /// Perform 1-Click operation for NeverSink's filter generation
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void doItAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string text = OpenFilterFileAndGetText("NeverSink");

            if (text != "")
            {
                tabControl.SelectTab(1);
                AddTextToLogBox("GENERATING FILTER SETTINGS...");
                ts_label1.Text = "Loading";

                string version = Util.getConfigValue("Version Number");

                FilterSettings Sregular    = new FilterSettings("1-REGULAR", version, 0);
                FilterSettings Ssemistrict = new FilterSettings("2-SEMI-STRICT", version, 1);
                FilterSettings Sstrict     = new FilterSettings("3-STRICT", version, 2);
                FilterSettings Sverystrict = new FilterSettings("4-VERY-STRICT", version, 3);
                FilterSettings Suberstrict = new FilterSettings("5-UBER-STRICT", version, 4);
                FilterSettings Sslick      = new FilterSettings("SLICK", version, 0);

                Fregular    = new Filter(text, Sregular);
                Fstrict     = new Filter(text, Sstrict);
                Fsemistrict = new Filter(text, Ssemistrict);
                Fverystrict = new Filter(text, Sverystrict);
                Fuberstrict = new Filter(text, Suberstrict);

                StyleSheet SSdef      = new StyleSheet("default");
                StyleSheet SSBlue     = new StyleSheet("Blue");
                StyleSheet SSSlick    = new StyleSheet("Slick");
                StyleSheet SSStreamer = new StyleSheet("StreamSound");

                List <Filter>     FilterArray     = new List <Filter>();
                List <StyleSheet> StyleSheetArray = new List <StyleSheet>();

                FilterArray.Add(Fregular);
                FilterArray.Add(Fstrict);
                FilterArray.Add(Fsemistrict);
                FilterArray.Add(Fverystrict);
                FilterArray.Add(Fuberstrict);

                StyleSheetArray.Add(SSdef);
                StyleSheetArray.Add(SSBlue);
                StyleSheetArray.Add(SSSlick);
                StyleSheetArray.Add(SSStreamer);

                foreach (Filter f in FilterArray)
                {
                    foreach (StyleSheet s in StyleSheetArray)
                    {
                        AddTextToLogBox("GENERATING SUBVERSION: " + f.settings.subVersionName);
                        AddTextToLogBox("APPLYING STYLE: " + s.Name);

                        f.ReadLines(this);
                        f.GenerateEntries();
                        f.GenerateTOC(true);
                        f.AdjustVersionName(0, 4);
                        f.AdjustVersionNumber(0, 3);
                        f.FindAndHandleVersionTags();
                        f.SortEntries();

                        if (s.Name != "default")
                        {
                            s.Init();
                            s.LoadStyle(true, Util.GetOutputPath() + @"ADDITIONAL-FILES\StyleSheets\" + s.Name + ".fsty");
                            f.AdjustStyleName(0, 5, s.Name.ToUpper());
                            s.AppliedFilter = f;
                            s.ApplyStyleSheetDataToAttributes();
                        }

                        f.RebuildFilterFromEntries();

                        if (s.Name != "default")
                        {
                            f.SaveToFile("(STYLE) " + s.Name.ToUpper().ToString(), s.Name);
                        }
                        else
                        {
                            f.SaveToFile();
                        }
                        AddTextToLogBox("---------------------------------");
                    }

                    AddTextToLogBox("STRICTNESS SUBVERSION COMPLETE: " + f.settings.subVersionName);
                    AddTextToLogBox("---------------------------------");
                }
                AddTextToLogBox("---------------------------------");
                AddTextToLogBox("All Operations Completed!!! Generated " + StyleSheetArray.Count * FilterArray.Count + " Filterfiles.");

                OutputTransform.Text = Fregular.RawFilterRebuilt;
                ts_label1.Text       = "Ready";
                Process.Start(Util.GetOutputPath());
            }
        }
Пример #2
0
 /// <summary>
 /// Strings from file + Settings
 /// </summary>
 /// <param name="copyFromFilter"></param>
 public Filter(string input, FilterSettings set)
 {
     RawFilter     = input;
     this.settings = set;
     _loaded       = true;
 }