コード例 #1
0
        public VariableCondition(IEditorEnvironment editorEnvironment, string variableName = null, int variableValue = 0) : base(editorEnvironment)
        {
            _variableUndoRedoWrapper = CreateUndoRedoWrapper(nameof(Variable), variableName);
            _valueUndoRedoWrapper    = CreateUndoRedoWrapper(nameof(Value), variableValue);

            UpdateHeader();
        }
コード例 #2
0
ファイル: ResGroupEditor.cs プロジェクト: gleblebedev/toe
		public ResGroupEditor(IEditorEnvironment editorEnvironment, ICommandHistory history)
		{
			this.editorEnvironment = editorEnvironment;
			this.history = history;
			this.AutoSize = true;
			this.Padding = new Padding(10);

			this.SuspendLayout();

			this.split = new SplitContainer { Dock = DockStyle.Fill };
			this.split.Panel2Collapsed = true;
			this.Controls.Add(this.split);

			var sp = new StackPanel { Dock = DockStyle.Fill, AutoSize = true };
			this.split.Panel1.Controls.Add(sp);

			var collectionView = new CollectionView<IResourceFile>(a => editorEnvironment.EditorFor(a, history))
				{ AutoSize = true };
			collectionView.ItemsPanel.AutoSize = true;
			collectionView.ItemsPanel.AutoScroll = false;
			new PropertyBinding<ResGroup, IList<IResourceFile>>(collectionView, this.dataContext, m => m.ExternalResources, null);
			sp.Controls.Add(collectionView);

			var embCollectionView = new CollectionView<Managed>(a => this.CreateButtonForResource(a)) { AutoSize = true };
			embCollectionView.ItemsPanel.AutoSize = true;
			embCollectionView.ItemsPanel.AutoScroll = false;
			new PropertyBinding<ResGroup, IList<Managed>>(embCollectionView, this.dataContext, m => m.EmbeddedResources, null);
			sp.Controls.Add(embCollectionView);

			this.ResumeLayout();
			this.PerformLayout();
		}
コード例 #3
0
        protected NodeProperty(IEditorEnvironment editorEnvironment, PropertyInfo propertyInfo, string propertyName = null) : base(editorEnvironment)
        {
            _valueWrapper = CreateUndoRedoWrapper <object>(nameof(Value));

            Name         = propertyName ?? propertyInfo.Name;
            PropertyInfo = propertyInfo;
        }
コード例 #4
0
        public ChoiceGroup(IEditorEnvironment editorEnvironment, string text = null) : base(editorEnvironment)
        {
            _textUndoRedoWrapper = CreateUndoRedoWrapper(nameof(Text), text);

            Choices = AddGroup <ChoiceItem>(nameof(Choices));

            UpdateHeader();
        }
コード例 #5
0
ファイル: ShaderEditor.cs プロジェクト: gleblebedev/toe
		public ShaderEditor(IEditorEnvironment editorEnvironment, ICommandHistory history, IComponentContext context)
		{
			this.editorEnvironment = editorEnvironment;
			this.history = history;
			this.context = context;
			this.InitializeComponent();

			this.InitializeEditor();
		}
コード例 #6
0
        public ChoiceItem(IEditorEnvironment editorEnvironment, string text = null) : base(editorEnvironment)
        {
            _textUndoRedoWrapper = CreateUndoRedoWrapper(nameof(Text), text);

            Conditions = AddGroup <DialogCondition>(nameof(Conditions));
            Actions    = AddGroup <DialogAction>(nameof(Actions));

            UpdateHeader();
        }
コード例 #7
0
ファイル: ResourceFileEditor.cs プロジェクト: gleblebedev/toe
		public ResourceFileEditor(IEditorEnvironment editorEnvironment, IResourceManager resourceManager, TextResourceWriter textResourceWriter)
		{
			this.history = new CommandHistory();
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.textResourceWriter = textResourceWriter;
			this.history.PropertyChanged += this.NotifyHistoryChanged;
			this.InitializeComponent();
			this.InitializeEditor();
			this.Dock = DockStyle.Fill;
		}
コード例 #8
0
        public DataNode(IEditorEnvironment editorEnvironment, Type dataType, IReadOnlyList <NodeProperty> properties) : base(editorEnvironment)
        {
            DataType = dataType;

            Header = DataType.Name;

            _headerFormat = DataType.GetCustomAttribute <NodeHeaderFormatAttribute>()?.HeaderFormat;
            if (_headerFormat != null)
            {
                _headerValueProviders = new SortedList <int, NodeProperty>();
            }

            AddProperties(properties);
        }
コード例 #9
0
		public EditResourceReferenceView(
			IEditorEnvironment editorEnvironment,
			IResourceManager resourceManager,
			ICommandHistory history,
			IComponentContext context,
			bool fileReferencesAllowed)
			: this()
		{
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.history = history;
			this.context = context;
			this.fileReferencesAllowed = fileReferencesAllowed;
		}
