private void btnChangeVis_Click(object sender, RoutedEventArgs e)
 {
     var win = new ChangeObjVisibilityWindow();
     if (win.ShowDialog() != true) return;
     var action = new ChangeObjectVisibility(_defaultEventType, win.ChosenVis, _sourceObjectId, win.SelObject.ObjectId);
     Act = action;
     DialogResult = true;
     Close();
 }
        private static void AddToElement(IInteractive element, EventType eventType)
        {
            var win = new ChangeObjVisibilityWindow();
            if (win.ShowDialog() != true) return;

            var action = new ChangeObjectVisibility(eventType, win.ChosenVis, element.ObjectId, win.SelObject.ObjectId);
            element.AddAction(action);

            var mainWin = DesignerMainWindow.GetInstance();
            var currentSlideNr = mainWin.GetCurrentSlideNr();
            mainWin.canMainCanvas.SaveAllSlideData(Practice.GetInstance().GetSlideByPosition(currentSlideNr));
        }
Пример #3
0
        private ComAction LoadChangeVisibility(IEnumerable<XAttribute> attributes)
        {
            ChangeObjectVisibility action = new ChangeObjectVisibility();
            action.Type = ActionType.changeVisibility;

            foreach (var attr in attributes)
            {
                switch (attr.Name.ToString())
                {
                    case "targetObjectID":
                        action.TargetObjectId = Int32.Parse(attr.Value);
                        break;
                    case "newVisibility":
                        action.Visible = Boolean.Parse(attr.Value);
                        break;
                    default:
                        break;
                }
            }

            return action;
        }