private static void ExecuteSetOpposite(BoneViewModel view) { IOrderedEnumerable <RigResource.RigResource.Bone> choices = view.Manager.Bones.OrderBy(x => x.Name); var dialog = new BoneSelectDialog(choices, "Select a New Opposite..."); bool result = dialog.ShowDialog() ?? false; if (result) { view.Opposite = view.Manager.Bones.IndexOf(dialog.SelectedBone); } }
private static void ExecuteSetParent(BoneViewModel target) { IOrderedEnumerable <RigResource.RigResource.Bone> descendants = target.Manager.GetDescendants(target.Bone).OrderBy(x => x.Name); List <RigResource.RigResource.Bone> choices = target.Manager.Bones.Where(x => x != target.Bone && !descendants.Contains(x)).ToList(); choices.Sort((x, y) => x.Name.CompareTo(y.Name)); var dialog = new BoneSelectDialog(choices, "Select a New Parent..."); bool result = dialog.ShowDialog() ?? false; if (result) { target.Manager.SetParent(target.Bone, dialog.SelectedBone); } }
private static void ExecuteSetOpposite(BoneViewModel view) { IOrderedEnumerable<RigResource.RigResource.Bone> choices = view.Manager.Bones.OrderBy(x => x.Name); var dialog = new BoneSelectDialog(choices, "Select a New Opposite..."); bool result = dialog.ShowDialog() ?? false; if (result) { view.Opposite = view.Manager.Bones.IndexOf(dialog.SelectedBone); } }
private static void ExecuteSetParent(BoneViewModel target) { IOrderedEnumerable<RigResource.RigResource.Bone> descendants = target.Manager.GetDescendants(target.Bone).OrderBy(x => x.Name); List<RigResource.RigResource.Bone> choices = target.Manager.Bones.Where(x => x != target.Bone && !descendants.Contains(x)).ToList(); choices.Sort((x, y) => x.Name.CompareTo(y.Name)); var dialog = new BoneSelectDialog(choices, "Select a New Parent..."); bool result = dialog.ShowDialog() ?? false; if (result) { target.Manager.SetParent(target.Bone, dialog.SelectedBone); } }