Пример #1
0
        public OpenWithDialog(IList <DisplayBindingDescriptor> displayBindings, int defaultBindingIndex, string fileExtension)
        {
            if (displayBindings == null)
            {
                throw new ArgumentNullException("list");
            }

            // The InitializeComponent() call is required for Windows Forms designer support.
            InitializeComponent();

            foreach (Control ctl in this.Controls)
            {
                ctl.Text = StringParser.Parse(ctl.Text);
            }
            this.Text = StringParser.Parse(this.Text);

            this.fileExtension       = fileExtension;
            this.defaultBindingIndex = defaultBindingIndex;
            if (string.IsNullOrEmpty(fileExtension))
            {
                addButton.Enabled = false;
            }

            for (int i = 0; i < displayBindings.Count; i++)
            {
                programListBox.Items.Add(new ListEntry(displayBindings[i], i == defaultBindingIndex));
            }
            if (defaultBindingIndex < programListBox.Items.Count)
            {
                programListBox.SelectedIndex = defaultBindingIndex;
            }
            RightToLeftConverter.ConvertRecursive(this);
        }
Пример #2
0
        public void RedrawAllComponents()
        {
            RightToLeftConverter.ConvertRecursive(this);

            foreach (ToolStripItem item in TopMenu.Items)
            {
                if (item is IStatusUpdate)
                {
                    ((IStatusUpdate)item).UpdateText();
                }
            }

            foreach (IViewContent content in workbenchContentCollection)
            {
                content.RedrawContent();
                if (content.WorkbenchWindow != null)
                {
                    content.WorkbenchWindow.RedrawContent();
                }
            }

            foreach (PadDescriptor content in viewContentCollection)
            {
                content.RedrawContent();
            }

            if (layout != null)
            {
                layout.RedrawAllComponents();
            }

            StatusBarService.RedrawStatusbar();
        }
Пример #3
0
        public ManagerForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

                        #if !STANDALONE
            ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true);
                        #endif

                        #if STANDALONE
            actionFlowLayoutPanel.BackgroundImage = new Bitmap(typeof(ManagerForm).Assembly.GetManifestResourceStream("ICSharpCode.AddInManager.WizardBackground.png"));
                        #else
            actionFlowLayoutPanel.BackgroundImage = WinFormsResourceService.GetBitmap("GeneralWizardBackground");
                        #endif

            installButton.Text   = ResourceService.GetString("AddInManager.InstallButton");
            uninstallButton.Text = ResourceService.GetString("AddInManager.ActionUninstall");
            closeButton.Text     = ResourceService.GetString("Global.CloseButtonText");
            showPreinstalledAddInsCheckBox.Text = ResourceService.GetString("AddInManager.ShowPreinstalledAddIns");
            this.Text = ResourceService.GetString("AddInManager.Title");
            RightToLeftConverter.ConvertRecursive(this);

            CreateAddInList();
        }
Пример #4
0
        public void Initialize()
        {
            UpdateRenderer();
            ReadMaxViewContentCount();
            MenuComplete += new EventHandler(SetStandardStatusBar);
            SetStandardStatusBar(null, null);
            try
            {
                ArrayList contents = AddInTree.GetTreeNode(viewContentPath).BuildChildItems(this);
                foreach (PadDescriptor content in contents)
                {
                    if (content != null)
                    {
                        ShowPad(content);
                    }
                }
            }
            catch (TreePathNotFoundException) { }

            CreateMainMenu();
            CreateToolBars();

            toolbarUpdateTimer          = new System.Windows.Forms.Timer();
            toolbarUpdateTimer.Tick    += new EventHandler(UpdateMenu);
            toolbarUpdateTimer.Tick    += new EventHandler(ClearMemory);
            toolbarUpdateTimer.Interval = 500;
            toolbarUpdateTimer.Start();

            RightToLeftConverter.Convert(this);
        }
Пример #5
0
 public void ApplyRightToLeftConverter(Control control, bool recurse)
 {
     if (recurse)
     {
         RightToLeftConverter.ConvertRecursive(control);
     }
     else
     {
         RightToLeftConverter.Convert(control);
     }
 }
Пример #6
0
        public SelectReferenceDialog(IProject configureProject)
        {
            this.configureProject = configureProject;

            InitializeComponent();

            Translate(this);
            gacTabPage.Controls.Add(new GacReferencePanel(this));
            projectTabPage.Controls.Add(new ProjectReferencePanel(this));
            browserTabPage.Controls.Add(new AssemblyReferencePanel(this));
            comTabPage.Controls.Add(new COMReferencePanel(this));
            RightToLeftConverter.ConvertRecursive(this);
        }
Пример #7
0
 /// <summary>
 /// Creates the dialog and adds the specified names to the
 /// list box.
 /// </summary>
 public AddXmlNodeDialog(string[] names)
 {
     InitializeComponent();
     InitStrings();
     if (names.Length > 0)
     {
         AddNames(names);
     }
     else
     {
         RemoveNamesListBox();
     }
     RightToLeftConverter.ConvertRecursive(this);
 }
