コード例 #1
0
ファイル: HistoryCommand.cs プロジェクト: SneWs/Commander
 private static string Search(string criteria, ICommandHistory history)
 {
     StringBuilder sb = new StringBuilder();
     history.GetMatching(criteria).ForEach(record => sb.AppendLine(record));
     sb.AppendLine("");
     return sb.ToString();
 }
コード例 #2
0
 public MoveCommand(IGame game, Direction direction, IManipulator manipulator, ICommandHistory history)
 {
     _game        = game;
     _direction   = direction;
     _manipulator = manipulator;
     _history     = history;
 }
コード例 #3
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();
		}
コード例 #4
0
 public MenuEntry(ICommandHistory commandHistory, string name, Keys shortcutKeys)
 {
     CommandHistory = commandHistory;
     Name           = name;
     ShortcutKeys   = shortcutKeys;
     Enabled        = true;
 }
コード例 #5
0
ファイル: CommandInputForm.cs プロジェクト: schmich/ephemeral
        public CommandInputForm(ICommandProvider commandProvider, ICommandHistory history)
        {
            InitializeComponent();
            Width = Screen.PrimaryScreen.Bounds.Width;
            Font = new Font(Gentium.FontFamily, 30, FontStyle.Regular);

            DoubleBuffered = true;
            SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);

            _commandProvider = commandProvider;
            _commandHistory = history;
            _historicCommand = _commandHistory.GetEnumerator();

            _backBrush = new SolidBrush(BackColor);
            _foreBrush = new SolidBrush(Color.FromArgb(255, 10, 40));

            _dropDownForm = new DropDownForm();
            _dropDownForm.Font = Font;
            _dropDownForm.Top = Bottom;

            _mouseHook = new MouseHook();
            _mouseHook.MouseMove += new MouseMoveEventHandler(OnMouseMove);
            _mouseHook.MouseClick += new MouseClickEventHandler(Cancel);

            _inputTextBox.TextChanged += delegate { OnInputChanged(); };
            _inputTextBox.SelectionChanged += delegate { OnInputChanged(); };

            MakeForeground();
        }
コード例 #6
0
ファイル: UndoMenuEntry.cs プロジェクト: you8/vvvv-sdk
        public UndoMenuEntry(ICommandHistory commandHistory)
            : base(commandHistory, string.Format("Undo {0}", commandHistory.PreviousCommand), Keys.Control | Keys.Z)
        {
            var prevCommand = commandHistory.PreviousCommand;

            Enabled = prevCommand != null && prevCommand.HasUndo;
        }
コード例 #7
0
ファイル: BaseClasses.cs プロジェクト: yousafgill/Timeliner
 public TLViewBase(TLModelBase model, TLViewBase parent)
 {
     FGroup.Transforms = new SvgTransformCollection();
     Parent            = parent;
     Model             = model;
     History           = Model.Mapper.Map <ICommandHistory>();
     FGroup.ID         = GetGroupID();
 }
コード例 #8
0
 public DropObjectCommand(
     ICommandHistory commandHistory,
     IVariables variables,
     IObjectDroppedAction objectDropped)
 {
     _commandHistory = commandHistory;
     _variables      = variables;
     _objectDropped  = objectDropped;
 }
コード例 #9
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();
		}
コード例 #10
0
ファイル: HistoryCommand.cs プロジェクト: SneWs/Commander
        private static string List(ICommandHistory history)
        {
            StringBuilder sb = new StringBuilder();
            List<string> records = history.Records;

            records.ForEach(record => sb.AppendLine(record));
            sb.AppendLine("");
            sb.AppendLine(String.Format("{0} entries in history", records.Count));

            return sb.ToString();
        }
コード例 #11
0
        public void SetUp()
        {
            _mocks = new MockRepository();

            _view = new AutoCompleteView();
            _attachedTo = new Control();
            _commandHistory = _mocks.DynamicMock<ICommandHistory>();
            _presenter = new AutoCompletePresenter(_view, _attachedTo, _commandHistory);

            _presenter.Init();
        }
コード例 #12
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;
		}
コード例 #13
0
        public Controller(IGameCreator gameCreator, IManipulator manipulator, ICommandHistory history,
                          ICommandManager commandManager, IGameMessageHolder gameMessageHolder, IConsoleManager console)
        {
            gameCreator.NotifyOnGameCreated     += OnNewGameCreated;
            manipulator.NotifyOnPlayfieldChange += OnPlayfieldChanged;

            _history           = history;
            _commandManager    = commandManager;
            _gameMessageHolder = gameMessageHolder;
            _console           = console;
        }
