Exemple #1
0
        public TimelineEditor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            IPaletteService paletteService,
            ISettingsService settingsService)
        {
            s_schemaLoader = new SchemaLoader();
            s_repository.DocumentAdded += repository_DocumentAdded;
            s_repository.DocumentRemoved += repository_DocumentRemoved;

            paletteService.AddItem(Schema.markerType.Type, "Timelines", this);
            paletteService.AddItem(Schema.groupType.Type, "Timelines", this);
            paletteService.AddItem(Schema.trackType.Type, "Timelines", this);
            paletteService.AddItem(Schema.intervalType.Type, "Timelines", this);
            paletteService.AddItem(Schema.keyType.Type, "Timelines", this);
            paletteService.AddItem(Schema.timelineRefType.Type, "Timelines", this);

            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_controlHostService = controlHostService;
            m_documentService = documentService;
            m_settingsService = settingsService;
        }
Exemple #2
0
        public Editor(
            ICommandService commandService,
            IControlHostService controlHostService,
            IDocumentService documentService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService
            )
        {
            m_commandService = commandService;
            m_controlHostService = controlHostService;
            m_documentService = documentService;
            m_documentRegistry = documentRegistry;
            m_fileDialogService = fileDialogService;

            // create a document client for each file type
            m_txtDocumentClient = new DocumentClient(this, ".txt");
            m_csDocumentClient = new DocumentClient(this, ".cs");
            m_luaDocumentClient = new DocumentClient(this, ".lua");
            m_nutDocumentClient = new DocumentClient(this, ".nut");
            m_pyDocumentClient = new DocumentClient(this, ".py");
            m_xmlDocumentClient = new DocumentClient(this, ".xml");
            m_daeDocumentClient = new DocumentClient(this, ".dae");
            m_cgDocumentClient = new DocumentClient(this, ".cg");

        }
 public LevelEditorFileCommands(
     ICommandService commandService,
     IDocumentRegistry documentRegistry,
     IFileDialogService fileDialogService) : base(commandService,documentRegistry,fileDialogService)
 {
     RegisterCommands = (RegisterCommands & ~(CommandRegister.FileSaveAll | CommandRegister.FileClose));
 }
Exemple #4
0
 public GameEditor(
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,            
     IControlHostService controlHostService,
     ICommandService commandService,
     IDocumentService documentService,
     IPaletteService paletteService,
     ISettingsService settingsService,            
     IResourceService resourceService,
     LevelEditorCore.ResourceLister resourceLister,            
     BookmarkLister bookmarkLister
     )
 {
     m_contextRegistry = contextRegistry;
     m_documentRegistry = documentRegistry;
     m_paletteService = paletteService;
     m_settingsService = settingsService;            
     m_documentService = documentService;            
     m_resourceService = resourceService;
     m_resourceLister = resourceLister;            
     m_bookmarkLister = bookmarkLister;
     
     //to-do wire it to to command service
     InputScheme.ActiveControlScheme = new MayaControlScheme();
     ResolveOnLoad = true;
 }
Exemple #5
0
 public SourceControlCommands(
     ICommandService commandService,
     IDocumentRegistry documentRegistry,
     IDocumentService documentService)
     : base(commandService, documentRegistry, documentService)
 {
 }
Exemple #6
0
        public Editor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            PrototypeLister prototypeLister,
            SchemaLoader schemaLoader,
            DiagramTheme diagramTheme)
        {
            m_controlHostService = controlHostService;
            m_commandService = commandService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_documentService = documentService;
            m_prototypeLister = prototypeLister;

            m_schemaLoader = schemaLoader;

            m_theme = new D2dDiagramTheme();
            m_fsmRenderer = new D2dDigraphRenderer<State, Transition>(m_theme);

            string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\FsmEditor\\data");
            EditorInfo.InitialDirectory = initialDirectory;
        }
 public CommandLineArgsService(
     IDocumentRegistry documentRegistry,
     IDocumentService documentService)
 {
     m_documentRegistry = documentRegistry;
     m_documentService = documentService;
 }
Exemple #8
0
 public SourceControlContext(
     IDocumentRegistry documentRegistry,
     IContextRegistry contextRegistry)
 {
     m_documentRegistry = documentRegistry;
     m_contextRegistry = contextRegistry;
 }