Пример #8
0
 protected void SetupFromXmlStream(Stream stream)
 {
     if (stream == null)
     {
         throw new System.ArgumentNullException("stream");
     }
     SuspendLayout();
     xmlLoader = new XmlLoader();
     SetupXmlLoader();
     if (stream != null)
     {
         xmlLoader.LoadObjectFromStream(this, stream);
     }
     RightToLeftConverter.ConvertRecursive(this);
     ResumeLayout(false);
 }
        public ManagerForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            installButton.Text   = ResourceService.GetString("AddInManager.InstallButton");                         //NOXLATE
            uninstallButton.Text = ResourceService.GetString("AddInManager.ActionUninstall");                       //NOXLATE
            closeButton.Text     = ResourceService.GetString("TextClose");                                          //NOXLATE
            showPreinstalledAddInsCheckBox.Text = ResourceService.GetString("AddInManager.ShowPreinstalledAddIns"); //NOXLATE
            this.Text = ResourceService.GetString("AddInManager.Title");                                            //NOXLATE
            RightToLeftConverter.ConvertRecursive(this);

            CreateAddInList();
        }
        public SearchAndReplaceDialog(SearchAndReplaceMode searchAndReplaceMode)
        {
            SuspendLayout();
            this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            this.ShowInTaskbar   = false;
            this.TopMost         = false;
            this.Text            = StringParser.Parse("${res:Dialog.NewProject.SearchReplace.Title}");
            this.KeyPreview      = true;

            searchAndReplacePanel      = new SearchAndReplacePanel();
            searchAndReplacePanel.Dock = DockStyle.Fill;
            Controls.Add(searchAndReplacePanel);

            ToolStrip toolStrip = new ToolStrip();

            toolStrip.Dock      = DockStyle.Top;
            toolStrip.Stretch   = true;
            toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;

            searchButton.Text    = StringParser.Parse("${res:Dialog.NewProject.SearchReplace.FindDialogName}");
            searchButton.Image   = IconService.GetBitmap("Icons.16x16.FindIcon");
            searchButton.Checked = searchAndReplaceMode == SearchAndReplaceMode.Search;
            searchButton.Click  += new EventHandler(SearchButtonClick);
            toolStrip.Items.Add(searchButton);

            replaceButton.Text    = StringParser.Parse("${res:Dialog.NewProject.SearchReplace.ReplaceDialogName}");
            replaceButton.Image   = IconService.GetBitmap("Icons.16x16.ReplaceIcon");
            replaceButton.Checked = searchAndReplaceMode == SearchAndReplaceMode.Replace;
            replaceButton.Click  += new EventHandler(ReplaceButtonClick);
            toolStrip.Items.Add(replaceButton);

            Controls.Add(toolStrip);
            RightToLeftConverter.ConvertRecursive(this);

            this.AutoScaleMode       = AutoScaleMode.Dpi;
            this.AutoScaleDimensions = new SizeF(96, 96);
            ResumeLayout();

            SetSearchAndReplaceMode();
            FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.SearchAndReplaceDialog.Location", false);

            searchKeyboardShortcut  = GetKeyboardShortcut(SearchMenuAddInPath, "Find");
            replaceKeyboardShortcut = GetKeyboardShortcut(SearchMenuAddInPath, "Replace");
        }
Пример #11
0
        protected void SetOptionPanelTo(TreeNode node)
        {
            IDialogPanelDescriptor descriptor = node.Tag as IDialogPanelDescriptor;

            if (descriptor != null && descriptor.DialogPanel != null && descriptor.DialogPanel.Control != null)
            {
                if (!OptionPanels.Contains(descriptor.DialogPanel))
                {
                    descriptor.DialogPanel.Control.Dock = DockStyle.Fill;
                    OptionPanels.Add(descriptor.DialogPanel);
                }

                descriptor.DialogPanel.ReceiveDialogMessage(DialogMessage.Activated);
                ControlDictionary["optionControlPanel"].Controls.Clear();
                RightToLeftConverter.ConvertRecursive(descriptor.DialogPanel.Control);
                ControlDictionary["optionControlPanel"].Controls.Add(descriptor.DialogPanel.Control);
                optionsPanelLabel.Text = descriptor.Label;
            }
        }
