public override void SetUp() { base.SetUp(); DefinitionBuilder builder = new DefinitionBuilder(new DefinitionMap(), typeFinder, new TransformerBase <IUniquelyNamed> [0], TestSupport.SetupEngineSection()); IItemNotifier notifier = mocks.DynamicMock <IItemNotifier>(); mocks.Replay(notifier); var changer = new N2.Edit.Workflow.StateChanger(); definitions = new DefinitionManager(new[] { new DefinitionProvider(builder) }, new ContentActivator(changer, notifier, new EmptyProxyFactory()), changer, new DefinitionMap()); versioner = mocks.StrictMock <IVersionManager>(); var urls = new FakeEditUrlManager(); editManager = new EditManager(definitions, persister, versioner, null, null, null, urls, changer, new EditableHierarchyBuilder(new SecurityManager(new ThreadContext(), new EditSection()), TestSupport.SetupEngineSection()), new EditSection()); editManager.EnableVersioning = true; var engine = new FakeEngine(); engine.Container.AddComponentInstance("editManager", typeof(IEditManager), editManager); engine.Container.AddComponentInstance("editSection", typeof(EditSection), new EditSection()); Context.Replace(engine); }
public static void Setup(out N2.Edit.IEditManager editor, out IVersionManager versions, IDefinitionManager definitions, IPersister persister, IItemFinder finder) { var changer = new N2.Edit.Workflow.StateChanger(); versions = new VersionManager(persister.Repository, finder, changer, new N2.Configuration.EditSection()); editor = new EditManager(definitions, persister, versions, new SecurityManager(new ThreadContext(), new EditSection()), null, null, null, changer, new EditableHierarchyBuilder(new SecurityManager(new ThreadContext(), new EditSection()), new EngineSection()), null); }
private void EditManagerExecute() { try { EditManager editManager = new EditManager(Manager); editManager.ShowDialog(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
// Use this for initialization void Start() { //EditManagerキャッシュ mEditManager = GameObject.Find("EditManager").GetComponent<EditManager>(); //自分のタイプを設定する if (name == "NormalNote") mMyType = EditManager.eSelectNoteType.eNote_Normal; else if (name == "HoldNote") mMyType = EditManager.eSelectNoteType.eNote_Hold; else if (name == "SlideNote") mMyType = EditManager.eSelectNoteType.eNote_Slide; }
public void EditorTest() { var PB1 = new Bitmap(@"C:\Users\alex\Desktop\WPF\WpfPlotDigitizer\WpfPlotDigitizerTests\data.png").ToPixelBitmap(); var PB2 = new Bitmap(@"C:\Users\alex\Desktop\WPF\WpfPlotDigitizer\WpfPlotDigitizer\images\ocr.png").ToPixelBitmap(); var editor = new EditManager(); editor.Init(PB1); editor.Edit(PB2); Assert.IsTrue(PB2.Equals(editor.Object as PixelBitmap)); editor.Undo(); Assert.IsTrue(PB1.Equals(editor.Object as PixelBitmap)); editor.Redo(); Assert.IsTrue(PB2.Equals(editor.Object as PixelBitmap)); }
public EditManagerViewModel(EditManager editManagerView, tblManager managerLogedIn) { view = editManagerView; userService = new UserService(); managerService = new ManagerService(); User = new tblUser(); Manager = managerLogedIn; ManagerToEdit = managerService.GetvwManager(Manager.ManagerID); oldMail = ManagerToEdit.Email; oldJMBG = ManagerToEdit.JMBG; oldUserName = ManagerToEdit.Username; }
public override void SetUp() { base.SetUp(); DefinitionBuilder builder = new DefinitionBuilder(new DefinitionMap(), typeFinder, new TransformerBase<IUniquelyNamed>[0], TestSupport.SetupEngineSection()); IItemNotifier notifier = mocks.DynamicMock<IItemNotifier>(); mocks.Replay(notifier); var changer = new N2.Edit.Workflow.StateChanger(); definitions = new DefinitionManager(new[] { new DefinitionProvider(builder) }, new ContentActivator(changer, notifier, new EmptyProxyFactory()), changer, new DefinitionMap()); versioner = mocks.StrictMock<IVersionManager>(); var urls = new FakeEditUrlManager(); editManager = new EditManager(definitions, persister, versioner, null, null, urls, changer, new EditableHierarchyBuilder(new SecurityManager(new ThreadContext(), new EditSection()), TestSupport.SetupEngineSection()), new EditSection()); editManager.EnableVersioning = true; var engine = new FakeEngine(); engine.Container.AddComponentInstance("editManager", typeof(IEditManager), editManager); engine.Container.AddComponentInstance("editSection", typeof(EditSection), new EditSection()); Context.Replace(engine); }
public override void SetUp() { base.SetUp(); var urls = new FakeEditUrlManager(); DefinitionBuilder builder = new DefinitionBuilder(typeFinder, new EngineSection(), urls); IItemNotifier notifier = mocks.DynamicMock<IItemNotifier>(); mocks.Replay(notifier); var changer = new N2.Edit.Workflow.StateChanger(); DefinitionManager definitions = new DefinitionManager(builder, changer, notifier, new EmptyProxyFactory()); versioner = mocks.StrictMock<IVersionManager>(); editManager = new EditManager(definitions, persister, versioner, null, null, null, urls, changer, new EditSection()); editManager.EnableVersioning = true; var engine = new FakeEngine(); engine.AddComponentInstance("editManager", typeof(IEditManager), editManager); engine.AddComponentInstance("editSection", typeof(EditSection), new EditSection()); Context.Replace(engine); }
void Awake() { Debug.unityLogger.logEnabled = Config.LOGGING; GM.instance = this; this.OnUpdateGameState = null; this.filePicker = this.canvasGameObject.transform.Find("FilePicker").GetComponent <GUIFilePicker>(); this.playPanel = this.canvasGameObject.transform.Find("PlayPanel").gameObject; this.editorPanel = this.canvasGameObject.transform.Find("EditorPanel").gameObject; this.pausePanel = this.canvasGameObject.transform.Find("PausePanel").gameObject; GM.inputManager = this.coreGameObject.GetComponent <InputManager>(); GM.boardManager = this.coreGameObject.GetComponent <BoardManager>(); GM.editManager = this.coreGameObject.GetComponent <EditManager>(); GM.playManager = this.coreGameObject.GetComponent <PlayManager>(); GM.debugDrawer = this.coreGameObject.GetComponent <DebugDrawer>(); GM.cursor = this.coreGameObject.GetComponentInChildren <Cursor>(); this.OnUpdateGameState += GM.boardManager.OnUpdateGameState; this.OnUpdateGameState += GM.inputManager.OnUpdateGameState; this.OnUpdateGameState += GM.editManager.OnUpdateGameState; this.OnUpdateGameState += GM.playManager.OnUpdateGameState; this.OnUpdateGameState += GM.cursor.OnUpdateGameState; }
private void Start() { if (furnitureFolder == null) { furnitureFolder = GameObject.Find("Furnitures").transform; if (furnitureFolder == null) { Debug.Log("Select a default furnitures folder or rename it to Furnitures"); } } if (sensorsFolder == null) { sensorsFolder = GameObject.Find("Sensors").transform; if (sensorsFolder == null) { Debug.Log("Select a default sensors folder or rename it to Sensors"); } } if (wallsFolder == null) { sensorsFolder = GameObject.Find("Walls").transform; if (sensorsFolder == null) { Debug.Log("Select a default walls folder or rename it to Walls"); } } editManager = this.GetComponentInParent <EditManager>(); furnitureFolder = this.transform.GetComponentInParent <BMenuManager>().furnituresFolder.transform; wallsFolder = this.transform.GetComponentInParent <BMenuManager>().wallsFolder.transform; sensorsFolder = this.transform.GetComponentInParent <BMenuManager>().sensorsFolder.transform; AddFurniture("Terrain"); }
void Awake() { Instance = this; }
public void SetManager(EditManager editManager) { this.editManager = editManager; }
public bool Manipulate(MouseState mouseState, Point screenPosition, EditManager editManager, MapControl mapControl) { switch (mouseState) { case MouseState.Up: if (_inDoubleClick) // Workaround to prevent that after a double click the 'up' event will immediately add a new geometry. { _inDoubleClick = false; return(false); } if (editManager.EditMode == EditMode.Modify) { editManager.StopDragging(); } if (editManager.EditMode == EditMode.Rotate) { editManager.StopRotating(); } if (editManager.EditMode == EditMode.Scale) { editManager.StopScaling(); } if (IsClick(screenPosition, _mouseDownPosition)) { if (editManager.EditMode == EditMode.Modify) { if (IsShiftDown()) { return(editManager.TryDeleteVertrex( mapControl.GetMapInfo(screenPosition, editManager.VertexRadius), editManager.VertexRadius)); } return(editManager.TryInsertVertex( mapControl.GetMapInfo(screenPosition, editManager.VertexRadius))); } return(editManager.AddVertex(mapControl.Viewport.ScreenToWorld(screenPosition))); } return(false); case MouseState.Down: { _mouseDownPosition = screenPosition; // Take into account VertexRadius in feature select, because the objective // is vertext select. var mapInfo = mapControl.GetMapInfo(screenPosition, editManager.VertexRadius); if (editManager.EditMode == EditMode.Modify && mapInfo.Feature != null) { return(editManager.StartDragging(mapInfo, editManager.VertexRadius)); } if (editManager.EditMode == EditMode.Rotate && mapInfo.Feature != null) { return(editManager.StartRotating(mapInfo)); } if (editManager.EditMode == EditMode.Scale && mapInfo.Feature != null) { return(editManager.StartScaling(mapInfo)); } return(false); } case MouseState.Dragging: { var args = mapControl.GetMapInfo(screenPosition); if (editManager.EditMode == EditMode.Modify) { return(editManager.Dragging(args.WorldPosition)); } if (editManager.EditMode == EditMode.Rotate) { return(editManager.Rotating(args.WorldPosition)); } if (editManager.EditMode == EditMode.Scale) { return(editManager.Scaling(args.WorldPosition)); } return(false); } case MouseState.Moving: editManager.HoveringVertex(mapControl.GetMapInfo(screenPosition)); return(false); case MouseState.DoubleClick: _inDoubleClick = true; if (editManager.EditMode != EditMode.Modify) { return(editManager.EndEdit()); } return(false); default: throw new Exception(); } }