Пример #1
0
        public TypeViewModel(SDType type, NamespaceViewModel parent, ICoreConfigSection sharpDoxConfig)
            : base(type.Identifier, parent, sharpDoxConfig)
        {
            Text = type.NameWithTypeArguments;
            Accessibility = type.Accessibility;
            Image = string.Format("pack://application:,,,/SharpDox.GUI;component/Resources/Icons/Class_{0}.png", Accessibility);

            foreach (var sdEvent in type.Events)
            {
                Children.Add(new EventViewModel(sdEvent, this, sharpDoxConfig));
            }

            foreach (var sdField in type.Fields)
            {
                Children.Add(new FieldViewModel(sdField, this, sharpDoxConfig));
            }

            foreach (var sdMethod in type.Constructors)
            {
                Children.Add(new MethodViewModel(sdMethod, this, sharpDoxConfig));
            }

            foreach (var sdMethod in type.Methods)
            {
                Children.Add(new MethodViewModel(sdMethod, this, sharpDoxConfig));
            }

            foreach (var sdProperty in type.Properties)
            {
                Children.Add(new PropertyViewModel(sdProperty, this, sharpDoxConfig));
            }
        }
Пример #2
0
 public EventViewModel(SDEvent eve, TypeViewModel parent, ICoreConfigSection sharpDoxConfig)
     : base(eve.Identifier, parent, sharpDoxConfig)
 {
     Text = eve.Name;
     Accessibility = eve.Accessibility;
     Image = string.Format("pack://application:,,,/SharpDox.GUI;component/Resources/Icons/Event_{0}.png", Accessibility);
 }
Пример #3
0
 public MethodViewModel(SDMethod method, TypeViewModel parent, ICoreConfigSection sharpDoxConfig)
     : base(method.Identifier, parent, sharpDoxConfig)
 {
     Text = method.Name;
     Accessibility = method.Accessibility;
     Image = string.Format("pack://application:,,,/SharpDox.GUI;component/Resources/Icons/Method_{0}.png", Accessibility);
 }
Пример #4
0
        public VisibilitySettings(SDGuiStrings strings, ICoreConfigSection sharpdoxConfig, IBuildController buildController, IBuildMessenger buildMessenger)
        {
            Strings = strings;

            DataContext = new VisibilityViewModel(sharpdoxConfig, buildController, buildMessenger);
            InitializeComponent();
        }
Пример #5
0
        public GeneralSettings(SDGuiStrings strings, ICoreConfigSection config)
		{
            DataContext = config;
            Strings = strings;

            InitializeComponent();
        }
Пример #6
0
        public ExporterSelection(SDGuiStrings strings, ICoreConfigSection sharpdoxConfig, IExporter[] allExporters)
        {
            Strings = strings;

            DataContext = new ExporterViewModel(sharpdoxConfig, allExporters);
            InitializeComponent();
        }
Пример #7
0
 public PropertyViewModel(SDProperty property, TypeViewModel parent, ICoreConfigSection sharpDoxConfig)
     : base(property.Identifier, parent, sharpDoxConfig)
 {
     Text = property.Name;
     Accessibility = property.Accessibility;
     Image = string.Format("pack://application:,,,/SharpDox.GUI;component/Resources/Icons/Properties_{0}.png", Accessibility);
 }
Пример #8
0
        public ExporterViewModel(ICoreConfigSection sharpDoxConfig, IExporter[] allExporters)
        {
            _sharpDoxConfig = sharpDoxConfig;
            _allExporter = allExporters;

            RunRefresh();
            sharpDoxConfig.PropertyChanged += (s, a) => RunRefresh();
        }
Пример #9
0
        public ConfigSectionControl(ILocalController localController, ICoreConfigSection coreConfigSection, IExporter[] allExporters, BuildController buildController)
        {
            _localController = localController;
            _coreConfigSection = coreConfigSection;
            _allExporters = allExporters;
            _buildController = buildController;

            DataContext = this;
            InitializeComponent();
        }