Пример #12
0
        public void InitializeWorkspace()
        {
            UpdateRenderer();

            MenuComplete += new EventHandler(SetStandardStatusBar);

            SetStandardStatusBar(null, null);

            ProjectService.CurrentProjectChanged += new ProjectEventHandler(SetProjectTitle);

            FileService.FileRemoved  += CheckRemovedOrReplacedFile;
            FileService.FileReplaced += CheckRemovedOrReplacedFile;
            FileService.FileRenamed  += CheckRenamedFile;

            FileService.FileRemoved += FileService.RecentOpen.FileRemoved;
            FileService.FileRenamed += FileService.RecentOpen.FileRenamed;

            try {
                ArrayList contents = AddInTree.GetTreeNode(viewContentPath).BuildChildItems(this);
                foreach (PadDescriptor content in contents)
                {
                    if (content != null)
                    {
                        ShowPad(content);
                    }
                }
            } catch (TreePathNotFoundException) {}

            CreateMainMenu();
            CreateToolBars();

            toolbarUpdateTimer       = new System.Windows.Forms.Timer();
            toolbarUpdateTimer.Tick += new EventHandler(UpdateMenu);

            toolbarUpdateTimer.Interval = 500;
            toolbarUpdateTimer.Start();

            RightToLeftConverter.Convert(this);
        }
Пример #13
0
        public void InitializeWorkspace()
        {
            UpdateRenderer();

            try
            {
                ArrayList contents      = AddInTree.GetTreeNode(viewContentPath).BuildChildItems(this);
                ArrayList viewMenuItems = new ArrayList();
                foreach (PadDescriptor content in contents)
                {
                    if (content != null)
                    {
                        ShowPad(content);
                        viewMenuItems.Add(new MyMenuItem(content));
                    }
                }
                // 创建outlook
                CreateOutlook(contents);
                if (viewMenuItems.Count > 0)
                {
                    _ViewItem = viewMenuItems.ToArray(typeof(ToolStripItem)) as ToolStripItem[];
                }
            }
            catch (Exception ex)
            {
            }

            CreateMainMenu();

            toolbarUpdateTimer       = new System.Windows.Forms.Timer();
            toolbarUpdateTimer.Tick += delegate
            {
                UpdateMenus();
            };
            toolbarUpdateTimer.Interval = 500;
            toolbarUpdateTimer.Start();

            RightToLeftConverter.Convert(this);
        }
Пример #14
0
        protected void MyInitializeComponents()
        {
            InitializeComponent();

            foreach (Control ctl in Controls.GetRecursive())
            {
                ctl.Text = StringParser.Parse(ctl.Text);
            }
            this.Text = StringParser.Parse(this.Text);
            RightToLeftConverter.Convert(this);

            ImageList imglist = new ImageList();

            imglist.ColorDepth = ColorDepth.Depth32Bit;
            imglist.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap"));
            imglist.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap"));
            categoryTreeView.ImageList = imglist;

            templateListView.SelectedIndexChanged += new EventHandler(SelectedIndexChange);
            categoryTreeView.AfterSelect          += new TreeViewEventHandler(CategoryChange);
            categoryTreeView.BeforeSelect         += new TreeViewCancelEventHandler(OnBeforeExpand);
            categoryTreeView.BeforeExpand         += new TreeViewCancelEventHandler(OnBeforeExpand);
            categoryTreeView.BeforeCollapse       += new TreeViewCancelEventHandler(OnBeforeCollapse);
            solutionNameTextBox.TextChanged       += new EventHandler(PathChanged);
            nameTextBox.TextChanged     += new EventHandler(PathChanged);
            locationTextBox.TextChanged += new EventHandler(PathChanged);

            if (createNewSolution)
            {
                createDirectoryForSolutionCheckBox.Checked         = CreateDirectoryForSolution;
                createDirectoryForSolutionCheckBox.CheckedChanged += delegate {
                    CreateDirectoryForSolution = createDirectoryForSolutionCheckBox.Checked;
                };
            }
            else
            {
                solutionNameTextBox.Visible = false;
                solutionNameLabel.Visible   = false;
                createDirectoryForSolutionCheckBox.Visible = false;
                bottomPanel.Height -= solutionNameTextBox.Height;

                createDirectoryForSolutionCheckBox.Checked = false;
            }

            largeIconsRadioButton.Checked         = PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
            largeIconsRadioButton.CheckedChanged += new EventHandler(IconSizeChange);
            largeIconsRadioButton.Image           = IconService.GetBitmap("Icons.16x16.LargeIconsIcon");

            smallIconsRadioButton.Checked         = !PropertyService.Get("Dialogs.NewProjectDialog.LargeImages", true);
            smallIconsRadioButton.CheckedChanged += new EventHandler(IconSizeChange);
            smallIconsRadioButton.Image           = IconService.GetBitmap("Icons.16x16.SmallIconsIcon");

            openButton.Click   += new EventHandler(TryCreateProject);
            browseButton.Click += new EventHandler(BrowseDirectories);
            createDirectoryForSolutionCheckBox.CheckedChanged += new EventHandler(PathChanged);

            ToolTip tooltip = new ToolTip();

            tooltip.SetToolTip(largeIconsRadioButton, StringParser.Parse("${res:Global.LargeIconToolTip}"));
            tooltip.SetToolTip(smallIconsRadioButton, StringParser.Parse("${res:Global.SmallIconToolTip}"));
            tooltip.Active = true;

            IconSizeChange(this, EventArgs.Empty);
        }