Пример #1
0
        public ZenCodingOptionsPage(Lifetime lifetime, OptionsSettingsSmartContext settings, IThreading threading, IThemedIconManager iconManager)
        {
            myLifetime         = lifetime;
            mySettings         = settings;
            myThreading        = threading;
            myIconManager      = iconManager;
            myLambdaExpression = s => s.FileAssociations;

            InitializeComponent();

            myFileAssociations = new SortedDictionary <int, FileAssociation>();
            foreach (var pair in mySettings.EnumerateIndexedEntry(myLambdaExpression))
            {
                myFileAssociations[pair.First] = pair.Second;
            }

            var model = BuildModel();

            myView = new FileAssociationsTreeView(model, new FileAssociationViewController())
            {
                Presenter = new FileAssociationPresenter(),
                Dock      = DockStyle.Fill
            };
            myView.DoubleClick += EditFileAssociation;
            myRules.Controls.Add(myView);

            _buttons.Items.Add("Create", myIconManager.Icons[ZenCodingCommonThemedIcons.Add.Id].CurrentGdipBitmap96, CreateFileAssociation);
            _buttons.Items.Add("Edit", myIconManager.Icons[CommonThemedIcons.Edit.Id].CurrentGdipBitmap96, EditFileAssociation);
            _buttons.Items.Add("Remove", myIconManager.Icons[CommonThemedIcons.Remove.Id].CurrentGdipBitmap96, RemoveFileAssociation);
            _buttons.Items.Add("Up", myIconManager.Icons[CommonThemedIcons.Up.Id].CurrentGdipBitmap96, MoveUp);
            _buttons.Items.Add("Down", myIconManager.Icons[CommonThemedIcons.Down.Id].CurrentGdipBitmap96, MoveDown);
        }
    public ZenCodingOptionsPage(Lifetime lifetime, OptionsSettingsSmartContext settings, IThreading threading, IThemedIconManager iconManager)
    {
      myLifetime = lifetime;
      mySettings = settings;
      myThreading = threading;
      myIconManager = iconManager;
      myLambdaExpression = s => s.FileAssociations;

      InitializeComponent();

      myFileAssociations = new SortedDictionary<int, FileAssociation>();
      foreach (var pair in mySettings.EnumerateIndexedEntry(myLambdaExpression))
      {
        myFileAssociations[pair.First] = pair.Second;
      }

      var model = BuildModel();

      myView = new FileAssociationsTreeView(model, new FileAssociationViewController())
      {
        Presenter = new FileAssociationPresenter(),
        Dock = DockStyle.Fill
      };
      myView.DoubleClick += EditFileAssociation;
      myRules.Controls.Add(myView);

      _buttons.Items.Add("Create", myIconManager.Icons[ZenCodingCommonThemedIcons.Add.Id].CurrentGdipBitmap96, CreateFileAssociation);
      _buttons.Items.Add("Edit", myIconManager.Icons[CommonThemedIcons.Edit.Id].CurrentGdipBitmap96, EditFileAssociation);
      _buttons.Items.Add("Remove", myIconManager.Icons[CommonThemedIcons.Remove.Id].CurrentGdipBitmap96, RemoveFileAssociation);
      _buttons.Items.Add("Up", myIconManager.Icons[CommonThemedIcons.Up.Id].CurrentGdipBitmap96, MoveUp);
      _buttons.Items.Add("Down", myIconManager.Icons[CommonThemedIcons.Down.Id].CurrentGdipBitmap96, MoveDown);
    }
        public ZenCodingOptionsPage()
        {
            InitializeComponent();

              var model = BuildModel(Settings.Instance.FileAssociations);
              myView = new FileAssociationsTreeView(model, new FileAssociationViewController())
              {
            Presenter = new FileAssociationPresenter(),
            Dock = DockStyle.Fill
              };
              myView.DoubleClick += EditFileAssociation;
              myRules.Controls.Add(myView);

              _buttons.Items.Add("Create", ImageLoader.GetImage("Create"), CreateFileAssociation);

              _buttons.Items.Add("Edit", ImageLoader.GetImage("Edit"), EditFileAssociation);

              _buttons.Items.Add("Remove", ImageLoader.GetImage("Remove"), RemoveFileAssociation);

              _buttons.Items.Add("Up", ImageLoader.GetImage("Up"), MoveUp);

              _buttons.Items.Add("Down", ImageLoader.GetImage("Down"), MoveDown);
        }