Exemple #9
0
        public Editor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            PrototypeLister prototypeLister,
            LayerLister layerLister,
            SchemaLoader schemaLoader)
        {
            m_controlHostService = controlHostService;
            m_commandService = commandService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_documentService = documentService;
            m_prototypeLister = prototypeLister;
            m_layerLister = layerLister;
            
            m_schemaLoader = schemaLoader;

            string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\CircuitEditor\\data");
            EditorInfo.InitialDirectory = initialDirectory;
            m_theme = new D2dDiagramTheme();
            m_circuitRenderer = new D2dCircuitRenderer<Module, Connection, ICircuitPin>(m_theme, documentRegistry);
            m_subGraphRenderer = new D2dSubCircuitRenderer<Module, Connection, ICircuitPin>(m_theme);

            // create d2dcontrol for displaying sub-circuit            
            m_d2dHoverControl = new D2dAdaptableControl();
            m_d2dHoverControl.Dock = DockStyle.Fill;
            var xformAdapter = new TransformAdapter();
            xformAdapter.EnforceConstraints = false;//to allow the canvas to be panned to view negative coordinates
            m_d2dHoverControl.Adapt(xformAdapter, new D2dGraphAdapter<Module, Connection, ICircuitPin>(m_circuitRenderer, xformAdapter));
            m_d2dHoverControl.DrawingD2d += new EventHandler(m_d2dHoverControl_DrawingD2d);
        }
 public AutoDocumentService(
     IDocumentRegistry documentRegistry,
     IDocumentService documentService)
 {
     m_documentRegistry = documentRegistry;
     m_documentService = documentService;
 }
 public SledTitleBarTextService(MainForm mainForm, IDocumentRegistry documentRegistry)
     : base(mainForm, documentRegistry)
 {
     m_mainForm = mainForm;
     m_appName = mainForm.Text;
     m_projectText = null;
     m_userText = null;
 }
 public StandardFileCommands(
     ICommandService commandService,
     IDocumentRegistry documentRegistry,
     IFileDialogService fileDialogService)
 {
     CommandService = commandService;
     DocumentRegistry = documentRegistry;
     FileDialogService = fileDialogService;
 }
        public MainWindowTitleService(
            IMainWindow mainWindow,
            IDocumentRegistry documentRegistry)
        {
            m_mainWindow = mainWindow;

            m_documentRegistry = documentRegistry;
            m_documentRegistry.ActiveDocumentChanging += documentRegistry_ActiveDocumentChanging;
            m_documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
        }
 public RecentDocumentCommands(
     ICommandService commandService,
     IDocumentRegistry documentRegistry,
     IDocumentService documentService)
 {
     CommandService = commandService;
     documentRegistry.DocumentAdded += documentRegistry_DocumentAdded;
     m_documentService = documentService;
     documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
     m_recentDocuments.ItemRemoved += documentInfo_ItemRemoved;
 }
Exemple #15
0
 public Editor(
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     TreeLister treeLister,
     SchemaLoader schemaLoader)
 {
     m_contextRegistry = contextRegistry;
     m_documentRegistry = documentRegistry;
     m_documentRegistry.ActiveDocumentChanged += new EventHandler(documentRegistry_ActiveDocumentChanged);
     m_schemaLoader = schemaLoader;
     m_treeLister = treeLister;
 }
Exemple #16
0
 public Editor(
     IControlHostService controlHostService,
     IDocumentService documentService,
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     DomTypes domTypes)
 {
     m_controlHostService = controlHostService;
     m_documentService = documentService;
     m_contextRegistry = contextRegistry;
     m_documentRegistry = documentRegistry;
 }
Exemple #17
0
        public SourceControlCommands(
            ICommandService commandService,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService)
        {
            m_commandService = commandService;
            m_documentService = documentService;
            m_documentRegistry = documentRegistry;

            documentRegistry.DocumentAdded += documentRegistry_DocumentAdded;
            documentService.DocumentSaved += documentService_DocumentSaved;
        }
Exemple #18
0
 public Editor(
     IControlHostService controlHostService,
     IDocumentService documentService,
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     SchemaLoader schemaLoader)
 {
     m_controlHostService = controlHostService;
     m_documentService    = documentService;
     m_contextRegistry    = contextRegistry;
     m_documentRegistry   = documentRegistry;
     m_schemaLoader       = schemaLoader;
 }
