コード例 #1
0
 /// <summary>
 /// Constructeur
 /// </summary>
 public SimpleTextView(IDocumentController controller)
 {
     listControls = new SortedList<string, Control>();
     availableTypes = new SortedList<string, Type>();
     simpleName = "Vue texte simple";            
     Controller = controller;
     InitializeComponent();
     Initialize();         
 }
コード例 #2
0
ファイル: LinePlanModule.cs プロジェクト: wcrooy/cwpfsamples
 /// <summary>
 /// Creates a new instance of <c>LinePlanModule</c>.
 /// </summary>
 public LinePlanModule(
     IUnityContainer container,
     IRegionManager regionManager
     )
 {
     this.container = container;
     this.regionManager = regionManager;
     explorerController = container.Resolve<IDocumentController>(
         ControllerNames.ExplorerController);
 }
コード例 #3
0
 /// <summary>
 /// Constructeur
 /// </summary>
 public SimpleTextView(IDocumentData model, IDocumentController controller)
 {
     listControls = new SortedList<string, Control>();
     availableTypes = new SortedList<string, Type>();
     simpleName = "Vue texte simple";
     Model = model;
     Controller = controller;
     InitializeComponent();
     Initialize();
     model.Change += new EventHandler(OnChange);
 }
コード例 #4
0
		public ShellViewModel(IUnityContainer container, IEventAggregator eventAggregator)
		{
			this.container = container;
			this.EventAggregator = eventAggregator;
			ShowAboutCommand = new DelegateCommand<object>(DoShowAboutExecuted);
			ExitApplicationCommand = new DelegateCommand<object>(DoExitApplicationExecuted);

			DocumentController = container.Resolve<IDocumentController>(Controllers.DocumentController);
			WorkspaceDocumentController = container.Resolve<IDocumentController>(Controllers.WorkspaceDocumentController);
						
			CloseCurrentDocumentCommand = new DelegateCommand<object>(CloseCurrentDocument, CanCloseCurrentDocument);
			CloseDocumentCommand = new DelegateCommand<DocumentBase>(DocumentController.CloseDocument);			
		}
コード例 #5
0
        /// <summary>
        /// Creates a new instance of <c>NotesBrowserModel</c>.
        /// </summary>
        public NotesBrowserModel(IUnityContainer container) {
            OpenNoteCommand = new DelegateCommand<Note>(OpenNote);
            DeleteSelectedNoteCommand = new DelegateCommand<object>(
                DeleteSelectedNote, CanDeleteSelectedNote);
            CreateNewNoteCommand = new DelegateCommand<object>(CreateNewNote);

            view = new NotesBrowser(this);
            service = container.Resolve<INoteService>();
            documentController = container.Resolve<IDocumentController>(
                ControllerNames.DocumentController);

            Notes = new ObservableCollection<Note>();
            LoadAllNotes();
        }
コード例 #6
0
        public void AddDocumentToList()
        {
            this.controller = new DocumentControllerV2();
            var document = new Document {
                Name = "Kwstas"
            };

            this.objDocument.DocumentList = new BindingList <Document>();
            this.objDocument.Document     = document;
            this.objDocument.DocumentList.Add(this.objDocument.Document);
            this.objDocument.Done = this.objDocument.DocumentList.Contains(this.objDocument.Document);
            Assert.AreEqual(this.objDocument.Document.Name, "Kwstas");
            Assert.AreEqual(this.objDocument.Done, true);
        }
コード例 #7
0
        /// <summary>
        /// Creates a new instance of <c>NotesBrowserModel</c>.
        /// </summary>
        public NotesBrowserModel(IUnityContainer container)
        {
            OpenNoteCommand           = new DelegateCommand <Note>(OpenNote);
            DeleteSelectedNoteCommand = new DelegateCommand <object>(
                DeleteSelectedNote, CanDeleteSelectedNote);
            CreateNewNoteCommand = new DelegateCommand <object>(CreateNewNote);

            view               = new NotesBrowser(this);
            service            = container.Resolve <INoteService>();
            documentController = container.Resolve <IDocumentController>(
                ControllerNames.DocumentController);

            Notes = new ObservableCollection <Note>();
            LoadAllNotes();
        }