Пример #10
0
        public NamespaceViewModel(SDNamespace sdNamespace, ICoreConfigSection sharpDoxConfig)
            : base(sdNamespace.Fullname, null, sharpDoxConfig)
        {
            Text = sdNamespace.Fullname;
            Image = "pack://application:,,,/SharpDox.GUI;component/Resources/Icons/Namespace_public.png";

            foreach (var sdType in sdNamespace.Types)
            {
                Children.Add(new TypeViewModel(sdType, this, sharpDoxConfig));
            }
        }
Пример #11
0
        public VisibilityViewModel(ICoreConfigSection sharpDoxConfig, BuildController buildController, Action onCloseHandle)
        {
            _sharpDoxConfig = sharpDoxConfig;
            _buildController = buildController;
            _onCloseHandle = onCloseHandle;

            sharpDoxConfig.PropertyChanged += ConfigChanged;

            buildController.BuildMessenger.OnBuildCompleted += ParseCompleted;
            buildController.BuildMessenger.OnBuildFailed += ParseStopped;
        }
Пример #12
0
        public TreeViewItemViewModel(string identifier, TreeViewItemViewModel parent, ICoreConfigSection sharpDoxConfig)
        {
            _sharpDoxConfig = sharpDoxConfig;

            Children = new ObservableCollection<TreeViewItemViewModel>();
            Children.CollectionChanged += (s, a) => UpdateHasExcludedChild();

            Parent = parent;
            Identifier = identifier;
            IsExcluded = _sharpDoxConfig.ExcludedIdentifiers.Contains(identifier);
        }
Пример #13
0
        public VisibilityEditorView(SDGuiStrings strings, ICoreConfigSection sharpdoxConfig, BuildController buildController)
        {
            Strings = strings;
            Config = sharpdoxConfig;

            DataContext = new VisibilityViewModel(sharpdoxConfig, buildController, Hide);
            InitializeComponent();

            MouseLeftButtonDown += OnMouseDown;
            MouseLeftButtonUp += OnMouseUp;
        }
        public ConfigVisibilityControl(SDGuiStrings strings, ICoreConfigSection coreConfigSection, BuildController buildController)
        {
            _strings = strings;
            _coreConfigSection = coreConfigSection;
            _buildController = buildController;

            coreConfigSection.PropertyChanged += ExcludedIdentifiersChanged;
            ExcludedIdentifiersChanged(null, null);

            DataContext = this;
            InitializeComponent();
        }
Пример #15
0
        public BuildWindow(SDGuiStrings strings, ICoreConfigSection sharpDoxConfig, IBuildController buildController, IBuildMessenger buildMessenger)
        {
            Strings = strings;

            _sharpDoxConfig = sharpDoxConfig;
            _buildController = buildController;
            _buildMessenger = buildMessenger;
            _buildMessenger.OnBuildMessage += BuilderOnMessage;
            _buildMessenger.OnStepMessage += BuilderOnStepMessage;
            _buildMessenger.OnBuildStopped += BuilderOnStopped;
            _buildMessenger.OnBuildProgress += BuilderOnBuildProgress;
            _buildMessenger.OnStepProgress += BuilderOnStepProgress;

            InitializeComponent();
        }
Пример #16
0
        public void StartBuild(ICoreConfigSection coreConfigSection, bool thread)
        {
            var config = BuildConfig.FullBuildConfig(_configController, _codeParser(), _sdBuildStrings, _allExporters);
            var context = new BuildContext(BuildMessenger, _sdBuildStrings, config);

            if (thread)
            {
                Stop();
                _buildThread = new Thread(context.StartBuild);
                _buildThread.Start();
            }
            else
            {
                context.StartBuild();
            }
        }
