public bool SaveDocument(IDocumentModel documentModel, Stream stream, IExporterOptions options)
        {
            BBCodeExporter exporter = new BBCodeExporter((DocumentModel)documentModel, (BBCodeDocumentExporterOptions)options);

            exporter.Export(stream);
            return(true);
        }
예제 #2
0
 public AssemblyXmlParser(IDocumentationXmlMatcher xmlMatcher, IDocumentModel documentModel,
                          IDocumentableMemberFinder documentableMembers)
 {
     this.xmlMatcher = xmlMatcher;
     this.documentModel = documentModel;
     this.documentableMembers = documentableMembers;
 }
예제 #3
0
 public UndoableRleCollectionRemoveRangeHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int index, int count)
     : base(documentModel.MainPart)
 {
     this.collection = collection;
     this.index      = index;
     this.count      = count;
 }
예제 #4
0
 public UndoableRleCollectionSetValueHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int index, T value)
     : base(documentModel.MainPart)
 {
     this.collection = collection;
     this.newValue   = value;
     this.index      = index;
 }
예제 #5
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="documentTypeKey"></param>
 public FileBaseViewModel(string documentTypeKey, IMessageBoxService IMsgBox)
     : this()
 {
     _MsgBox         = IMsgBox;
     MDocumentModel  = new DocumentModel();
     DocumentTypeKey = documentTypeKey;
 }
        private void SetSelectedDropDownLists(IDocumentModel document)
        {
            var selectedPurpose = _context.Purposes
                                  .AsNoTracking()
                                  .FirstOrDefault(x => x.Id == document.PurposeId);

            var selectedStatus = _context.Statuses
                                 .AsNoTracking()
                                 .FirstOrDefault(x => x.Id == document.StatusId);

            var selectedVisaType = _context.VisaType
                                   .AsNoTracking()
                                   .FirstOrDefault(x => x.Id == document.VisaTypeId);

            var selectedVisaDateType = _context.VisaDateType
                                       .AsNoTracking()
                                       .FirstOrDefault(x => x.Id == document.VisaDateTypeId);

            var selectedOwner = _context.DocumentOwners
                                .AsNoTracking()
                                .FirstOrDefault(x => x.Id == document.OwnerId);

            var selectedApplicant = _context.Applicants
                                    .AsNoTracking()
                                    .FirstOrDefault(x => x.Id == document.ApplicantId);

            PopulateApplicantsDropDownList(selectedApplicant);
            PopulateOwnersDropDownList(selectedOwner);
            PopulatePurposesDropDownList(selectedPurpose);
            PopulateStatusesDropDownList(selectedStatus);
            PopulateVisaTypeDropDownList(selectedVisaType);
            PopulateVisaDateTypeDropDownList(selectedVisaDateType);
        }
예제 #7
0
 public void Dispose()
 {
     if (this.mDocumentModel != null)
     {
         this.mDocumentModel.Dispose();
         this.mDocumentModel = null;
     }
 }
예제 #8
0
 public UndoableRleCollectionInsertRangeHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int index, IRleCollection <T> range, IRleCollectionValueConverter <T> valueConverter)
     : base(documentModel.MainPart)
 {
     this.collection     = collection;
     this.index          = index;
     this.newRange       = range;
     this.valueConverter = valueConverter;
 }
예제 #9
0
 public UndoableRleCollectionSetRangeValueHistoryItem(IDocumentModel documentModel, RleCollection <T> collection, int startIndex, int endIndex, T value)
     : base(documentModel.MainPart)
 {
     this.collection = collection;
     this.startIndex = startIndex;
     this.endIndex   = endIndex;
     this.newValue   = value;
 }
예제 #10
0
 public void Dispose()
 {
     if (MDocumentModel != null)
     {
         MDocumentModel.Dispose();
         MDocumentModel = null;
     }
 }
예제 #11
0
        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="file"></param>
        public FileChangeWatcher(IDocumentModel file)
        {
            _mFile = file ?? throw new ArgumentNullException(nameof(file));

            ////SD.Workbench.MainWindow.Activated += MainForm_Activated;

            _mFile.FileNameChanged += file_FileNameChanged;
            ////FileChangeWatcher.activeWatchers.Add(this);

            ////Bugfix: Watching files by default can cause application file load deadlock situations(?)
            ////this.SetWatcher();
        }