コード例 #8
0
ファイル: SimpleTextView.cs プロジェクト: NicolasR/Composants
        /// <summary>
        /// Constructeur
        /// </summary>
        public SimpleTextView(IDocumentController controller, int id)
        {            
            simpleName = "Vue texte simple";
            listControls = new SortedList<string, Control>();
            availableTypes = new SortedList<string, Type>();

            Id = id;
            Controller = controller;

            InitializeComponent();
            Initialize();

            Controller.Model.Change += new EventHandler<MessageEventArgs>(Model_Change);
            Controller.NeedToCloseView += new EventHandler<CommandEventArgs>(Controller_NeedToCloseView);
            RegistryExtended.MergeInMainTools(tools);            
        }
コード例 #9
0
        /// <summary>
        /// Creates a new instance of <c>LinePlanExplorerDataModel</c>.
        /// </summary>
        public LinePlanExplorerModel(IUnityContainer container)
        {
            OpenLinePlanCommand = new DelegateCommand<LinePlan>(
                OpenLinePlan, CanOpenLinePlan);

            view = new LinePlanExplorer(this);
            service = container.Resolve<ILinePlanService>();
            documentController = container.Resolve<IDocumentController>(
                ControllerNames.DocumentController);

            //State = ModelState.Fectching;
            //if (!ThreadPool.QueueUserWorkItem(new WaitCallback(FetchLinePlans))) {
            //    State = ModelState.Invalid;
            //}
            LinePlans = new ObservableCollection<LinePlan>();
            LoadAllLinePlans();
        }
コード例 #10
0
        public void AskForSave(string documentName, IDocumentController controller)
        {
            string message = null;
            bool isNewFile = documentName.Length == 0;
            if (isNewFile)
                message = "Le fichier "+documentName+" a été modifié. Voulez-vous le sauvegarder?";
            else
                message = "Le fichier n'a pas été sauvegardé. Voulez-vous le sauvegarder?";

            DialogResult result = MessageBox.Show(message, "Enregistrement", MessageBoxButtons.YesNoCancel);
            switch (result)
            {
                case DialogResult.Yes:
                    if (isNewFile)
                        SaveDocumentAs(controller);
                    else
                        SaveDocument(documentName, controller);
                    break;
                case DialogResult.No:
                    break;

                case DialogResult.Cancel:
                    return;
            }
            Command command = new Command(MCommandType.ConfirmCloseView, null);
            string file = Path.GetFileNameWithoutExtension(documentName);
            controller.ReceiveCommand(command);
        }
コード例 #11
0
 public void SetupTest()
 {
     this.controller  = new DocumentController();
     this.objDocument = new ChangesOnDocuments();
 }
コード例 #12
0
        /// <summary>
        /// Sauvegarde le document dans un nom de fichier spécifié
        /// </summary>
        public void SaveDocumentAs(IDocumentController controller)
        {
            filesaver.Filter = Buildfilter();         

            DialogResult result = filesaver.ShowDialog();
            if (result != DialogResult.OK)
                return;
            
            string extension = this.GetExtension(Path.GetExtension(filesaver.FileName));
            if (!availableSerializers.ContainsKey(extension))
                throw new ArgumentException();
            
            String[] arguments = { filesaver.FileName, extension };
            Command command = new Command(MCommandType.PerformSaveAs, arguments);
            controller.ReceiveCommand(command);

            viewList.SelectedTab.Text = Path.GetFileNameWithoutExtension(filesaver.FileName);
        }
コード例 #13
0
 /// <summary>
 /// Sauvegarde le document
 /// </summary>
 public void SaveDocument(string documentName, IDocumentController controller)
 {
     string fileName = ViewInfos.getCurrentViewController().DocumentName;
     if (fileName.Length == 0)
     {
         SaveDocumentAs(controller);
         return;
     }
     Command command = new Command(MCommandType.PerformSave, null);
     ViewInfos.getCurrentViewController().ReceiveCommand(command);
 }