コード例 #14
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;
		}
コード例 #15
0
ファイル: EditorEnvironment.cs プロジェクト: gleblebedev/toe
		public IView EditorFor(object itemToEdit, ICommandHistory history)
		{
			var typedParameters = new Parameter[] { TypedParameter.From(history) };
			IView view = this.context.ResolveOptionalKeyed<IView>(itemToEdit.GetType(), typedParameters);
			if (view != null)
			{
				return view;
			}
			view = this.context.ResolveOptionalKeyed<IView>(itemToEdit.GetType().BaseType, typedParameters);
			if (view != null)
			{
				return view;
			}
			return new StringView();
		}
コード例 #16
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();
		}
コード例 #17
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;
		}
コード例 #18
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();
		}
コード例 #19
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();
		}
コード例 #20
0
ファイル: RemoveMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public RemoveMenuEntry(ICommandHistory commandHistory, TOwner owner, TItem item)
     : this(commandHistory, owner, item, "Remove")
 {
 }
コード例 #21
0
ファイル: SetPropertyCommand.cs プロジェクト: you8/vvvv-sdk
 public static void SetByCommand(this IEditableProperty property, object newValue, ICommandHistory history)
 {
     if (property.AcceptValueObject(newValue))
     {
         var command = Command.Set(property, newValue);
         history.Insert(command);
     }
 }
コード例 #22
0
ファイル: SetPropertyMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public SetPropertyMenuEntry(ICommandHistory commandHistory, IEditableProperty property)
     : base(commandHistory, "Change Value")
 {
     Property = property;
 }
コード例 #23
0
 public LoadMenuEntry(ICommandHistory history, IPersistent persistent, ILogger logger)
     : base(history, "Open")
 {
     FPersistent = persistent;
     FLogger     = logger;
 }
コード例 #24
0
 public ShellState(ICommandDispatcher commandDispatcher, ISuggestionManager suggestionManager = null, IInputManager inputManager = null, ICommandHistory commandHistory = null, IConsoleManager consoleManager = null)
 {
     InputManager      = inputManager ?? new InputManager();
     CommandHistory    = commandHistory ?? new CommandHistory();
     ConsoleManager    = consoleManager ?? new ConsoleManager();
     CommandDispatcher = commandDispatcher;
     SuggestionManager = suggestionManager ?? new SuggestionManager();
 }
コード例 #25
0
 public ReferencesViewProvider(IProject project, IEditableIDList <IReference> references)
 {
     FProject        = project;
     FReferences     = references;
     FCommandHistory = FReferences.Mapper.Map <ICommandHistory>();
 }
コード例 #26
0
ファイル: RenameMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public RenameMenuEntry(ICommandHistory commandHistory, IRenameable renameable)
     : this(commandHistory, renameable, null)
 {
 }
コード例 #27
0
 public ReferenceProvider(ICommandHistory history)
 {
     FHistory = history;
 }
コード例 #28
0
ファイル: RemoveMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public RemoveMenuEntry(ICommandHistory commandHistory, TOwner owner, TItem item, string name)
     : base(commandHistory, name, Keys.Delete)
 {
     FOwner = owner;
     FItem  = item;
 }
コード例 #29
0
ファイル: AddMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public AddMenuEntry(ICommandHistory commandHistory)
     : base(commandHistory, "Add")
 {
 }
