Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="LanguageID"></param>
 /// <param name="load_files_options"></param>
 public CSyntacticUnitsInfoProvider(LANGUAGES LanguageID, CLoadFilesOptions load_files_options)
     : base(load_files_options)
 {
     m_Extension             = CAvailableExtentions.GetExtention(LanguageID);
     m_SynUnitsCollection    = new CSyntacticUnitsCollection();
     m_CountOfSyntacticUnits = 0;
 }
Ejemplo n.º 2
0
 private void LoadSettings()
 {
     CodeLocationTextBox.Text           = Properties.Settings.Default.DCSLastChoosenFolder;
     ChoosenFilesExtensionsTextBox.Text = Properties.Settings.Default.DCSLastChoosenFilesExtensions;
     var LangComboBoxInitializer = new CComboBoxInitializer <ICloneExtension>(ref ChooseLangComboBox, new EventHandler(ChooseLangComboBox_DropDownClosed),
                                                                              CAvailableExtentions.GetExtentionsList().Values, CAvailableExtentions.GetExtention((LANGUAGES)Properties.Settings.Default.CSWLastChoosenLanguage));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Загрузить параметры
 /// </summary>
 public override void LoadSettings()
 {
     MemorizeLastRunParamsCheckBox.Checked = Properties.Settings.Default.CSWMemorizeLastRunParams;
     CodeLocationTextBox.Text                = Properties.Settings.Default.CSWLastChoosenFolder;
     SkippingFoldersTextBox.Text             = Properties.Settings.Default.CSWSkippingFolders;
     IsUseParallelExtensionsCheckBox.Checked = Properties.Settings.Default.CSWIsUseParallelExtensions;
     var LangComboBoxInitializer = new CComboBoxInitializer <ICloneExtension>(ref ChooseLangComboBox, new EventHandler(ChooseLangComboBox_DropDownClosed),
                                                                              CAvailableExtentions.GetExtentionsList().Values, CAvailableExtentions.GetExtention((LANGUAGES)Properties.Settings.Default.CSWLastChoosenLanguage));
     var AlgorithmComboBoxInitializer = new CComboBoxInitializer <CBaseCloneSearchStrategy>(ref ChooseAlgorithmComboBox, new EventHandler(ChooseAlgorithmComboBox_DropDownClosed),
                                                                                            CAvailableCloneSearchAlgorithms.GetAlgorithmsList().Values, CAvailableCloneSearchAlgorithms.GetAlgorithm((CloneSearchAlgoritms)Properties.Settings.Default.CSWLastChoosenAlgorithm));
 }
Ejemplo n.º 4
0
        public void GetExtentionTest1()
        {
            LANGUAGES       Lang   = LANGUAGES.LANGUAGE_C_PLUS_PLUS;
            ICloneExtension actual = CAvailableExtentions.GetExtention(Lang);

            Assert.IsNotNull(actual);
            Assert.AreEqual(actual.LanguageID(), Lang);

            Lang   = LANGUAGES.LANGUAGE_C_SHARP;
            actual = CAvailableExtentions.GetExtention(Lang);
            Assert.IsNotNull(actual);
            Assert.AreEqual(actual.LanguageID(), Lang);
        }
Ejemplo n.º 5
0
        public void GetExtentionsListTest()
        {
            const int DllCount = 2;
            Dictionary <LANGUAGES, ICloneExtension> actual = CAvailableExtentions.GetExtentionsList();

            Assert.AreEqual(DllCount, actual.Count);

            foreach (var extension in actual.Values)
            {
                Assert.AreNotEqual(string.Empty, extension.GetCommentSymbols());
                Assert.AreNotEqual(string.Empty, extension.GetSourceFileExtentions());
            }
        }
Ejemplo n.º 6
0
 public void GetExtentionTest4()
 {
     ICloneExtension actual = CAvailableExtentions.GetExtention(LANGUAGES.LANGUAGE_JAVA);
 }
Ejemplo n.º 7
0
 public void GetExtentionTest2()
 {
     ICloneExtension actual = CAvailableExtentions.GetExtention(LANGUAGES.LANGUAGE_UNKNOWN);
 }
Ejemplo n.º 8
0
        public CloneSearchWindow()
        {
            InitializeComponent();
            InitUI();
            LoadSettings();
            CCloneSearchOptionsGroup.InitCodeEncodingComboBox(ref CodeEncodingComboBox);
            m_CloneSearchExecutor = new CBaseCloneSearchExecutor(CAvailableCloneSearchAlgorithms.GetAlgorithm((CloneSearchAlgoritms)Properties.Settings.Default.CSWLastChoosenAlgorithm), CAvailableExtentions.GetExtention((LANGUAGES)Properties.Settings.Default.CSWLastChoosenLanguage));

            m_CloneSearchExecutor.CloneSearchExecutingEnd      += new MessageEventHandler(ReportCloneSearchExecutingEnd);
            m_CloneSearchExecutor.CloneSearchExecutingStart    += new MessageEventHandler(ReportCloneSearchExecutingStart);
            m_CloneSearchExecutor.CloneSearchExecutingProgress += new MessageEventHandler(ReportCloneSearchExecutingProgress);
            m_StopWatch     = new Stopwatch();
            KminValue.Value = CCodeFragment.Kmin;
        }
Ejemplo n.º 9
0
        public void LoadTest3()
        {
            string filename = Path.GetFullPath("MimeTypeDetection.cs");

            Assert.IsTrue(File.Exists(filename));

            CTokenizerParms args = new CTokenizerParms(filename, new CSourceFileID());
            CTokenSourceFileContentLoader target = new CTokenSourceFileContentLoader(args, CAvailableExtentions.GetExtention(LANGUAGES.LANGUAGE_C_SHARP));
            CCodeUnitsCollection          actual = target.Load();

            Assert.AreEqual(796, actual.Size());
        }