コード例 #10
0
ファイル: GenericSceneEditor.cs プロジェクト: gleblebedev/toe
		public GenericSceneEditor(
			IEditorEnvironment editorEnvironment,
			IComponentContext context,
			ToeGraphicsContext graphicsContext,
			IEditorOptions<Base3DEditorOptions> options)
		{
			this.editorEnvironment = editorEnvironment;
			this.context = context;
			this.graphicsContext = graphicsContext;
			this.options = options;
			this.history = new CommandHistory();
			this.InitializeComponent();

			this.InitializeEditor();
		}
コード例 #11
0
ファイル: AnimEditor.cs プロジェクト: gleblebedev/toe
		public AnimEditor(
			IEditorEnvironment editorEnvironment,
			IResourceManager resourceManager,
			IComponentContext context,
			IEditorOptions<Base3DEditorOptions> options,
			Base3DEditorContent content)
			: base(context, options, content)
		{
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.InitializeComponent();

			this.InitializeEditor();
			base.RenderScene += this.RenderAnimScene;
		}
コード例 #12
0
ファイル: TextureEditor.cs プロジェクト: gleblebedev/toe
		public TextureEditor(
			IEditorEnvironment editorEnvironment,
			IResourceManager resourceManager,
			IComponentContext context,
			ToeGraphicsContext graphicsContext,
			IEditorOptions<Base3DEditorOptions> options,
			Base3DEditorContent content)
			: base(context, options, content)
		{
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.graphicsContext = graphicsContext;
			this.InitializeComponent();

			this.InitializeEditor();
			base.RenderScene += this.RenderTexScene;
		}
コード例 #13
0
ファイル: SkinEditor.cs プロジェクト: gleblebedev/toe
		public SkinEditor(
			IEditorEnvironment editorEnvironment,
			IResourceManager resourceManager,
			ICommandHistory history,
			ToeGraphicsContext graphicsContext,
			IComponentContext context)
		{
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.history = history;
			this.graphicsContext = graphicsContext;
			this.context = context;
			this.InitializeComponent();

			this.InitializeEditor();
			this.base3DEditor1.RenderScene += this.RenderScene;
		}
コード例 #14
0
ファイル: MaterialEditor.cs プロジェクト: gleblebedev/toe
		public MaterialEditor(
			IEditorEnvironment editorEnvironment,
			IResourceManager resourceManager,
			ICommandHistory history,
			ToeGraphicsContext graphicsContext,
			IComponentContext context)
		{
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.history = history;
			this.graphicsContext = graphicsContext;
			this.context = context;

			this.InitializeComponent();

			this.InitializeEditor();
		}
コード例 #15
0
		public ResourcePickerDialog(
			IResourceManager resourceManager, IEditorEnvironment editorEnvironment, uint type, bool fileReferencesAllowed)
		{
			this.resourceManager = resourceManager;
			this.editorEnvironment = editorEnvironment;
			this.type = type;
			this.fileReferencesAllowed = fileReferencesAllowed;
			this.InitializeComponent();

			foreach (var i in resourceManager.GetAllResourcesOfType(type))
			{
				this.list.Items.Add(i);
			}
			if (fileReferencesAllowed)
			{
				this.btnOpenFile.Visible = true;
			}
		}
コード例 #16
0
ファイル: ModelEditor.cs プロジェクト: gleblebedev/toe
		public ModelEditor(
			IEditorEnvironment editorEnvironment,
			IResourceManager resourceManager,
			IComponentContext context,
			ToeGraphicsContext graphicsContext,
			IEditorOptions<Base3DEditorOptions> options,
			ICommandHistory history)
		{
			this.editorEnvironment = editorEnvironment;
			this.resourceManager = resourceManager;
			this.context = context;
			this.graphicsContext = graphicsContext;
			this.options = options;
			this.history = history;
			this.dataContext.DataContextChanged += ResetModel;
			this.InitializeComponent();

			this.InitializeEditor();
		}
コード例 #17
0
        public TreeEditorViewModel(IEditorEnvironment editorEnvironment) : base(editorEnvironment)
        {
            RootNodes = new ReadOnlyObservableCollection <ITreeNode>(_rootNodes);

            // These commands are used for keyboard shortcuts
            DeleteNodeCommand    = new ActionCommand(DeleteSelectedNode, CanDeletedSelectedNode);
            CutNodeCommand       = new ActionCommand(CutNode, CanCutNode);
            CopyNodeCommand      = new ActionCommand(CopyNode, CanCopyNode);
            PasteNodeCommand     = new ActionCommand(PasteNode, CanPasteNode);
            DuplicateNodeCommand = new ActionCommand(DuplicateNode, CanDuplicateNode);
            UndoCommand          = new ActionCommand(Undo, CanUndo);
            RedoCommand          = new ActionCommand(Redo, CanRedo);

            ActiveContextMenuCommands = new ReadOnlyObservableCollection <ContextMenuCommand>(_activeContextMenuCommands);

            // Group catalog items by category
            var view             = CollectionViewSource.GetDefaultView(CatalogItems);
            var groupDescription = new PropertyGroupDescription(nameof(NodeCatalogItem.Category));

            view.GroupDescriptions.Add(groupDescription);
        }
