Example #1
0
 public static void SetByCommand(this IEditableProperty property, object newValue, ICommandHistory history)
 {
     if (property.AcceptValueObject(newValue))
     {
         var command = Command.Set(property, newValue);
         history.Insert(command);
     }
 }
Example #2
0
        //click on new assembly reference
        private void AddReferenceItemClickedCB(object sender, EventArgs args)
        {
            var menuItem = sender as MenuEntry;

            if (menuItem.UserData is IProject)
            {
                var proj = menuItem.UserData as IProject;

                //load assembly
                var fd = new OpenFileDialog();
                fd.DefaultExt = "dll";
                fd.Filter     = "Assembly (*.dll)|*.dll";
                fd.ShowDialog();
                if (fd.FileName == "")
                {
                    return;
                }

                var com = new CommandAddAssemblyReference(new Uri(fd.FileName), proj);
                FHistory.Insert(com);
            }
        }