Exemple #19
0
 public Editor(
     IControlHostService controlHostService,
     IDocumentService documentService,
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     DomTypes domTypes)
 {
     m_controlHostService = controlHostService;
     m_documentService    = documentService;
     m_contextRegistry    = contextRegistry;
     m_documentRegistry   = documentRegistry;
     m_domTypes           = domTypes.GetDomTypes();
 }
Exemple #20
0
        public StandardFileCommands(
            ICommandService commandService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService)
        {
            CommandService = commandService;
            
            DocumentRegistry = documentRegistry;
            documentRegistry.ActiveDocumentChanging += ActiveDocumentChanging;
            documentRegistry.ActiveDocumentChanged += ActiveDocumentChanged;

            FileDialogService = fileDialogService;
        }
Exemple #21
0
 public Editor(
     IControlHostService controlHostService,
     IDocumentService documentService,
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     SchemaLoader schemaLoader)
 {
     m_controlHostService = controlHostService;
     m_documentService = documentService;
     m_contextRegistry = contextRegistry;
     m_documentRegistry = documentRegistry;
     m_schemaLoader = schemaLoader;
 }
Exemple #22
0
        public StandardFileCommands(
            ICommandService commandService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService)
        {
            CommandService = commandService;

            DocumentRegistry = documentRegistry;
            documentRegistry.ActiveDocumentChanging += ActiveDocumentChanging;
            documentRegistry.ActiveDocumentChanged  += ActiveDocumentChanged;

            FileDialogService = fileDialogService;
        }
Exemple #23
0
 public Editor(
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     IDocumentService documentService,
     TreeLister treeLister,
     SchemaLoader schemaLoader)
 {
     m_documentService  = documentService;
     m_contextRegistry  = contextRegistry;
     m_documentRegistry = documentRegistry;
     m_documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
     m_schemaLoader = schemaLoader;
     m_treeLister   = treeLister;
 }
Exemple #24
0
        public KeyValueEditor(ICommandService commandService,
                              IControlHostService controlHostService,
                              IContextRegistry contextRegistry,
                              IDocumentRegistry documentRegstiry,
                              IDocumentService documentService)
        {
            this.commandService     = commandService;
            this.contextRegistry    = contextRegistry;
            this.controlHostService = controlHostService;
            this.documentRegstiry   = documentRegstiry;
            this.documentService    = documentService;

            documentInfo = new DocumentClientInfo("KVDocument", (string)null, null, null, true);
        }
Exemple #25
0
        public ProjectLister(
            ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry)
            : base(commandService)
        {
            m_controlHostService = controlHostService;
            m_contextRegistry    = contextRegistry;
            m_documentRegistry   = documentRegistry;

            // The tree control always displays the contents of the active document
            m_documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
        }
Exemple #26
0
        public ProjectLister(
            ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry)
            : base(commandService)
        {
            m_controlHostService = controlHostService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;

            // The tree control always displays the contents of the active document
            m_documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
        }
Exemple #27
0
 public Editor(
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     IDocumentService documentService,
     TreeLister treeLister,
     SchemaLoader schemaLoader)
 {
     m_documentService = documentService;
     m_contextRegistry = contextRegistry;
     m_documentRegistry = documentRegistry;
     m_documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
     m_schemaLoader = schemaLoader;
     m_treeLister = treeLister;
 }
Exemple #28
0
        /// <summary>
        /// Initializes a new instance of this class</summary>
        /// <param name="theme">Diagram theme for rendering graph</param>
        /// <param name="documentRegistry">An optional document registry, used to clear the internal
        /// element type cache when a document is removed</param>
        public ScriptRenderer(D2dDiagramTheme theme, IDocumentRegistry documentRegistry) :
            base(theme, documentRegistry)
        {
            m_disabledTheme           = new D2dDiagramTheme();
            m_disabledTheme.FillBrush = D2dFactory.CreateSolidBrush(SystemColors.ControlDark);
            m_disabledTheme.TextBrush = D2dFactory.CreateSolidBrush(SystemColors.InactiveCaption);
            D2dGradientStop[] gradstops =
            {
                new D2dGradientStop(Color.DarkGray,    0),
                new D2dGradientStop(Color.DimGray,  1.0f),
            };
            m_disabledTheme.FillGradientBrush = D2dFactory.CreateLinearGradientBrush(gradstops);

            // Set the pin colors
            m_disabledTheme.RegisterCustomBrush("boolean", D2dFactory.CreateSolidBrush(Color.LightGray));
        }