예제 #12
0
파일: EdiViewModel.cs 프로젝트: Sugz/Edi
        /// <summary>
        /// Load a files contents into the viewmodel for viewing and editing.
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="closeOnErrorWithoutMessage"></param>
        /// <returns></returns>
        public static EdiViewModel LoadFile(IDocumentModel dm,
                                            ISettingsManager settings,
                                            bool closeOnErrorWithoutMessage = false)
        {
            EdiViewModel vm = new EdiViewModel();

            vm.InitInstance(settings.SettingData);
            vm.FilePath = dm.FileNamePath;
            vm.CloseOnErrorWithoutMessage = closeOnErrorWithoutMessage;

            vm.LoadFileAsync(vm.FilePath);
            ////vm.OpenFile(filePath);   // Non-async file open version

            return(vm);
        }
예제 #13
0
        ////public static void DisableAllChangeWatchers()
        ////{
        ////	////SD.MainThread.VerifyAccess();
        ////	globalDisableCount++;
        ////
        ////	foreach (FileChangeWatcher w in activeWatchers)
        ////		w.SetWatcher();
        ////
        ////	////Project.ProjectChangeWatcher.OnAllChangeWatchersDisabledChanged();
        ////}

        ////public static void EnableAllChangeWatchers()
        ////{
        ////	////SD.MainThread.VerifyAccess();
        ////
        ////	if (globalDisableCount == 0)
        ////		throw new InvalidOperationException();
        ////
        ////	globalDisableCount--;
        ////
        ////	foreach (FileChangeWatcher w in activeWatchers)
        ////		w.SetWatcher();
        ////
        ////	////Project.ProjectChangeWatcher.OnAllChangeWatchersDisabledChanged();
        ////}

        public void Dispose()
        {
            ////SD.MainThread.VerifyAccess();
            ////activeWatchers.Remove(this);

            if (this.mFile != null)
            {
                ////SD.Workbench.MainWindow.Activated -= MainForm_Activated;
                this.mFile.FileNameChanged -= file_FileNameChanged;
                this.mFile = null;
            }

            if (this.mWatcher != null)
            {
                this.mWatcher.Changed -= OnFileChangedEvent;
                this.mWatcher.Created -= OnFileChangedEvent;
                this.mWatcher.Renamed -= OnFileChangedEvent;

                this.mWatcher.Dispose();
                this.mWatcher = null;
            }
        }
 public DummyDocumentController(IDocumentModel model)
 {
     this.model = model;
 }
예제 #15
0
        // Constructors are not intended for external usage outside of this class
        // Use the static methods provided to initialize this viewmodel

        /// <summary>
        /// Class constructor from <seealso cref="IDocumentModel"/> parameter.
        /// </summary>
        /// <param name="documentModel"></param>
        protected EdiViewModel(IDocumentModel documentModel, IMessageBoxService IMsgBox)
            : this(IMsgBox)
        {
            MDocumentModel.SetFileNamePath(documentModel.FileNamePath, documentModel.IsReal);
        }
예제 #16
0
 /// <summary>
 /// Load a UML editor file based on an <seealso cref="IDocumentModel"/>
 /// representation and an <seealso cref="ISettingsManager"/> instance.
 /// </summary>
 /// <param name="dm"></param>
 /// <param name="o">Should point to a <seealso cref="ISettingsManager"/> instance.</param>
 /// <returns></returns>
 public static MiniUmlViewModel LoadFile(IDocumentModel dm, object o,
                                         IMessageBoxService msgBox)
 {
     return(LoadFile(dm.FileNamePath));
 }
예제 #17
0
 /// <summary>
 /// Class constructor from <seealso cref="IDocumentModel"/> parameter.
 /// </summary>
 /// <param name="documentModel"></param>
 public MiniUmlViewModel(IDocumentModel documentModel, IMessageBoxService IMsgBox)
     : this(IMsgBox)
 {
     MDocumentModel = documentModel;
     MDocumentModel.SetFileNamePath(FilePath, IsFilePathReal);
 }
예제 #18
0
 /// <summary>
 /// Class constructor from <seealso cref="IDocumentModel"/> parameter.
 /// </summary>
 /// <param name="documentModel"></param>
 public MiniUmlViewModel(IDocumentModel documentModel)
     : this()
 {
     MDocumentModel = documentModel;
     MDocumentModel.SetFileNamePath(FilePath, IsFilePathReal);
 }
예제 #19
0
 public void CreateStubs()
 {
     StubDocXmlMatcher = MockRepository.GenerateStub <IDocumentationXmlMatcher>();
     StubDocModel      = MockRepository.GenerateStub <IDocumentModel>();
     StubDocMembers    = MockRepository.GenerateStub <IDocumentableMemberFinder>();
 }
