// ReSharper disable once UnusedMember.Local // ReSharper disable once UnusedParameter.Local private void Provider_SelectionChanged(object sender, NodesChangedEventArgs args) { if (args.ChangedNodes.Count <= 0) { return; } var node = args.ChangedNodes[0]; if (node == null) { return; } Debug.WriteLine(node.UrnPath); Debug.WriteLine(node.Name); Debug.WriteLine(node.Context); if (_serverMenu == null && _urnPath == node.UrnPath) { _serverMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); //var separator = new ToolStripSeparatorMenuItem(); //_serverMenu.AddChild(string.Empty, separator); var item = new DatabaseMenuItem(_package); _serverMenu.AddChild(string.Empty, item); } if (_tableMenu == null && _tableUrnPath == node.UrnPath) { _tableMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); //var separator = new ToolStripSeparatorMenuItem(); //_serverMenu.AddChild(string.Empty, separator); var item = new TableMenuItem(_package); _tableMenu.AddChild(string.Empty, item); } }
private async Task <Guid> GetObjectIdAndCreateWhetherDoesNotExist(string objectName, string serviceDescription, HierarchyObject rootObject = null) { var obj = await _dbContext.HierarchyObjectContext.Entities .Include(o => o.HierarchyObjectAliases) .FirstOrDefaultAsync(o => o.Name.ToLower() == objectName.ToLower() || o.HierarchyObjectAliases.FirstOrDefault(a => a.Value.ToLower() == objectName.ToLower()) != null); if (obj == null) { if (rootObject == null) { rootObject = await _dbContext.HierarchyObjectContext.Entities.SingleAsync(o => o.Level == 0); } await _dbContext.ReloadEntityFromDb(rootObject); var entity = new HierarchyObject { Name = objectName, Description = serviceDescription, OwnerId = User.Identity.Name, ObjectTypeId = null }; return(await _dbContext.HierarchyObjectContext.CreateAsync(entity, rootObject.Id)); } else { return(obj.Id); } }
public void SetHierarchyName() { var newName = "newName"; HierarchyObject hierarchyObject = HierarchyManager.LoadedHierarchies["test"]; HierarchyManager.SetHierarchyName("test", newName); Assert.IsTrue(HierarchyManager.LoadedHierarchies.ContainsKey(newName)); Assert.AreEqual(HierarchyManager.GetHierarchyName(hierarchyObject), newName); }
private void Provider_SelectionChanged(object sender, NodesChangedEventArgs args) { INavigationContextProvider provider = (INavigationContextProvider)sender; INodeInformation node = (args.ChangedNodes.Count > 0 ? args.ChangedNodes[0] : null); if (_tableMenu == null && _tableRegex.IsMatch(node.Context)) { _tableMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); MenuItem item = new MenuItem(); _tableMenu.AddChild(string.Empty, item); } }
private void Provider_SelectionChanged(object sender, NodesChangedEventArgs args) { INavigationContextProvider provider = (INavigationContextProvider)sender; INodeInformation node = (args.ChangedNodes.Count > 0 ? args.ChangedNodes[0] : null); if (_tableMenu == null && _tableRegex.IsMatch(node.Context)) { _tableMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); MenuItem item = new MenuItem(); _tableMenu.AddChild(string.Empty, item); } }
public Script(ImaginaryObject scriptBase, HierarchyObject attachedTo = null) { if (!IsScript(((IGeneralImaginaryObject)scriptBase).TypeData.GetConstructionType())) { throw new ArgumentException("ScriptBase is not a Script!"); } ScriptInstance = scriptBase.CreateInstance(); ScriptType = ((IGeneralImaginaryObject)scriptBase).TypeData.GetConstructionType(); if (ScriptType.IsHierarchyScript()) { HierarchyScript.SetUp(ScriptInstance, attachedTo); } EventSystem.EventSystem.SubscribeEvents(ScriptType, ScriptInstance); }
public IEnumerator RegisterKey() { _isRegistering = true; var time = 0.0f; var curve = new AnimationCurve(); var curveBinding = new EditorCurveBinding { path = HierarchyObject.GetObjectPath(TargetTransform), type = typeof(Transform), propertyName = "m_LocalPosition.y" }; while (_isRegistering) { curve.AddKey(time, TargetTransform.localPosition.y); yield return(new WaitForSeconds(Interval)); time += Interval; } AnimationUtility.SetEditorCurve(Animclip, curveBinding, curve); }
private void Start() { _animclip = new AnimationClip(); //記録するTransformを追加する foreach (var t in HierarchyObject.GetTransforms(transform)) { //ターゲットのオブジェクトが衝突したときに記録を開始するコンポーネントを追加する var rt = t.gameObject.AddComponent <RecordTrigger>(); rt.Convertor = this; rt.TargetTag = _recordTargetTag; //Positionの登録 _recorders.Add(new PosXRecorder(_interval, _animclip, t)); _recorders.Add(new PosYRecorder(_interval, _animclip, t)); _recorders.Add(new PosZRecorder(_interval, _animclip, t)); //Rotationの登録 _recorders.Add(new RoteXRecorder(_interval, _animclip, t)); _recorders.Add(new RoteYRecorder(_interval, _animclip, t)); _recorders.Add(new RoteZRecorder(_interval, _animclip, t)); _recorders.Add(new RoteWRecorder(_interval, _animclip, t)); } }
private void Provider_SelectionChanged(object sender, NodesChangedEventArgs args) { Connect.ViewsSelected = false; INodeInformation node = Connect.ObjectExplorerSelectedNode; if (node != null) { System.Diagnostics.Debug.WriteLine(node.UrnPath); System.Diagnostics.Debug.WriteLine(node.Name); System.Diagnostics.Debug.WriteLine(node.Context); // Mobile Device connections not supported if (node.Connection.ServerName.StartsWith("Mobile Device\\", StringComparison.Ordinal)) { // short circuit node = null; } } if (node != null && _serverMenu == null && urnPath == node.UrnPath) { _serverMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _serverMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); DatabaseMenuItem item = new DatabaseMenuItem(); _serverMenu.AddChild(string.Empty, item); ServerMenuItem serveritem = new ServerMenuItem(); _serverMenu.AddChild(string.Empty, serveritem); } if (node != null && _tableMenu == null && tableUrnPath == node.UrnPath) { _tableMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); EditTableMenuItem itemE = new EditTableMenuItem(); _tableMenu.AddChild(string.Empty, itemE); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); ScriptTableMenuItem item = new ScriptTableMenuItem(); _tableMenu.AddChild(string.Empty, item); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); ImportTableMenuItem item2 = new ImportTableMenuItem(); _tableMenu.AddChild(string.Empty, item2); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); RenameTableMenuItem item3 = new RenameTableMenuItem(); _tableMenu.AddChild(string.Empty, item3); } if (node != null && _indexMenu == null && indexUrnPath == node.UrnPath) { _indexMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _indexMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); ScriptIndexMenuItem itemI = new ScriptIndexMenuItem(); _indexMenu.AddChild(string.Empty, itemI); } if (node != null && _viewMenu == null && viewUrnPath == node.UrnPath) { _viewMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _viewMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); EditTableMenuItem itemV = new EditTableMenuItem(); _viewMenu.AddChild(string.Empty, itemV); } // Set this each time if (node != null && viewUrnPath == node.UrnPath) { Connect.ViewsSelected = true; } }
private void Provider_SelectionChanged(object sender, NodesChangedEventArgs args) { Connect.ViewsSelected = false; INodeInformation node = Connect.ObjectExplorerSelectedNode; if (node != null) { System.Diagnostics.Debug.WriteLine(node.UrnPath); System.Diagnostics.Debug.WriteLine(node.Name); System.Diagnostics.Debug.WriteLine(node.Context); // Mobile Device connections not supported if (node.Connection.ServerName.StartsWith("Mobile Device\\", StringComparison.Ordinal)) { // short circuit node = null; } } if (node != null && _serverMenu == null && urnPath == node.UrnPath) { _serverMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _serverMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); DatabaseMenuItem item = new DatabaseMenuItem(); _serverMenu.AddChild(string.Empty, item); ServerMenuItem serveritem = new ServerMenuItem(); _serverMenu.AddChild(string.Empty, serveritem); } if (node != null && _tableMenu == null && tableUrnPath == node.UrnPath) { _tableMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); EditTableMenuItem itemE = new EditTableMenuItem(); _tableMenu.AddChild(string.Empty, itemE); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); ScriptTableMenuItem item = new ScriptTableMenuItem(); _tableMenu.AddChild(string.Empty, item); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); ImportTableMenuItem item2 = new ImportTableMenuItem(); _tableMenu.AddChild(string.Empty, item2); _tableMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); RenameTableMenuItem item3 = new RenameTableMenuItem(); _tableMenu.AddChild(string.Empty, item3); } if (node != null && _indexMenu == null && indexUrnPath == node.UrnPath) { _indexMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _indexMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); ScriptIndexMenuItem itemI = new ScriptIndexMenuItem(); _indexMenu.AddChild(string.Empty, itemI); } if (node != null && _viewMenu == null && viewUrnPath == node.UrnPath) { _viewMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); _viewMenu.AddChild(string.Empty, new ToolStripSeparatorMenuItem()); EditTableMenuItem itemV = new EditTableMenuItem(); _viewMenu.AddChild(string.Empty, itemV); } // Set this each time if (node != null && viewUrnPath == node.UrnPath) { Connect.ViewsSelected = true; } }
protected override void OnReparent(HierarchyObject newParent) { Transform.Parent = // Set the Transform's parent. (Parent as WorldObject)? // Get the parent as WorldObject or null. .Transform; // Get the parent's Transform. }
public static void SetUp(object scriptInstance, HierarchyObject attachedTo) { scriptInstance.GetType().GetMethod("SetUp").Invoke(scriptInstance, new[] { attachedTo }); }
private void AddMenuItemToHierarchyObject(INodeInformation node, object item) { dbMenu = (HierarchyObject)node.GetService(typeof(IMenuHandler)); dbMenu.AddChild(string.Empty, item); }
/// <summary> /// OnReparent is called when the HierarchyObject's parent updates. /// </summary> /// <param name="newParent">The new parent.</param> protected internal virtual void OnReparent(HierarchyObject newParent) { }