Exemple #29
0
        public TreeLister(
            ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService)
            : base(commandService)
        {
            m_controlHostService = controlHostService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;

            // the tree control always displays the contents of the active document
            m_documentRegistry.ActiveDocumentChanged += new EventHandler(documentRegistry_ActiveDocumentChanged);

            m_documentService = documentService;
        }
Exemple #30
0
        public TreeLister(
            ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService)
            : base(commandService)
        {
            m_controlHostService = controlHostService;
            m_contextRegistry    = contextRegistry;
            m_documentRegistry   = documentRegistry;

            // the tree control always displays the contents of the active document
            m_documentRegistry.ActiveDocumentChanged += new EventHandler(documentRegistry_ActiveDocumentChanged);

            m_documentService = documentService;
        }
Exemple #31
0
        public Editor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            PrototypeLister prototypeLister,
            LayerLister layerLister,
            SchemaLoader schemaLoader)
        {
            m_controlHostService = controlHostService;
            m_commandService     = commandService;
            m_contextRegistry    = contextRegistry;
            m_documentRegistry   = documentRegistry;
            m_documentService    = documentService;
            m_prototypeLister    = prototypeLister;
            m_layerLister        = layerLister;

            m_schemaLoader = schemaLoader;

            string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\CircuitEditor\\data");

            EditorInfo.InitialDirectory = initialDirectory;
            m_theme            = new D2dDiagramTheme();
            m_circuitRenderer  = new D2dCircuitRenderer <Module, Connection, ICircuitPin>(m_theme, documentRegistry);
            m_subGraphRenderer = new D2dSubCircuitRenderer <Module, Connection, ICircuitPin>(m_theme);

            //// Note: Santa Monica uses following render settings:
            //m_circuitRenderer.TitleBackgroundFilled = true;
            //m_circuitRenderer.RoundedBorder = false;
            //m_circuitRenderer.PinDrawStyle = D2dCircuitRenderer<Module, Connection, ICircuitPin>.PinStyle.OnBorderFilled;

            //m_subGraphRenderer.TitleBackgroundFilled = true;
            //m_subGraphRenderer.RoundedBorder = false;
            //m_subGraphRenderer.PinDrawStyle = D2dCircuitRenderer<Module, Connection, ICircuitPin>.PinStyle.OnBorderFilled;

            // create d2dcontrol for displaying sub-circuit
            m_d2dHoverControl      = new D2dAdaptableControl();
            m_d2dHoverControl.Dock = DockStyle.Fill;
            var xformAdapter = new TransformAdapter();

            xformAdapter.EnforceConstraints = false;//to allow the canvas to be panned to view negative coordinates
            m_d2dHoverControl.Adapt(xformAdapter, new D2dGraphAdapter <Module, Connection, ICircuitPin>(m_circuitRenderer, xformAdapter));
            m_d2dHoverControl.DrawingD2d += new EventHandler(m_d2dHoverControl_DrawingD2d);
        }
Exemple #32
0
 public Editor(
     IControlHostService controlHostService,
     PropertyEditor propertyEditor,
     IContextRegistry contextRegistry,
     IDocumentRegistry documentRegistry,
     IDocumentService documentService,
     ICommandService commandService,
     SchemaLoader schemaLoader)
 {
     m_propertyEditor     = propertyEditor;
     m_controlHostService = controlHostService;
     m_contextRegistry    = contextRegistry;
     m_documentService    = documentService;
     m_documentRegistry   = documentRegistry;
     m_commandService     = commandService;
     //m_documentRegistry.ActiveDocumentChanged += documentRegistry_ActiveDocumentChanged;
     m_schemaLoader = schemaLoader;
 }
Exemple #33
0
        public Editor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            LayerLister layerLister)
        {
            m_controlHostService = controlHostService;
            m_commandService     = commandService;
            m_contextRegistry    = contextRegistry;
            m_documentRegistry   = documentRegistry;
            m_documentService    = documentService;
            m_layerLister        = layerLister;

            // string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\CircuitEditor\\data");
            // EditorInfo.InitialDirectory = initialDirectory;
        }