예제 #20
0
 /// <summary>
 /// Load a UML editor file based on an <seealso cref="IDocumentModel"/>
 /// representation and an <seealso cref="ISettingsManager"/> instance.
 /// </summary>
 /// <param name="dm"></param>
 /// <param name="o">Should point to a <seealso cref="ISettingsManager"/> instance.</param>
 /// <returns></returns>
 public static MiniUmlViewModel LoadFile(IDocumentModel dm, object o)
 {
     return(MiniUmlViewModel.LoadFile(dm.FileNamePath));
 }
 public DummyDocumentController(IDocumentModel model)
 {
     this.model = model;
 }
예제 #22
0
 /// <summary>
 /// Class constructor from <seealso cref="IDocumentModel"/> parameter.
 /// </summary>
 /// <param name="documentModel"></param>
 public MiniUmlViewModel(IDocumentModel documentModel)
     : this()
 {
     this.mDocumentModel = documentModel;
     this.mDocumentModel.SetFileNamePath(this.FilePath, this.IsFilePathReal);
 }
예제 #23
0
 public static Log4NetViewModel LoadFile(IDocumentModel dm, object o)
 {
     return(Log4NetViewModel.LoadFile(dm.FileNamePath));
 }
예제 #24
0
 public static IFileBaseViewModel CreateNewDocument(IDocumentModel documentModel,
                                                    IMessageBoxService IMsgBox)
 {
     return(new EdiViewModel(documentModel, IMsgBox));
 }
예제 #25
0
 /// <summary>
 /// Load an Edi text editor file based on an <seealso cref="IDocumentModel"/>
 /// representation and a <seealso cref="ISettingsManager"/> instance.
 /// </summary>
 /// <param name="dm"></param>
 /// <param name="o">Should point to a <seealso cref="ISettingsManager"/> instance.</param>
 /// <returns></returns>
 public static EdiViewModel LoadFile(IDocumentModel dm,
                                     object o,
                                     IMessageBoxService msgBox)
 {
     return(LoadFile(dm, o as ISettingsManager, msgBox));
 }
예제 #26
0
 public AssemblyXmlParser(IDocumentationXmlMatcher xmlMatcher, IDocumentModel documentModel, IDocumentableMemberFinder documentableMembers)
 {
     this.xmlMatcher          = xmlMatcher;
     this.documentModel       = documentModel;
     this.documentableMembers = documentableMembers;
 }
예제 #27
0
 /// <summary>
 /// Class constructor from <seealso cref="IDocumentModel"/> parameter.
 /// </summary>
 /// <param name="documentModel"></param>
 public EdiViewModel(IDocumentModel documentModel)
     : this()
 {
     MDocumentModel.SetFileNamePath(documentModel.FileNamePath, documentModel.IsReal);
 }
예제 #28
0
파일: EdiViewModel.cs 프로젝트: Sugz/Edi
 public static IFileBaseViewModel CreateNewDocument(IDocumentModel documentModel)
 {
     return(new EdiViewModel(documentModel));
 }
예제 #29
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 /// <param name="documentTypeKey"></param>
 public FileBaseViewModel(string documentTypeKey)
     : this()
 {
     this.mDocumentModel   = new DocumentModel();
     this.mDocumentTypeKey = documentTypeKey;
 }
예제 #30
0
파일: EdiViewModel.cs 프로젝트: Sugz/Edi
 /// <summary>
 /// Load an Edi text editor file based on an <seealso cref="IDocumentModel"/>
 /// representation and a <seealso cref="ISettingsManager"/> instance.
 /// </summary>
 /// <param name="dm"></param>
 /// <param name="o">Should point to a <seealso cref="ISettingsManager"/> instance.</param>
 /// <returns></returns>
 public static EdiViewModel LoadFile(IDocumentModel dm,
                                     object o)
 {
     return(EdiViewModel.LoadFile(dm, o as ISettingsManager));
 }
예제 #31
0
 public void CreateStubs()
 {
     StubDocXmlMatcher = MockRepository.GenerateStub<IDocumentationXmlMatcher>();
     StubDocModel = MockRepository.GenerateStub<IDocumentModel>();
     StubDocMembers = MockRepository.GenerateStub<IDocumentableMemberFinder>();
 }
예제 #32
0
 public static Log4NetViewModel LoadFile(IDocumentModel dm,
                                         object o,
                                         IMessageBoxService msgBox)
 {
     return(Log4NetViewModel.LoadFile(dm.FileNamePath, msgBox));
 }