Beispiel #1
0
        public dynNoteViewModel(dynNoteModel model)
        {
            _model = model;
            model.PropertyChanged += note_PropertyChanged;

            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += Model_PropertyChanged;
            SelectCommand = new DelegateCommand(Select, CanSelect);
        }
Beispiel #2
0
        public dynNoteViewModel(dynNoteModel model)
        {
            _model = model;
            model.PropertyChanged += note_PropertyChanged;

            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += Model_PropertyChanged;
            SelectCommand = new DelegateCommand(Select, CanSelect);
        }
Beispiel #3
0
        public dynNoteViewModel(dynNoteModel model)
        {
            _model = model;
            model.PropertyChanged += note_PropertyChanged;

            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Model_PropertyChanged);
            SelectCommand = new DelegateCommand(Select, CanSelect);
        }
Beispiel #4
0
 public NoteEventArgs(dynNoteModel n, Dictionary<string, object> d)
 {
     Note = n;
     Data = d;
 }
Beispiel #5
0
 private void DeleteNote(dynNoteModel note)
 {
     DynamoSelection.Instance.Selection.Remove(note);
     _model.CurrentSpace.Notes.Remove(note);
 }
Beispiel #6
0
        private void AddNote(object parameters)
        {
            var inputs = parameters as Dictionary<string, object> ?? new Dictionary<string, object>();

            // by default place note at center
            var x = 0.0;
            var y = 0.0;

            if (inputs != null && inputs.ContainsKey("x"))
                x = (double)inputs["x"];

            if (inputs != null && inputs.ContainsKey("y"))
                y = (double)inputs["y"];

            var n = new dynNoteModel(x, y);

            //if we have null parameters, the note is being added
            //from the menu, center the view on the note
            if (parameters == null)
            {
                inputs.Add("transformFromOuterCanvasCoordinates", true);
                dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.OnRequestNodeCentered( this, new ModelEventArgs(n, inputs) );
            }

            object id;
            if (inputs.TryGetValue("guid", out id))
                n.GUID = (Guid)id;

            n.Text = (inputs == null || !inputs.ContainsKey("text")) ? "New Note" : inputs["text"].ToString();
            var ws = (inputs == null || !inputs.ContainsKey("workspace")) ? _model.CurrentSpace : (dynWorkspaceModel)inputs["workspace"];

            ws.Notes.Add(n);
        }
Beispiel #7
0
        private void AddNote(object parameters)
        {
            var inputs = (Dictionary<string, object>)parameters;

            // by default place note at center
            var x = 0.0;
            var y = 0.0;

            if (inputs != null && inputs.ContainsKey("x"))
                x = (double)inputs["x"];

            if (inputs != null && inputs.ContainsKey("y"))
                y = (double)inputs["y"];

            var n = new dynNoteModel(x, y);

            n.Text = (inputs == null || !inputs.ContainsKey("text")) ? "New Note" : inputs["text"].ToString();
            var ws = (inputs == null || !inputs.ContainsKey("workspace")) ? _model.CurrentSpace : (dynWorkspaceModel)inputs["workspace"];

            ws.Notes.Add(n);

            if (!ViewingHomespace)
            {
                _model.CurrentSpace.Modified();
            }
        }
Beispiel #8
0
        private void AddNote(object parameters)
        {
            var inputs = (Dictionary<string, object>)parameters;

            inputs = inputs ?? new Dictionary<string, object>();

            // by default place note at center
            var x = 0.0;
            var y = 0.0;

            if (inputs != null && inputs.ContainsKey("x"))
                x = (double)inputs["x"];

            if (inputs != null && inputs.ContainsKey("y"))
                y = (double)inputs["y"];

            var n = new dynNoteModel(x, y);

            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.OnRequestNoteCentered( this, new NoteEventArgs(n, inputs) );

            n.Text = (inputs == null || !inputs.ContainsKey("text")) ? "New Note" : inputs["text"].ToString();
            var ws = (inputs == null || !inputs.ContainsKey("workspace")) ? _model.CurrentSpace : (dynWorkspaceModel)inputs["workspace"];

            ws.Notes.Add(n);
        }