Пример #1
0
        public PathFinderViewModel(IPresentationCreationService presentationCreationService, IDocumentLoader documentLoader, PathFinderClient client)
        {
            myPresentationCreationService = presentationCreationService;
            myDocumentLoader = documentLoader;
            myClient         = client;

            CreateGraphCommand    = new DelegateCommand(CreateGraph, () => ConfigFile != null && IsReady);
            CancelCommand         = new DelegateCommand(OnCancel, () => !IsReady);
            OpenConfigFileCommand = new DelegateCommand(OnOpenConfigFile, () => IsReady);
            ClosedCommand         = new DelegateCommand(OnClosed);

            OpenFileRequest = new InteractionRequest <OpenFileDialogNotification>();

            IsReady = true;
            AssemblyReferencesOnly = false;
        }
Пример #2
0
        public InheritanceGraphBuilderViewModel(IPresentationCreationService presentationCreationService, IStatusMessageService statusMessageService, InheritanceClient inheritanceClient)
        {
            myPresentationCreationService = presentationCreationService;
            myStatusMessageService        = statusMessageService;
            myInheritanceClient           = inheritanceClient;

            Types      = new ObservableCollection <TypeDescriptor>();
            TypeFilter = OnFilterItem;

            CreateGraphCommand    = new DelegateCommand(CreateGraph, () => TypeToAnalyse != null && IsReady);
            AddToGraphCommand     = new DelegateCommand(AddToGraph, () => TypeToAnalyse != null && IsReady);
            CancelCommand         = new DelegateCommand(OnCancel, () => !IsReady);
            BrowseAssemblyCommand = new DelegateCommand(OnBrowseClicked, () => IsReady);
            ClosedCommand         = new DelegateCommand(OnClosed);

            OpenFileRequest = new InteractionRequest <OpenFileDialogNotification>();

            IsReady           = true;
            IgnoreDotNetTypes = true;
        }
Пример #3
0
        public PackagingGraphBuilderViewModel(IPresentationCreationService presentationCreationService, IStatusMessageService statusMessageService, PackageAnalysisClient analysisClient)
        {
            myPresentationCreationService = presentationCreationService;
            myStatusMessageService        = statusMessageService;
            myAnalysisClient = analysisClient;

            Document          = new TextDocument();
            Document.Changed += Document_Changed;

            Packages = new ObservableCollection <string>();

            CreateGraphCommand = new DelegateCommand(OnCreateGraph, () => IsReady && Packages.Count > 0);
            CancelCommand      = new DelegateCommand(OnCancel, () => !IsReady);

            ClosedCommand = new DelegateCommand(OnClosed);

            OpenCommand     = new DelegateCommand(OnOpen, () => IsReady);
            OpenFileRequest = new InteractionRequest <OpenFileDialogNotification>();

            myCompletionData = GetType().Assembly.GetTypes()
                               .Where(t => t.Namespace == typeof(SystemPackaging).Namespace)
                               .Where(t => !t.IsAbstract)
                               .Where(t => t.GetCustomAttribute(typeof(CompilerGeneratedAttribute), true) == null)
                               .Select(t => new ElementCompletionData(t))
                               .ToList();

            UsedTypesOnly = true;

            myGraphToSpecSynchronizer = new GraphToSpecSynchronizer(
                () => SpecUtils.Deserialize(Document.Text),
                spec =>
            {
                Document.Text = SpecUtils.Serialize(spec);
                Save();
            });

            IsReady = true;
        }