Exemple #34
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="defaultTheme">Diagram theme for rendering graph</param>
        /// <param name="documentRegistry">An optional document registry, used to clear the internal
        /// element type cache when a document is removed</param>
        public D2dSubCircuitRenderer(D2dDiagramTheme defaultTheme, IDocumentRegistry documentRegistry = null)
            : base(defaultTheme, documentRegistry)
        {
            m_fakeInputLinkPen   = D2dFactory.CreateSolidBrush(Color.DarkOrchid);
            m_fakeOutputLinkPen  = D2dFactory.CreateSolidBrush(Color.SlateGray);
            m_subGraphPinNodePen = D2dFactory.CreateSolidBrush(Color.SandyBrown);
            m_subGraphPinPen     = D2dFactory.CreateSolidBrush(Color.DeepSkyBlue);
            m_pinBrush           = D2dFactory.CreateSolidBrush(SystemColors.ControlDarkDark);
            m_visiblePinBrush    = D2dFactory.CreateSolidBrush(Color.Black);
            m_hiddrenPinBrush    = D2dFactory.CreateSolidBrush(Color.Gray);

            var props = new D2dStrokeStyleProperties();

            props.EndCap             = D2dCapStyle.Round;
            props.StartCap           = D2dCapStyle.Round;
            props.DashStyle          = D2dDashStyle.DashDot;
            m_VirtualLinkStrokeStyle = D2dFactory.CreateD2dStrokeStyle(props);
        }
Exemple #35
0
        public Editor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            LayerLister layerLister)
        {
            m_controlHostService = controlHostService;
            m_commandService = commandService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_documentService = documentService;
            m_layerLister = layerLister;

            // string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\CircuitEditor\\data");
            // EditorInfo.InitialDirectory = initialDirectory;
        }
Exemple #36
0
 public TextEditor(
     ICommandService commandService,
     IControlHostService controlHostService,
     IDocumentService documentService,
     IDocumentRegistry documentRegistry,
     IFileDialogService fileDialogService,
     DotaVPKService vpkService
     )
 {
     m_commandService     = commandService;
     m_controlHostService = controlHostService;
     m_documentService    = documentService;
     m_documentRegistry   = documentRegistry;
     m_fileDialogService  = fileDialogService;
     this.vpkService      = vpkService;
     // create a document client for each file type
     m_txtDocumentClient = new DocumentClient(this, ".txt");
     m_luaDocumentClient = new DocumentClient(this, ".lua");
 }
Exemple #37
0
        public Editor(
            IControlHostService controlHostService,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IDocumentService documentService,
            PrototypeLister prototypeLister,
            SchemaLoader schemaLoader)
        {
            m_controlHostService = controlHostService;
            m_commandService     = commandService;
            m_contextRegistry    = contextRegistry;
            m_documentRegistry   = documentRegistry;
            m_documentService    = documentService;

            m_schemaLoader = schemaLoader;

            m_theme       = new D2dDiagramTheme();
            m_fsmRenderer = new D2dDigraphRenderer <State, Transition>(m_theme);

            string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\FsmEditor\\data");

            EditorInfo.InitialDirectory = initialDirectory;
        }
Exemple #38
0
        public Editor(
            ICommandService commandService,
            IControlHostService controlHostService,
            IDocumentService documentService,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService
            )
        {
            m_commandService     = commandService;
            m_controlHostService = controlHostService;
            m_documentService    = documentService;
            m_documentRegistry   = documentRegistry;
            m_fileDialogService  = fileDialogService;

            // create a document client for each file type
            m_txtDocumentClient = new DocumentClient(this, ".txt");
            m_csDocumentClient  = new DocumentClient(this, ".cs");
            m_luaDocumentClient = new DocumentClient(this, ".lua");
            m_nutDocumentClient = new DocumentClient(this, ".nut");
            m_pyDocumentClient  = new DocumentClient(this, ".py");
            m_xmlDocumentClient = new DocumentClient(this, ".xml");
            m_daeDocumentClient = new DocumentClient(this, ".dae");
            m_cgDocumentClient  = new DocumentClient(this, ".cg");
        }