コード例 #14
0
 /// <summary>
 /// Creates a new instance of <c>NotesModule</c>.
 /// </summary>
 public NotesModule(IUnityContainer container)
 {
     this.container           = container;
     systemDocumentController = container.Resolve <IDocumentController>(
         ControllerNames.SystemDocumentController);
 }
コード例 #15
0
 /// <summary>
 /// Creates a new instance of <c>WelcomeModule</c>.
 /// </summary>
 public WelcomeModule(IUnityContainer container)
 {
     this.container     = container;
     documentController = container.Resolve <IDocumentController>(
         ControllerNames.DocumentController);
 }
コード例 #16
0
        /// <summary>
        /// Crée une vue
        /// </summary>
        /// <param name="viewSelected">
        /// Item sur lequel a cliqué l'utilisateur et correspondant à la vue désirée.
        /// </param>
        /// <param name="controller">
        /// Contrôleur à laquelle ajouter la vue.
        /// </param>
        /// <returns></returns>
        private Control CreateView(ToolStripMenuItem viewSelected, IDocumentController controller)
        {
            if (viewSelected == null)
                throw new InvalidCastException();

            if(!availableViews.ContainsKey(viewSelected.Text))
                throw new ArgumentException("Type de vue non géré par l'application");

            int id = GenerateID();
            Type viewType = availableViews[viewSelected.Text];
            Type[] paramsTypes = { typeof(DocumentController), typeof(int) };
            Object[] param = { controller, id };
            ConstructorInfo CInfo = viewType.GetConstructor(paramsTypes);

            Control view = (Control)CInfo.Invoke(param);
            IDocumentView iview = view as IDocumentView;

            controller.AddView(iview);
            view.Dock = DockStyle.Fill;            
            return view;
        }
コード例 #17
0
 /// <summary>
 /// Creates a new instance of <c>NotesModule</c>.
 /// </summary>
 public NotesModule(IUnityContainer container) {
     this.container = container;
     systemDocumentController = container.Resolve<IDocumentController>(
         ControllerNames.SystemDocumentController);
 }
コード例 #18
0
		public DocumentsWorkSpaceModule(IUnityContainer container)
		{
			this.container = container;
			workspaceDocumentController = container.Resolve<IDocumentController>(Controllers.WorkspaceDocumentController);				

		}
コード例 #19
0
 /// <summary>
 /// Creates a new instance of <c>WelcomeModule</c>.
 /// </summary>
 public WelcomeModule(IUnityContainer container) {
     this.container = container;
     documentController = container.Resolve<IDocumentController>(
         ControllerNames.DocumentController);
 }
コード例 #20
0
        /// <summary>
        /// Construit l'interface de conception
        /// </summary>
        public DesignerCluster(IDocumentController controller, int id)
        {
            InitializeComponent();

            Registry.MergeInMainMenu( menu );
            Registry.MergeInMainTools( tools );

            simpleName = "Vue conception";
            availableTypes = new SortedList<string, Type>();
            Id = id;
            Controller = controller;

            Controller.Model.Change += new EventHandler<MessageEventArgs>(Model_Change);
            Controller.NeedToCloseView += new EventHandler<CommandEventArgs>(Controller_NeedToCloseView);
            Initialize();
        }
コード例 #21
0
		public StartPageModule(IUnityContainer container) 
		 {
            this.container = container;
            documentController = container.Resolve<IDocumentController>(Controllers.DocumentController);
        }
コード例 #22
0
 /// <summary>
 /// Creates a new instance of <c>WelcomeModuleController</c>.
 /// </summary>
 public WelcomeModuleController(IUnityContainer container)
 {
     this.documentController = container.Resolve<IDocumentController>(
         ControllerNames.DocumentController);
     ShowWelcomeCommand = new DelegateCommand<object>(DoShowWelcome);
 }