コード例 #30
0
ファイル: TimelinerView.cs プロジェクト: yousafgill/Timeliner
        public TimelineView(TLDocument tl, ICommandHistory history, Timer timer)
        {
            History = history;
            History.CommandInserted += History_Changed;
            History.Undone          += History_Changed;
            History.Redone          += History_Changed;

            Document = tl;
            Timer    = timer;

            //replace id manager before any svg element was added
            var caller  = Document.Mapper.Map <ISvgEventCaller>();
            var manager = new SvgIdManager(SvgRoot, caller, Document.Mapper.Map <RemoteContext>());

            SvgRoot.ID = "svg";
            SvgRoot.OverwriteIdManager(manager);

            Background.Width   = new SvgUnit(SvgUnitType.Percentage, 100);
            Background.Height  = 500;
            Background.ID      = Document.GetID() + "_Background";
            Background.Opacity = 0;

            Background.MouseDown += Default_MouseDown;
            Background.MouseMove += Default_MouseMove;
            Background.MouseUp   += Default_MouseUp;

            Selection.ID = "Selection";
            Selection.CustomAttributes["pointer-events"] = "none";
            Selection.CustomAttributes["class"]          = "selection";

            Ruler = new RulerView(Document.Ruler, this);

            MouseTimeLine.ID     = "MouseTime";
            MouseTimeLine.StartX = 0;
            MouseTimeLine.StartY = 0;
            MouseTimeLine.EndX   = 0;

            TimeBar.ID         = "Timebar";
            TimeBar.Y          = -Ruler.Height;
            TimeBar.X          = -1;
            TimeBar.Width      = 2;
            TimeBar.MouseDown += Default_MouseDown;
            TimeBar.MouseMove += Default_MouseMove;
            TimeBar.MouseUp   += Default_MouseUp;

            MainMenu    = new SvgMenuWidget(120);
            MainMenu.ID = "MainMenu";

            var addValueTrack = new SvgButtonWidget(0, 20, "Add Value Track");

            addValueTrack.ValueChanged += AddValueTrack;

            var addStringTrack = new SvgButtonWidget(0, 20, "Add String Track");

            addStringTrack.ValueChanged += AddStringTrack;

            MainMenu.AddItem(addValueTrack, 0);
            MainMenu.AddItem(addStringTrack, 1);

            FRulerGroup.ID = "Ruler";
            FRulerGroup.CustomAttributes["class"] = "fixed";
            FRulerGroup.Transforms = new SvgTransformCollection();
            FRulerGroup.Transforms.Add(new SvgTranslate(0, 0));

            FTrackGroup.ID            = "Tracks";
            FTrackGroup.Transforms    = new SvgTransformCollection();
            FOverlaysGroup.ID         = "Overlays";
            FOverlaysGroup.Transforms = new SvgTransformCollection();

            //initialize svg tree
            BuildSVGRoot();

            Syncer = Tracks.SyncWith(Document.Tracks,
                                     tm =>
            {
                TrackView tv;
                if (tm is TLValueTrack)
                {
                    tv = new ValueTrackView(tm as TLValueTrack, this, Ruler);
                }
                else if (tm is TLStringTrack)
                {
                    tv = new StringTrackView(tm as TLStringTrack, this, Ruler);
                }
                else
                {
                    tv = new AudioTrackView(tm as TLAudioTrack, this, Ruler);
                }

                if (ActiveTrack == null)
                {
                    ActiveTrack = tv;
                }
                tv.AddToSceneGraphAt(FTrackGroup);

                //update Order on all tracks below the one added
                var order = tv.Model.Order.Value;
                foreach (var track in Tracks.Where(x => x.Model.Order.Value >= order))
                {
                    track.Model.Order.Value += 1;
                }

                return(tv);
            },
                                     tv =>
            {
                var order = tv.Model.Order.Value;
                tv.Dispose();

                //update Order on all tracks below the one removed
                foreach (var track in Tracks.Where(x => x.Model.Order.Value > order))
                {
                    track.Model.Order.Value -= 1;
                }
            });
        }
コード例 #31
0
 public MenuEntry(ICommandHistory commandHistory, string name)
     : this(commandHistory, name, Keys.None)
 {
 }
コード例 #32
0
 public UndoCommand(ICommandHistory history)
 {
     _history = history;
 }
コード例 #33
0
ファイル: RedoMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public RedoMenuEntry(ICommandHistory commandHistory)
     : base(commandHistory, string.Format("Redo {0}", commandHistory.NextCommand), Keys.Control | Keys.Y)
 {
     Enabled = commandHistory.NextCommand != null;
 }
コード例 #34
0
 public UnloadMenuEntry(ICommandHistory history, /*IPersistent persistent,*/ ILogger logger)
     : base(history, "Close")
 {
     //FPersistent = persistent;
     FLogger = logger;
 }
コード例 #35
0
ファイル: RenameMenuEntry.cs プロジェクト: you8/vvvv-sdk
 public RenameMenuEntry(ICommandHistory commandHistory, IRenameable renameable, ILabelEditor labelEditor)
     : base(commandHistory, "Rename", Keys.F2)
 {
     Renameable  = renameable;
     LabelEditor = labelEditor;
 }
コード例 #36
0
 public BoardWorker(IManipulator manipulator, ICommandHistory history)
 {
     _manipulator = manipulator;
     _history     = history;
 }
コード例 #37
0
 public CommandManager(IGameCreator creator, IManipulator manipulator, ICommandHistory history)
 {
     _gameCreator = creator;
     _manipulator = manipulator;
     _history     = history;
 }
コード例 #38
0
 public AddReferenceMenuEntry(ICommandHistory history, IProject project, IEditableIDList <IReference> references)
     : base(history, "Reference", Keys.Control | Keys.N)
 {
     FProject    = project;
     FReferences = references;
 }