Пример #17
0
        private SDSolution ParseSolution(CSharpSolution solution, ICoreConfigSection sharpDoxConfig, Dictionary<string, string> tokens, bool structured)
        {
            var sdSolution = new SDSolution(solution.SolutionFile);
            var targetFxParser = new SDTargetFxParser();

            _currentProjectIndex = 1;
            _totalProjects = solution.Projects.Count;
            for (var i = 0; i < solution.Projects.Count; i++)
            {
                ExecuteOnStepProgress((int)(((double)i / (double)solution.Projects.Count) * 50) + 20);

                var project = solution.Projects[i];
                var projectFileName = project.FileName;
                var targetFx = targetFxParser.GetTargetFx(projectFileName);

                var sdRepository = sdSolution.GetExistingOrNew(targetFx);
                if (structured)
                {
                    StructureParseNamespaces(project, sdRepository);
                    StructureParseTypes(project, sdRepository);
                }
                else
                {
                    ParseNamespaces(project, sdRepository, sharpDoxConfig, tokens);
                    ParseTypes(project, sdRepository, sharpDoxConfig);

                    // Because of excluding privates, internals and protected members
                    // it is possible, that a namespace has no visible namespaces at all.
                    // It is necessary to remove empty namespaces.
                    RemoveEmptyNamespaces(sdRepository);
                }
                _currentProjectIndex++;
            }

            ExecuteOnStepProgress(80);
            if (!structured)
            {
                var i = 0;
                foreach (var sdRepository in sdSolution.Repositories)
                {
                    ParseMethodCalls(solution, sdRepository);
                    ResolveUses(sdRepository);
                }
            }

            return sdSolution;
        }
Пример #18
0
        public SDSolution GetParsedSolution(string solutionFile, ICoreConfigSection sharpDoxConfig, Dictionary<string, string> tokens, bool parseMethodCalls, bool ignoreExcludes = false)
        {
            var sdSolution = new SDSolution(solutionFile);
            var solution = _roslynLoader.LoadSolutionFile(solutionFile);

            var parserOptions = new ParserOptions();
            parserOptions.CodeSolution = solution;
            parserOptions.SDSolution = sdSolution;
            parserOptions.SharpDoxConfig = sharpDoxConfig;
            parserOptions.Tokens = tokens;
            parserOptions.IgnoreExcludes = ignoreExcludes;

            ParseProjects(parserOptions);
            CleanUpNamespaces(sdSolution);

            if (parseMethodCalls) ParseMethodCalls(parserOptions);
            ResolveSeeTokens(parserOptions);
            ResolveUses(parserOptions);

            return sdSolution;
        }
Пример #19
0
 internal PropertyParser(SDRepository repository, TypeParser typeParser, ICoreConfigSection sharpDoxConfig) : base(repository, sharpDoxConfig)
 {
     _typeParser = typeParser;
 }
Пример #20
0
 internal TypeParser(SDRepository repository, ICoreConfigSection sharpDoxConfig) : base(repository, sharpDoxConfig) { }
Пример #21
0
        private void ParseNamespaces(CSharpProject project, SDRepository sdRepository, ICoreConfigSection sharpDoxConfig, Dictionary<string, string> tokens)
        {
            var namespaceParser = new NamespaceParser(sdRepository, sharpDoxConfig, sharpDoxConfig.InputFile, tokens);
            namespaceParser.OnDocLanguageFound += ExecuteOnDocLanguageFound;
            namespaceParser.OnItemParseStart += (n) => { PostParseMessage(_parserStrings.ParsingNamespace + ": " + n); };

            namespaceParser.ParseProjectNamespaces(project);
        }
Пример #22
0
        private void ParseTypes(CSharpProject project, SDRepository sdRepository, ICoreConfigSection sharpDoxConfig)
        {
            var typeParser = new TypeParser(sdRepository, sharpDoxConfig);
            typeParser.OnItemParseStart += (n) => { PostParseMessage(_parserStrings.ParsingClass + ": " + n); };

            typeParser.ParseProjectTypes(project);
        }
Пример #23
0
 internal NamespaceParser(SDRepository repository, ICoreConfigSection sharpDoxConfig, string inputFile, Dictionary<string, string> tokens) : base(repository, sharpDoxConfig)
 {
     _descriptionFiles = Directory.EnumerateFiles(Path.GetDirectoryName(inputFile), "*.sdnd", SearchOption.AllDirectories).ToList();
     _tokens = tokens;
 }
Пример #24
0
 public SDSolution GetFullParsedSolution(string solutionFile, ICoreConfigSection sharpDoxConfig, Dictionary<string, string> tokens)
 {
     var solution = LoadSolution(solutionFile);
     return ParseSolution(solution, sharpDoxConfig, tokens, false);
 }
Пример #25
0
 internal BaseParser(SDRepository repository, ICoreConfigSection sharpDoxConfig = null)
 {
     _repository = repository;
     _sharpDoxConfig = sharpDoxConfig;
     _documentationParser = new DocumentationParser();
 }