Ejemplo n.º 1
0
 private void InitializeComponent()
 {
     this.DirectCallTab       = new global::System.Windows.Forms.TabPage();
     this.groupBox3           = new global::System.Windows.Forms.GroupBox();
     this.btnResume           = new global::System.Windows.Forms.Button();
     this.btnPause            = new global::System.Windows.Forms.Button();
     this.btnHangUpDirectCall = new global::System.Windows.Forms.Button();
     this.label6                 = new global::System.Windows.Forms.Label();
     this.btnMakeDirectCall      = new global::System.Windows.Forms.Button();
     this.tbTargetIP             = new global::System.Windows.Forms.TextBox();
     this.label5                 = new global::System.Windows.Forms.Label();
     this.tbTargetUserNameDirect = new global::System.Windows.Forms.TextBox();
     this.groupBox1              = new global::System.Windows.Forms.GroupBox();
     this.btnLogOut              = new global::System.Windows.Forms.Button();
     this.btnLogIn               = new global::System.Windows.Forms.Button();
     this.label1                 = new global::System.Windows.Forms.Label();
     this.tbAccountUser          = new global::System.Windows.Forms.TextBox();
     this.TabsContainer          = new global::System.Windows.Forms.TabControl();
     this.Item1 = new global::System.Windows.Forms.ToolStripMenuItem();
     this.exitToolStripMenuItem = new global::System.Windows.Forms.ToolStripMenuItem();
     this.MainMenu = new global::System.Windows.Forms.MenuStrip();
     this.DirectCallTab.SuspendLayout();
     this.groupBox3.SuspendLayout();
     this.groupBox1.SuspendLayout();
     this.TabsContainer.SuspendLayout();
     this.MainMenu.SuspendLayout();
     this.SuspendLayout();
     this.DirectCallTab.Controls.Add(this.groupBox3);
     this.DirectCallTab.Controls.Add(this.groupBox1);
     this.DirectCallTab.Location = new global::System.Drawing.Point(4, 25);
     this.DirectCallTab.Name     = "DirectCallTab";
     this.DirectCallTab.Padding  = new global::System.Windows.Forms.Padding(3);
     this.DirectCallTab.Size     = new global::System.Drawing.Size(303, 353);
     this.DirectCallTab.TabIndex = 0;
     this.DirectCallTab.Text     = "Direct Call";
     this.DirectCallTab.UseVisualStyleBackColor = true;
     this.groupBox3.Controls.Add(this.btnResume);
     this.groupBox3.Controls.Add(this.btnPause);
     this.groupBox3.Controls.Add(this.btnHangUpDirectCall);
     this.groupBox3.Controls.Add(this.label6);
     this.groupBox3.Controls.Add(this.btnMakeDirectCall);
     this.groupBox3.Controls.Add(this.tbTargetIP);
     this.groupBox3.Controls.Add(this.label5);
     this.groupBox3.Controls.Add(this.tbTargetUserNameDirect);
     this.groupBox3.Location = new global::System.Drawing.Point(6, 157);
     this.groupBox3.Name     = "groupBox3";
     this.groupBox3.Size     = new global::System.Drawing.Size(287, 187);
     this.groupBox3.TabIndex = 3;
     this.groupBox3.TabStop  = false;
     this.groupBox3.Text     = "Partner Properties";
     this.btnResume.Enabled  = false;
     this.btnResume.Location = new global::System.Drawing.Point(6, 148);
     this.btnResume.Name     = "btnResume";
     this.btnResume.Size     = new global::System.Drawing.Size(101, 23);
     this.btnResume.TabIndex = 9;
     this.btnResume.Text     = "Resume";
     this.btnResume.UseVisualStyleBackColor = true;
     this.btnResume.Click  += new global::System.EventHandler(this.btnResume_Click);
     this.btnPause.Enabled  = false;
     this.btnPause.Location = new global::System.Drawing.Point(6, 119);
     this.btnPause.Name     = "btnPause";
     this.btnPause.Size     = new global::System.Drawing.Size(101, 23);
     this.btnPause.TabIndex = 8;
     this.btnPause.Text     = "Pause";
     this.btnPause.UseVisualStyleBackColor = true;
     this.btnPause.Click += new global::System.EventHandler(this.btnPause_Click);
     this.btnHangUpDirectCall.Enabled  = false;
     this.btnHangUpDirectCall.Location = new global::System.Drawing.Point(206, 93);
     this.btnHangUpDirectCall.Name     = "btnHangUpDirectCall";
     this.btnHangUpDirectCall.Size     = new global::System.Drawing.Size(75, 49);
     this.btnHangUpDirectCall.TabIndex = 5;
     this.btnHangUpDirectCall.Text     = "Hang Up";
     this.btnHangUpDirectCall.UseVisualStyleBackColor = true;
     this.btnHangUpDirectCall.Click += new global::System.EventHandler(this.btnHangUpDirectCall_Click);
     this.label6.AutoSize            = true;
     this.label6.Location            = new global::System.Drawing.Point(6, 74);
     this.label6.Name                = "label6";
     this.label6.Size                = new global::System.Drawing.Size(61, 13);
     this.label6.TabIndex            = 5;
     this.label6.Text                = "Your Address Is:";
     this.btnMakeDirectCall.Enabled  = false;
     this.btnMakeDirectCall.Location = new global::System.Drawing.Point(206, 39);
     this.btnMakeDirectCall.Name     = "btnMakeDirectCall";
     this.btnMakeDirectCall.Size     = new global::System.Drawing.Size(75, 48);
     this.btnMakeDirectCall.TabIndex = 4;
     this.btnMakeDirectCall.Text     = "Call";
     this.btnMakeDirectCall.UseVisualStyleBackColor = true;
     this.btnMakeDirectCall.Click        += new global::System.EventHandler(this.btnMakeDirectCall_Click);
     this.tbTargetIP.Location             = new global::System.Drawing.Point(6, 93);
     this.tbTargetIP.MaxLength            = 500;
     this.tbTargetIP.Name                 = "tbTargetIP";
     this.tbTargetIP.Size                 = new global::System.Drawing.Size(137, 20);
     this.tbTargetIP.TabIndex             = 4;
     this.tbTargetIP.Text                 = "192.168.1.101";
     this.label5.AutoSize                 = true;
     this.label5.Location                 = new global::System.Drawing.Point(6, 23);
     this.label5.Name                     = "label5";
     this.label5.Size                     = new global::System.Drawing.Size(106, 13);
     this.label5.TabIndex                 = 2;
     this.label5.Text                     = "User Name:";
     this.tbTargetUserNameDirect.Location = new global::System.Drawing.Point(6, 39);
     this.tbTargetUserNameDirect.Name     = "tbTargetUserNameDirect";
     this.tbTargetUserNameDirect.Size     = new global::System.Drawing.Size(137, 20);
     this.tbTargetUserNameDirect.TabIndex = 1;
     this.tbTargetUserNameDirect.Text     = "USER2";
     this.groupBox1.Controls.Add(this.btnLogOut);
     this.groupBox1.Controls.Add(this.btnLogIn);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Controls.Add(this.tbAccountUser);
     this.groupBox1.Location = new global::System.Drawing.Point(6, 6);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new global::System.Drawing.Size(287, 145);
     this.groupBox1.TabIndex = 2;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Your Account";
     this.btnLogOut.Enabled  = false;
     this.btnLogOut.Location = new global::System.Drawing.Point(31, 104);
     this.btnLogOut.Name     = "btnLogOut";
     this.btnLogOut.Size     = new global::System.Drawing.Size(88, 23);
     this.btnLogOut.TabIndex = 4;
     this.btnLogOut.Text     = "Log Out";
     this.btnLogOut.UseVisualStyleBackColor = true;
     this.btnLogOut.Click  += new global::System.EventHandler(this.btnLogOut_Click);
     this.btnLogIn.Location = new global::System.Drawing.Point(31, 71);
     this.btnLogIn.Name     = "btnLogIn";
     this.btnLogIn.Size     = new global::System.Drawing.Size(88, 23);
     this.btnLogIn.TabIndex = 4;
     this.btnLogIn.Text     = "Log In";
     this.btnLogIn.UseVisualStyleBackColor = true;
     this.btnLogIn.Click          += new global::System.EventHandler(this.btnLogIn_Click);
     this.label1.AutoSize          = true;
     this.label1.Location          = new global::System.Drawing.Point(6, 20);
     this.label1.Name              = "label1";
     this.label1.Size              = new global::System.Drawing.Size(106, 13);
     this.label1.TabIndex          = 1;
     this.label1.Text              = "User Name:";
     this.tbAccountUser.Location   = new global::System.Drawing.Point(6, 39);
     this.tbAccountUser.Name       = "tbAccountUser";
     this.tbAccountUser.Size       = new global::System.Drawing.Size(137, 20);
     this.tbAccountUser.TabIndex   = 0;
     this.tbAccountUser.Text       = "USER1";
     this.TabsContainer.Appearance = global::System.Windows.Forms.TabAppearance.Buttons;
     this.TabsContainer.Controls.Add(this.DirectCallTab);
     this.TabsContainer.Dock          = global::System.Windows.Forms.DockStyle.Fill;
     this.TabsContainer.Location      = new global::System.Drawing.Point(0, 24);
     this.TabsContainer.Name          = "TabsContainer";
     this.TabsContainer.SelectedIndex = 0;
     this.TabsContainer.Size          = new global::System.Drawing.Size(311, 382);
     this.TabsContainer.TabIndex      = 0;
     this.Item1.DropDownItems.AddRange(new global::System.Windows.Forms.ToolStripItem[] { this.exitToolStripMenuItem });
     this.Item1.Name = "Item1";
     this.Item1.Size = new global::System.Drawing.Size(61, 20);
     this.Item1.Text = "Main";
     this.exitToolStripMenuItem.Name   = "exitToolStripMenuItem";
     this.exitToolStripMenuItem.Size   = new global::System.Drawing.Size(117, 22);
     this.exitToolStripMenuItem.Text   = "Exit";
     this.exitToolStripMenuItem.Click += new global::System.EventHandler(this.exitToolStripMenuItem_Click);
     this.MainMenu.BackColor           = global::System.Drawing.SystemColors.Control;
     this.MainMenu.Items.AddRange(new global::System.Windows.Forms.ToolStripItem[] { this.Item1 });
     this.MainMenu.Location   = new global::System.Drawing.Point(0, 0);
     this.MainMenu.Name       = "MainMenu";
     this.MainMenu.Size       = new global::System.Drawing.Size(311, 24);
     this.MainMenu.TabIndex   = 1;
     this.MainMenu.Text       = "menuStrip1";
     this.AutoScaleDimensions = new global::System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = global::System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new global::System.Drawing.Size(311, 406);
     this.Controls.Add(this.TabsContainer);
     this.Controls.Add(this.MainMenu);
     this.FormBorderStyle = global::System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.MainMenuStrip   = this.MainMenu;
     this.MaximizeBox     = false;
     this.Name            = "MainWindow";
     this.Text            = "Main Window";
     this.FormClosing    += new global::System.Windows.Forms.FormClosingEventHandler(this.MainWindow_FormClosing);
     this.DirectCallTab.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.groupBox3.PerformLayout();
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.TabsContainer.ResumeLayout(false);
     this.MainMenu.ResumeLayout(false);
     this.MainMenu.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Ejemplo n.º 2
0
        public void MakeRibbon()
        {
            PlugInManager pm = new PlugInManager();

            foreach (IExplorerRibbonTab exRibbonTab in OrderedPluginList <IExplorerRibbonTab> .Sort(
                         pm.GetPlugins(gView.Framework.system.Plugins.Type.IExplorerRibbonTab).Select(p => pm.CreateInstance <IExplorerRibbonTab>(p))))
            {
                Fluent.RibbonTabItem tabItem = new Fluent.RibbonTabItem();
                tabItem.Header = exRibbonTab.Header;
                ribbon.Tabs.Add(tabItem);
                tabItem.DataContext = exRibbonTab;

                foreach (RibbonGroupBox exGroupBox in exRibbonTab.Groups)
                {
                    Fluent.RibbonGroupBox groupBox = new Fluent.RibbonGroupBox();
                    groupBox.Header = exGroupBox.Header;
                    tabItem.Groups.Add(groupBox);

                    foreach (RibbonItem cartoRibbonItem in exGroupBox.Items)
                    {
                        Guid toolGUID = cartoRibbonItem.Guid;
                        if (toolGUID == new Guid("00000000-0000-0000-0000-000000000000"))
                        {
                            groupBox.Items.Add(new Separator());
                            continue;
                        }

                        object tool = pm.CreateInstance(toolGUID);
                        if (tool == null)
                        {
                            continue;
                        }

                        #region IToolItem
                        if (tool is IToolItem)
                        {
                            if (((IToolItem)tool).ToolItem != null)
                            {
                                if (((IToolItem)tool).ToolItem is global::System.Windows.Forms.ToolStripItem)
                                {
                                    StackPanel panel = new StackPanel();
                                    panel.Margin = new Thickness(0, 32, 0, 0);

                                    global::System.Windows.Forms.ToolStripItem stripItem = ((IToolItem)tool).ToolItem;

                                    global::System.Windows.Forms.MenuStrip bar = new global::System.Windows.Forms.MenuStrip();
                                    bar.BackColor = global::System.Drawing.Color.Transparent; //.FromArgb(223, 234, 246);

                                    bar.Items.Add(stripItem);

                                    WindowsFormsHost host = new WindowsFormsHost();
                                    host.Background = new SolidColorBrush(Color.FromRgb(223, 234, 246));
                                    host.Child      = bar;

                                    if (tool is IToolItemLabel)
                                    {
                                        IToolItemLabel label = (IToolItemLabel)tool;
                                        panel.Orientation = label.LabelPosition == ToolItemLabelPosition.top ||
                                                            label.LabelPosition == ToolItemLabelPosition.bottom ? Orientation.Vertical : Orientation.Horizontal;

                                        if (panel.Orientation == Orientation.Vertical)
                                        {
                                            panel.Margin = new Thickness(0, 13, 0, 0);
                                        }

                                        TextBlock text = new TextBlock();
                                        text.Text    = label.Label;
                                        text.Padding = new Thickness(3);

                                        if (label.LabelPosition == ToolItemLabelPosition.top || label.LabelPosition == ToolItemLabelPosition.left)
                                        {
                                            panel.Children.Insert(0, text);
                                        }
                                        else
                                        {
                                            panel.Children.Add(text);
                                        }
                                    }

                                    panel.Children.Add(host);

                                    groupBox.Items.Add(panel);
                                }
                            }
                        }
                        #endregion

                        #region IToolMenu
                        else if (tool is IExToolMenu)
                        {
                            DropDownToolButton button = new DropDownToolButton(tool as IExToolMenu);
                            button.Click += new RoutedEventHandler(ToolButton_Click);
                            groupBox.Items.Add(button);
                        }
                        #endregion

                        #region ITool
                        else if (tool is IExTool)
                        {
                            ((IExTool)tool).OnCreate(_application);
                            ToolButton button = new ToolButton(tool as IExTool);
                            button.SizeDefinition = cartoRibbonItem.SizeDefinition;

                            groupBox.Items.Add(button);
                            button.Click += new RoutedEventHandler(ToolButton_Click);
                        }
                        #endregion
                    }
                }

                if (ribbon.Tabs.Count == 1)
                {
                    #region Favorites
                    Fluent.RibbonGroupBox favBox = new Fluent.RibbonGroupBox();
                    favBox.Header             = String.Empty;
                    _favDropDownButton        = new Fluent.DropDownButton();
                    _favDropDownButton.Header = "Favorites";
                    _favDropDownButton.Icon   = _favDropDownButton.LargeIcon = ImageFactory.FromBitmap(global::gView.Win.DataExplorer.Properties.Resources.folder_heart);

                    Fluent.MenuItem add2fav = new Fluent.MenuItem();
                    add2fav.Header = "Add to favorites...";
                    add2fav.Icon   = ImageFactory.FromBitmap(global::gView.Win.DataExplorer.Properties.Resources.folder_heart);
                    add2fav.Click += new RoutedEventHandler(Add2Favorites_Click);
                    _favDropDownButton.Items.Add(add2fav);

                    bool first = true;
                    foreach (MyFavorites.Favorite fav in (new MyFavorites().Favorites))
                    {
                        if (fav == null)
                        {
                            continue;
                        }

                        WpfFavoriteMenuItem fItem = new WpfFavoriteMenuItem(fav);
                        fItem.Click += new RoutedEventHandler(MenuItem_Favorite_Click);

                        if (first)
                        {
                            first = false;
                            _favDropDownButton.Items.Add(new Separator());
                        }
                        _favDropDownButton.Items.Add(fItem);
                    }

                    favBox.Items.Add(_favDropDownButton);
                    ribbon.Tabs[0].Groups.Add(favBox);
                    #endregion

                    _createNewRibbonGroupBox            = new Fluent.RibbonGroupBox();
                    _createNewRibbonGroupBox.Header     = "Create New";
                    _createNewRibbonGroupBox.Visibility = Visibility.Visible;
                    _createNewRibbonGroupBox.Background = new SolidColorBrush(Colors.GreenYellow);

                    ribbon.Tabs[0].Groups.Add(_createNewRibbonGroupBox);
                }
            }

            #region Options
            Fluent.RibbonTabItem optionsTab = new Fluent.RibbonTabItem()
            {
                Header = "Options"
            };
            Fluent.RibbonGroupBox optionsBox = new Fluent.RibbonGroupBox()
            {
                Header = String.Empty
            };
            optionsTab.Groups.Add(optionsBox);

            foreach (var pageType in pm.GetPlugins(gView.Framework.system.Plugins.Type.IExplorerOptionPage))
            {
                IExplorerOptionPage page = pm.CreateInstance <IExplorerOptionPage>(pageType);
                if (page == null)
                {
                    continue;
                }

                OptionsButton button = new OptionsButton(page);
                button.Click += new RoutedEventHandler(OptoinButton_Click);
                optionsBox.Items.Add(button);
            }
            ribbon.Tabs.Add(optionsTab);
            #endregion
        }