Exemple #39
0
        public SledDocumentService(
            MainForm mainForm,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService,
            IControlHostService controlHostService)
            : base(commandService, documentRegistry, fileDialogService)
        {
            m_mainForm = mainForm;
            m_commandService = commandService;
            m_contextRegistry = contextRegistry;
            m_documentRegistry = documentRegistry;
            m_fileDialogService = fileDialogService;
            m_controlHostService = controlHostService;

            m_mainForm.Shown += MainFormShown;
            m_mainForm.DragOver += MainFormDragOver;
            m_mainForm.DragDrop += MainFormDragDrop;

            // Relay this event
            m_documentRegistry.ActiveDocumentChanged += DocumentRegistryActiveDocumentChanged;

            // Everything but the copious new & open
            RegisterCommands =
                CommandRegister.FileClose |
                CommandRegister.FileSave |
                CommandRegister.FileSaveAll |
                CommandRegister.FileSaveAs;

            //
            // Register default document types
            //

            m_txtDocumentClient =
                new SledDocumentClient(
                    "Text",
                    ".txt",
                    Atf.Resources.DocumentImage,
                    true,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Text));

            m_xmlDocumentClient =
                new SledDocumentClient(
                    "Xml",
                    ".xml",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Xml));

            m_csDocumentClient =
                new SledDocumentClient(
                    "C#",
                    ".cs",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Csharp));

            m_pyDocumentClient =
                new SledDocumentClient(
                    "Python",
                    ".py",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Python));

            // One time setup
            SledDocument.ControlHostClient = this;

            // Do not use the system clipboard until further 
            // safety measures can be added. Ron Little, 5/26/2011
            StandardEditCommands.UseSystemClipboard = false;

            // Check if any command line args
            var bFirst = true;
            foreach (var arg in Environment.GetCommandLineArgs())
            {
                // First one is application .exe
                if (bFirst)
                {
                    bFirst = false;
                    continue;
                }

                // Skip non-files
                if (!File.Exists(arg))
                    continue;

                // Skip project files
                if (SledUtil.FileEndsWithExtension(arg, SledProjectService.ProjectExtensions))
                    continue;

                m_lstStartupFiles.Add(arg);
            }
        }
        public SledDocumentService(
            MainForm mainForm,
            ICommandService commandService,
            IContextRegistry contextRegistry,
            IDocumentRegistry documentRegistry,
            IFileDialogService fileDialogService,
            IControlHostService controlHostService)
            : base(commandService, documentRegistry, fileDialogService)
        {
            m_mainForm           = mainForm;
            m_commandService     = commandService;
            m_contextRegistry    = contextRegistry;
            m_documentRegistry   = documentRegistry;
            m_fileDialogService  = fileDialogService;
            m_controlHostService = controlHostService;

            m_mainForm.Shown    += MainFormShown;
            m_mainForm.DragOver += MainFormDragOver;
            m_mainForm.DragDrop += MainFormDragDrop;

            // Relay this event
            m_documentRegistry.ActiveDocumentChanged += DocumentRegistryActiveDocumentChanged;

            // Everything but the copious new & open
            RegisterCommands =
                CommandRegister.FileClose |
                CommandRegister.FileSave |
                CommandRegister.FileSaveAll |
                CommandRegister.FileSaveAs;

            //
            // Register default document types
            //

            m_txtDocumentClient =
                new SledDocumentClient(
                    "Text",
                    ".txt",
                    Atf.Resources.DocumentImage,
                    true,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Text));

            m_xmlDocumentClient =
                new SledDocumentClient(
                    "Xml",
                    ".xml",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Xml));

            m_csDocumentClient =
                new SledDocumentClient(
                    "C#",
                    ".cs",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Csharp));

            m_pyDocumentClient =
                new SledDocumentClient(
                    "Python",
                    ".py",
                    Atf.Resources.DocumentImage,
                    new SledDocumentLanguageSyntaxHighlighter(Languages.Python));

            // One time setup
            SledDocument.ControlHostClient = this;

            // Do not use the system clipboard until further
            // safety measures can be added. Ron Little, 5/26/2011
            StandardEditCommands.UseSystemClipboard = false;

            // Check if any command line args
            var bFirst = true;

            foreach (var arg in Environment.GetCommandLineArgs())
            {
                // First one is application .exe
                if (bFirst)
                {
                    bFirst = false;
                    continue;
                }

                // Skip non-files
                if (!File.Exists(arg))
                {
                    continue;
                }

                // Skip project files
                if (SledUtil.FileEndsWithExtension(arg, SledProjectService.ProjectExtensions))
                {
                    continue;
                }

                m_lstStartupFiles.Add(arg);
            }
        }
Exemple #41
0
 public ModelViewer(IDocumentRegistry documentRegistry)
 {
     string[] exts = { ".atgi", ".dae" };
     m_info             = new DocumentClientInfo("3D Model", exts, null, null, false);
     m_documentRegistry = documentRegistry;
 }