コード例 #18
0
 public DialogRootNode(IEditorEnvironment editorEnvironment) : base(editorEnvironment, "Dialog")
 {
 }
コード例 #19
0
 public DataNodeFactory(IEditorEnvironment editorEnvironment)
 {
     _editorEnvironment = editorEnvironment;
 }
コード例 #20
0
 public TreeNode(IEditorEnvironment editorEnvironment, string header = null) : base(editorEnvironment)
 {
     Header = header ?? TypeUtility.GetTypeDisplayName(GetType());
 }
コード例 #21
0
 public EditorEnvironment(IEditorEnvironment editorEnvironment)
 {
     NodeFactory   = editorEnvironment.NodeFactory;
     UndoRedoStack = editorEnvironment.UndoRedoStack;
 }
コード例 #22
0
 public ReadableGroupContainerNode(IEditorEnvironment editorEnvironment) : base(editorEnvironment)
 {
 }
コード例 #23
0
 public DefaultNode(IEditorEnvironment editorEnvironment) : base(editorEnvironment)
 {
     Header = $"Node_{DateTime.Now}";
 }
コード例 #24
0
 public ReadableNodeContainer(IEditorEnvironment editorEnvironment, string header = null) : base(editorEnvironment, header)
 {
     Nodes = _emptyNodes;
 }
コード例 #25
0
 public EditorObject(IEditorEnvironment editorEnvironment)
 {
     EditorEnvironment = editorEnvironment;
 }
コード例 #26
0
        public ShowTextAction(IEditorEnvironment editorEnvironment, string text = null) : base(editorEnvironment)
        {
            _textUndoRedoWrapper = CreateUndoRedoWrapper(nameof(Text), text);

            UpdateHeader();
        }
コード例 #27
0
 public DefaultContainer(IEditorEnvironment editorEnvironment) : base(editorEnvironment)
 {
     Header = $"Container_{DateTime.Now}";
 }
コード例 #28
0
 // Marker class
 // Can be used for common dialog logic, for example serialization
 protected DialogNode(IEditorEnvironment editorEnvironment) : base(editorEnvironment)
 {
 }
コード例 #29
0
 public TextBoxProperty(IEditorEnvironment editorEnvironment, PropertyInfo propertyInfo, bool multiline = false, string propertyName = null)
     : base(editorEnvironment, propertyInfo, propertyName)
 {
     Multiline = multiline;
 }
コード例 #30
0
ファイル: DefaultEditor.cs プロジェクト: gleblebedev/toe
		public DefaultEditor(IEditorEnvironment editorEnvironment)
		{
			this.editorEnvironment = editorEnvironment;
			this.InitializeComponent();
			this.Controls.Add(new Label { Text = "File format is not supported" });
		}
コード例 #31
0
 // Marker class
 // Can be used for common condition logic, for example serialization
 protected DialogCondition(IEditorEnvironment editorEnvironment) : base(editorEnvironment)
 {
 }
コード例 #32
0
 public ObjectProperty(IEditorEnvironment editorEnvironment, PropertyInfo propertyInfo, string propertyName = null, bool singleObjectList = false) : base(editorEnvironment, propertyInfo, propertyName)
 {
     DataNode         = (DataNode)EditorEnvironment.NodeFactory.CreateNode(propertyInfo.PropertyType);
     SingleObjectList = singleObjectList;
 }
コード例 #33
0
 public TreeNodeContainer(IEditorEnvironment editorEnvironment, string header = null) : base(editorEnvironment, header)
 {
 }
コード例 #34
0
 public CustomNodeFactory(IEditorEnvironment editorEnvironment)
 {
     _editorEnvironment  = editorEnvironment;
     _defaultNodeFactory = new TreeNodeFactory(_editorEnvironment);
 }
コード例 #35
0
 public ComboBoxProperty(IEditorEnvironment editorEnvironment, IComboBoxValueProvider valueProvider, PropertyInfo propertyInfo, string propertyName = null)
     : base(editorEnvironment, propertyInfo, propertyName)
 {
     ValueProvider = valueProvider;
 }
コード例 #36
0
 public CheckBoxProperty(IEditorEnvironment editorEnvironment, PropertyInfo propertyInfo, string propertyName = null) : base(editorEnvironment, propertyInfo, propertyName)
 {
 }