Esempio n. 1
1
 private void CheckApplicationUpdate()
 {
     if ((bool)Configuration.Updates["checkProgramUpdate"])
     {
         WriteLog("Checking for update...");
         try {
             var dver = new WebClient
             {
                 Headers = new WebHeaderCollection { { "user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)" } }
             }.DownloadString(new Uri("http://goo.gl/SIDgFx"));
             if (dver == ProductVersion)
                 WriteLog("No update found.");
             else if (dver != ProductVersion)
             {
                 WriteLog("Update avaible: " + dver);
                 var mi2 = new MethodInvoker(() =>
                 {
                     var alert = new RadDesktopAlert
                     {
                         CaptionText = @"Найдено обновление",
                         ContentText = "<html>Найдено обновление лаунчера: <b>" + dver + "</b>\nТекущая версия: <b>" +
                             ProductVersion +
                             "</b>\n Хотите ли вы пройти на страницу загрузки данного обновления?\n\nP.S. В противном случае, это уведомление будет появляться при каждом запуске лаунчера >:3",
                         ShowCloseButton = false,
                         ShowOptionsButton = false,
                         ShowPinButton = false,
                         AutoClose = false,
                         CanMove = false,
                         AutoCloseDelay = 5,
                         FixedSize = new Size(329, 235),
                         ThemeName = "VisualStudio2012Dark"
                     };
                     var openUrlButton = new RadButtonElement("Получить обновление");
                     openUrlButton.Click += delegate
                     {
                         Process.Start(@"http://goo.gl/YWCrAl");
                         alert.Hide();
                         Application.Exit();
                     };
                     var ignoreButton = new RadButtonElement("Игнорировать");
                     ignoreButton.Click += delegate { alert.Hide(); };
                     alert.ButtonItems.Add(openUrlButton);
                     alert.ButtonItems.Add(ignoreButton);
                     alert.Show();
                 });
                 Invoke(mi2);
             }
             CheckVersions();
         }
         catch (Exception ex)
         {
             WriteLog("Во время проверки обновлений возникла ошибка:\n" + ex.Message + "\nPlease, head to http://vk.com/sesmc for actual news");
             CheckVersions();
         }
     }
     else
     {
         WriteLog("Проверка наличия обновлений отлючена пользователем");
         CheckVersions();
     }
 }
Esempio n. 2
0
        //统计分析
        private void CreatStatGroup()
        {
            RadRibbonBarGroup rbgAreaStatic = new RadRibbonBarGroup();

            rbgAreaStatic.Text            = "统计分析";
            _btnNdviStatic                = new RadButtonElement("行政区划");
            _btnNdviStatic.ImageAlignment = ContentAlignment.TopCenter;
            _btnNdviStatic.TextAlignment  = ContentAlignment.BottomCenter;
            _btnNdviStatic.Click         += new EventHandler(btnNdviStatic_Click);
            rbgAreaStatic.Items.Add(_btnNdviStatic);

            _btnAvgStatic = new RadButtonElement("平均值统计");
            _btnAvgStatic.ImageAlignment = ContentAlignment.TopCenter;
            _btnAvgStatic.TextAlignment  = ContentAlignment.BottomCenter;
            _btnAvgStatic.Click         += new EventHandler(_btnAvgStatic_Click);
            rbgAreaStatic.Items.Add(_btnAvgStatic);

            _btnCustomStatic = new RadButtonElement("自定义");
            _btnCustomStatic.ImageAlignment = ContentAlignment.TopCenter;
            _btnCustomStatic.TextAlignment  = ContentAlignment.BottomCenter;
            _btnCustomStatic.Click         += new EventHandler(_btnCustomStatic_Click);
            rbgAreaStatic.Items.Add(_btnCustomStatic);

            _tab.Items.Add(rbgAreaStatic);
        }
        private void RdBtnMenuDownloadBhavCopy_Click(object sender, EventArgs e)
        {
            try
            {
                RadButtonElement _RadButtonElement = (RadButtonElement)sender;
                if ((!string.IsNullOrEmpty(_RadButtonElement.Tag.ToString()) && _RadButtonElement.Tag.ToString() != ""))
                {
                    OpenForm(_RadButtonElement.Text, _RadButtonElement.Tag.ToString());
                }
                if ((!string.IsNullOrEmpty(_RadButtonElement.Text) && _RadButtonElement.Text != "") && (_RadButtonElement.Text.ToUpper() == "LOG OUT & EXIST"))
                {
                    DialogResult dgRsult = MessageBox.Show(this, "Do you want exit or log out?" + Environment.NewLine + "Click Yes for exit No for Log Out.", "SBS ATM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
                    switch (dgRsult)
                    {
                    case DialogResult.Yes:
                        Application.Exit();
                        break;

                    case DialogResult.No:
                        Application.Restart();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                ClsMessage._IClsMessage.ProjectExceptionMessage(ex.Message);
            }
        }
 private void grdItems_CellFormatting(object sender, CellFormattingEventArgs e)
 {
     try
     {
         if (e.CellElement is GridCommandCellElement)
         {
             if (e.Column.Name.Equals("Delete"))
             {
                 RadButtonElement bte = (RadButtonElement)e.CellElement.Children[0];
                 if (bte.Image == null)
                 {
                     bte.TextImageRelation = TextImageRelation.Overlay;
                     bte.DisplayStyle      = DisplayStyle.Image;
                     bte.ImageAlignment    = ContentAlignment.MiddleCenter;
                     bte.Image             = Resources.Sign_07;
                     bte.ToolTipText       = @"Eliminar Registro";
                     bte.AutoSize          = true;
                 }
             }
             if (e.CellElement.RowInfo is GridViewNewRowInfo && e.CellElement.ColumnInfo is GridViewCommandColumn)
             {
                 ((RadButtonElement)e.CellElement.Children[0]).Visibility = ElementVisibility.Hidden;
             }
         }
     }
     catch (Exception ex) { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido un error al formatear el icono." + ex.Message); }
 }
Esempio n. 5
0
        void radSchedulerReminder1_RemindObjectShown(object sender, RadShowRemindObjectArgs e)
        {
            if (this.openedAlerts.Contains(e.RemindObject))
            {
                return;
            }
            Telerik.WinControls.UI.RadDesktopAlert radDesktopAlert = new Telerik.WinControls.UI.RadDesktopAlert(this.components);

            RadButtonElement radButtonElement = new RadButtonElement();

            radButtonElement.Click += new EventHandler(radButtonElement_Click);
            radButtonElement.Tag    = e.RemindObject;
            radButtonElement.Image  = global::Telerik.Examples.WinControls.Properties.Resources.Symbol_Edit;

            this.openedAlerts.Add(e.RemindObject);

            radDesktopAlert.ButtonItems.Add(radButtonElement);

            radDesktopAlert.FixedSize    = new System.Drawing.Size(329, 120);
            radDesktopAlert.ContentImage = global::Telerik.Examples.WinControls.Properties.Resources.Clock_Alarm;
            radDesktopAlert.ContentText  = "<html><I>" + ((Appointment)e.RemindObject).Description + "</I></html>";
            radDesktopAlert.CaptionText  = e.RemindObject.Subject;
            radDesktopAlert.Show();
            radDesktopAlert.Closed += new RadPopupClosedEventHandler(radDesktopAlert_AlertClosed);
        }
Esempio n. 6
0
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);
            panel = new StackLayoutPanel();
            panel.StretchVertically = false;

            addButton                     = new RadButtonElement();
            addButton.Text                = "AddButton";
            addButton.MinSize             = new Size(200, 20);
            addButton.StretchVertically   = true;
            addButton.StretchHorizontally = true;
            addButton.Click              += this.AddButton_Click;
            panel.Children.Add(addButton);


            deleteButton                     = new RadButtonElement();
            deleteButton.Text                = "DeleteButton";
            deleteButton.MinSize             = new Size(200, 20);
            deleteButton.StretchVertically   = true;
            deleteButton.StretchHorizontally = true;
            deleteButton.Click              += this.DeleteButton_Click;
            panel.Children.Add(deleteButton);
            base.SizingGripDockLayout.Children.Insert(1, this.panel);

            DockLayoutPanel.SetDock(this.SizingGrip, Telerik.WinControls.Layouts.Dock.Bottom);
            DockLayoutPanel.SetDock(panel, Telerik.WinControls.Layouts.Dock.Bottom);
        }
Esempio n. 7
0
        void btn_Click(object sender, EventArgs e)
        {
            RadButtonElement btn = sender as RadButtonElement;

            if (btn == null || btn.Tag == null || !(btn.Tag is ProductDef))
            {
                return;
            }
            ProductDef          prdDef     = btn.Tag as ProductDef;
            string              uiProvider = prdDef.UIProvider;
            ContentOfUIProvider prd        = new ContentOfUIProvider(uiProvider);

            if (prd != null)
            {
                RibbonTab tab = (RibbonTab)(prd.Control as IUIProvider).Content;
                tab.Tag = prdDef;
                if (tab != null)
                {
                    (prd.Control as IUITabProvider).Init(_session);
                    int idx = _session.UIFrameworkHelper.IndexOf("监测分析专题");
                    _session.UIFrameworkHelper.InsertTab(idx + 1, tab);
                    TryChangeActiveProduct(prdDef.Identify);
                }
            }
        }
Esempio n. 8
0
        private void CreatTab()
        {
            _tab       = new RibbonTab();
            _tab.Title = "地理信息";
            _tab.Text  = _tab.Name = "地理信息";

            _layerManager = new RadButtonElement("图层管理器");
            _layerManager.ImageAlignment    = ContentAlignment.TopCenter;
            _layerManager.TextAlignment     = ContentAlignment.MiddleCenter;
            _layerManager.TextImageRelation = TextImageRelation.ImageAboveText;
            _layerManager.Click            += new EventHandler(_layerManager_Click);

            RadRibbonBarGroup group = new RadRibbonBarGroup();

            group.Text = "图层管理器";
            group.Items.Add(_layerManager);
            _tab.Items.Add(group);

            CreatDeleteGroup();
            CreatBasicRasterGroup();
            CreatInterestAreaGroup();
            CreatSplitGroup();
            CreatDataGroup();
            CreatDataSouceGroup();
            CreatAOITemplateGroup();
            CreateBackgroundLayersGroup();
        }
Esempio n. 9
0
        void radButtonElement_Click(object sender, EventArgs e)
        {
            RadButtonElement      radButtonElement      = sender as RadButtonElement;
            EditAppointmentDialog editAppointmentDialog = new EditAppointmentDialog((IEvent)radButtonElement.Tag, this.radSchedulerDemo);

            editAppointmentDialog.ShowDialog(this);
        }
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.btnEdit                   = new RadButtonElement();
            this.btnEdit.Image             = global::PCBQuotes.Properties.Resources.Edit_18px;
            this.btnEdit.Text              = "编辑";
            this.btnEdit.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.btnEdit.Padding           = new Padding {
                Left = 10, Right = 10, Top = 5, Bottom = 5
            };


            this.btnDelete                   = new RadButtonElement();
            this.btnDelete.Image             = global::PCBQuotes.Properties.Resources.Delete_18px;
            this.btnDelete.Text              = "删除";
            this.btnDelete.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.btnDelete.Padding           = new Padding {
                Left = 10, Right = 10, Top = 5, Bottom = 5
            };


            this.Children.Add(btnEdit);
            this.Children.Add(btnDelete);
        }
Esempio n. 11
0
        public void setStatus()
        {
            RadLabelElement labelElement = new RadLabelElement();

            labelElement.Text = C.vUserName + "@" + C.vProfileName + "      Sucursal:" + C.vSucursalName;

            RadLabelElement labelElement2 = new RadLabelElement();

            labelElement2.Font = new Font("Cambria", 16);
            labelElement2.Text = C.vCompanyName;

            RadButtonElement buttonElement = new RadButtonElement();

            buttonElement.Text       = "My ButtonElement";
            buttonElement.Visibility = ElementVisibility.Hidden;
            //buttonElement.Click += new EventHandler(buttonElement_Click);
            RadRepeatButtonElement repeatButtonElement = new RadRepeatButtonElement();

            repeatButtonElement.Text       = "My Repeat button";
            repeatButtonElement.Visibility = ElementVisibility.Hidden;
            // repeatButtonElement.Click += new EventHandler(repeatButtonElement_Click);
            CommandBarSeparator   separator          = new CommandBarSeparator();
            RadProgressBarElement progressBarElement = new RadProgressBarElement();

            progressBarElement.Text       = "My Progress Bar";
            progressBarElement.Visibility = ElementVisibility.Hidden;
            radStatusStrip1.Items.AddRange(new RadItem[] { labelElement, buttonElement, repeatButtonElement, separator, progressBarElement, labelElement2 });
        }
Esempio n. 12
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            buttonElement       = new RadButtonElement();
            buttonElement.Class = "RibbonBarButtonElement";
            buttonElement.ButtonFillElement.Class = "ButtonInRibbonFill";
            buttonElement.BorderElement.Class     = "ButtonInRibbonBorder";
            buttonElement.Margin = new System.Windows.Forms.Padding(0, 10, 10, 0);
            buttonElement.Click += new EventHandler(buttonElement_Click);
            this.Children.Add(buttonElement);

            lve                     = new LightVisualElement();
            lve.BackColor           = Color.Red;
            lve.DrawFill            = true;
            lve.StretchHorizontally = false;
            lve.StretchVertically   = false;
            lve.GradientStyle       = Telerik.WinControls.GradientStyles.Solid;
            lve.Shape               = new RoundRectShape(sizeConst / 2);
            lve.SmoothingMode       = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            lve.ForeColor           = Color.White;
            lve.MinSize             = new Size(sizeConst, sizeConst);
            lve.Visibility          = ElementVisibility.Collapsed;
            this.Children.Add(lve);
        }
 protected override void CreateChildElements()
 {
     textBox = new RadTextBoxItem();
     textBox.RouteMessages = false;
     button         = new RadButtonElement("...");
     button.Padding = new Padding(2, 0, 2, 0);
     this.Children.Add(textBox);
     this.Children.Add(button);
 }
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.clearButtonElement        = new RadButtonElement();
            this.clearButtonElement.Image  = Image.FromFile(@"..\..\cross16x16.png");
            this.clearButtonElement.Click += ClearButtonElement_Click;
            this.clearButtonElement.NotifyParentOnMouseInput = false;
            this.Children.Add(this.clearButtonElement);
        }
Esempio n. 15
0
        private void radMenuItem1_Click_1(object sender, EventArgs e)
        {
            RadButtonElement button = new RadButtonElement();

            button.Text    = "button";
            button.MinSize = new System.Drawing.Size(button.MinSize.Width, 24);
            surface1.Element.Children.Add(new SurfaceObject(10, 10, button));
            radButtonRemove.Enabled        = true;
            surface1.Element.CurrentObject = (SurfaceObject)surface1.Element.Children[surface1.Element.Children.Count - 1];
        }
Esempio n. 16
0
 protected override void CreateChildElements()
 {
     base.CreateChildElements();
     pinImage                              = new RadButtonElement();
     pinImage.Alignment                    = ContentAlignment.MiddleCenter;
     pinImage.ImageAlignment               = ContentAlignment.MiddleCenter;
     pinImage.BorderElement.Visibility     = Telerik.WinControls.ElementVisibility.Collapsed;
     pinImage.ButtonFillElement.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
     pinImage.RadPropertyChanged          += new Telerik.WinControls.RadPropertyChangedEventHandler(pinImage_RadPropertyChanged);
     this.Children.Add(pinImage);
 }
Esempio n. 17
0
 private void rcSubCategorias_ItemDataBound(object sender, ItemDataBoundEventArgs e)
 {
     if (e.DataBoundItem is RadButtonElement)
     {
         RadButtonElement button = (e.DataBoundItem as RadButtonElement);
         button.Text   = (e.DataItem as SubCategoriasFeatures).Name;
         button.Tag    = (e.DataItem as SubCategoriasFeatures).ID;
         button.Font   = new Font("Arial", 15);
         button.Click += new EventHandler(SubCategoriasCarouselDataBinding_Click);
     }
 }
Esempio n. 18
0
 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (e.Column.Name == "CustomColumn")
     {
         RadButtonElement radButtonElement = new RadButtonElement();
         radButtonElement.Font   = font;
         radButtonElement.Text   = "...";
         radButtonElement.Click += new EventHandler(radButtonElement_Click);
         this.radGridView1.CurrentCell.Children.Add(radButtonElement);
     }
 }
Esempio n. 19
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parent"></param>
        protected override void CreateChildItems(RadElement parent)
        {
            base.CreateChildItems(parent);

            this.documentButtonsLayout       = new DockLayoutPanel();
            this.documentButtonsLayout.Class = "documentButtonsLayout";
            this.documentButtonsLayout.StretchHorizontally = false;
            this.documentButtonsLayout.StretchVertically   = false;
            this.documentButtonsLayout.Alignment           = ContentAlignment.TopRight;
            this.documentButtonsLayout.ZIndex = 10;
            this.documentButtonsLayout.Margin = new Padding(0, 2, 0, 0);

            //window.Children.Add(documentButtonsLayout);
            this.splitPanelElement.Children.Add(documentButtonsLayout);
            this.tabStripElement.ContentArea.Visibility = ElementVisibility.Visible;

            this.closeButton       = new RadButtonElement();
            this.closeButton.Class = "CloseButton";
            this.closeButton.ButtonFillElement.Class = "CloseButtonFill";
            this.closeButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(0, 0, 2, 0));
            this.closeButton.ClickMode           = ClickMode.Release;
            this.closeButton.Click              += new EventHandler(closeButton_Click);
            this.closeButton.ZIndex              = 5;
            this.closeButton.StretchHorizontally = false;
            this.closeButton.StretchVertically   = false;

            DockLayoutPanel.SetDock(closeButton, Telerik.WinControls.Layouts.Dock.Right);
            this.documentButtonsLayout.Children.Add(closeButton);

            this.overflowMenuButton = new OverflowDropDownButtonElement();
            this.overflowMenuButton.SetDefaultValueOverride(RadElement.MarginProperty, new System.Windows.Forms.Padding(0, 0, 2, 0));
            this.overflowMenuButton.ImageAlignment                       = System.Drawing.ContentAlignment.MiddleRight;
            this.overflowMenuButton.ShowArrow                            = false;
            this.overflowMenuButton.Class                                = "OverflowDropDownButton";
            this.overflowMenuButton.DisplayStyle                         = DisplayStyle.Image;
            this.overflowMenuButton.BorderElement.Visibility             = ElementVisibility.Collapsed;
            this.overflowMenuButton.ActionButton.Class                   = "OverflowDropDownActionButton";
            this.overflowMenuButton.ActionButton.ButtonFillElement.Class = "OverflowDropDownButtonFill";
            this.overflowMenuButton.StretchHorizontally                  = false;
            this.overflowMenuButton.StretchVertically                    = false;
            this.overflowMenuButton.MouseDown                           += new System.Windows.Forms.MouseEventHandler(activeDocumentsMenuDropDownButton_MouseDown);
            this.overflowMenuButton.ZIndex                               = 10;
            DockLayoutPanel.SetDock(overflowMenuButton, Telerik.WinControls.Layouts.Dock.Right);
            this.documentButtonsLayout.Children.Add(this.overflowMenuButton);

            this.tabStripElement.Alignment      = ContentAlignment.TopLeft;
            this.tabStripElement.StripAlignment = StripViewAlignment.Top;
            this.tabStripElement.AllowDrag      = true;
            this.splitPanelElement.Visibility   = ElementVisibility.Hidden;

            this.tabStripElement.ItemContainer.BringToFront();

            this.SetToolTips();
        }
Esempio n. 20
0
        public CustomEditorElement()
        {
            closeButton = new RadButtonElement("Close");
            closeButton.SetValue(DockLayoutPanel.DockProperty, Dock.Bottom);
            closeButton.Click += new EventHandler(closeButton_Click);
            this.Popup.SizingGripDockLayout.Children.Insert(1, closeButton);
            this.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;

            this.PopupClosing                += new RadPopupClosingEventHandler(CustomEditorElement_PopupClosing);
            this.CreatingVisualItem          += new CreatingVisualListItemEventHandler(CustomEditorElement_CreatingVisualItem);
            this.ListElement.ItemDataBinding += this.CustomEditorElement_ItemDataBinding;
        }
Esempio n. 21
0
        protected override void CreateChildElements()
        {
            textBox_Renamed        = new RadTextBoxItem();
            textBox_Renamed.Margin = new Padding(2);

            textBox_Renamed.RouteMessages = false;
            button_Renamed         = new RadButtonElement("...");
            button_Renamed.Padding = new Padding(2, 0, 2, 0);

            this.Children.Add(textBox_Renamed);
            this.Children.Add(button_Renamed);
        }
Esempio n. 22
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            this.button        = new RadButtonElement();
            this.button.Text   = "...";
            this.button.Click += new EventHandler(button_Click);
            this.button.StretchHorizontally = false;
            this.button.Margin    = new Padding(0, 2, 0, 2);
            this.button.Alignment = System.Drawing.ContentAlignment.MiddleRight;

            this.ValueElement.Children.Add(this.button);
        }
Esempio n. 23
0
        private void grdAtivos_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            if (e.CellElement.ColumnIndex != 0)
            {
                return;
            }

            RadButtonElement element = (RadButtonElement)e.CellElement.Children[0];

            element.DisplayStyle   = DisplayStyle.Image;
            element.Image          = Resources.delete;
            element.ImageAlignment = ContentAlignment.MiddleCenter;
        }
Esempio n. 24
0
        private void CreatComputGroup()
        {
            RadRibbonBarGroup computGroup = new RadRibbonBarGroup();

            computGroup.Text = "特征信息提取";
            _btnVisibility   = new RadButtonElement("能见度计算");
            _btnVisibility.ImageAlignment    = ContentAlignment.TopCenter;
            _btnVisibility.TextAlignment     = ContentAlignment.BottomCenter;
            _btnVisibility.TextImageRelation = TextImageRelation.ImageAboveText;
            _btnVisibility.Click            += new EventHandler(_btnVisibility_Click);
            computGroup.Items.Add(_btnVisibility);
            _tab.Items.Add(computGroup);
        }
Esempio n. 25
0
        private void CreatClose()
        {
            RadRibbonBarGroup close = new RadRibbonBarGroup();

            close.Text = "关闭";
            _btnClose  = new RadButtonElement("关闭沙尘监测\n分析视图");
            _btnClose.TextAlignment     = ContentAlignment.MiddleCenter;
            _btnClose.ImageAlignment    = ContentAlignment.TopCenter;
            _btnClose.TextImageRelation = TextImageRelation.ImageAboveText;
            _btnClose.Click            += new EventHandler(_btnClose_Click);
            close.Items.Add(_btnClose);
            _tab.Items.Add(close);
        }
Esempio n. 26
0
        private void CreateRibbonTab()
        {
            _bar      = new RadRibbonBar();
            _bar.Dock = DockStyle.Top;
            _tab      = new RibbonTab();
            _tab.Text = "脚本开发";
            _bar.CommandTabs.Add(_tab);
            //
            RadRibbonBarGroup g = new RadRibbonBarGroup();

            g.Text = "脚本管理";
            _tab.Items.Add(g);
            RadButtonElement btn;

            btn        = new RadButtonElement("打开工作区");
            btn.Click += new EventHandler(btn_Click);
            btn.Tag    = 20001;
            button_items.Add("打开工作区", btn);
            g.Items.Add(btn);
            btn        = new RadButtonElement("新建脚本");
            btn.Click += new EventHandler(btn_Click);
            button_items.Add("新建脚本", btn);
            g.Items.Add(btn);
            btn        = new RadButtonElement("删除文件");
            btn.Click += new EventHandler(btn_Click);
            button_items.Add("删除脚本", btn);
            g.Items.Add(btn);
            btn        = new RadButtonElement("关闭工作区");
            btn.Click += new EventHandler(btn_Click);
            button_items.Add("关闭工作区", btn);
            g.Items.Add(btn);
            btn        = new RadButtonElement("保存");
            btn.Click += new EventHandler(btn_Click);
            button_items.Add("保存", btn);
            g.Items.Add(btn);
            g      = new RadRibbonBarGroup();
            g.Text = "运行脚本";
            _tab.Items.Add(g);
            btn        = new RadButtonElement("运行");
            btn.Click += new EventHandler(btn_Click);
            button_items.Add("运行", btn);
            g.Items.Add(btn);
            //btn = new RadButtonElement("暂停");
            //btn.Click += new EventHandler(btn_Click);
            //button_items.Add("暂停", btn);
            //g.Items.Add(btn);
            //btn = new RadButtonElement("停止");
            //btn.Click += new EventHandler(btn_Click);
            //button_items.Add("停止", btn);
            //g.Items.Add(btn);
        }
Esempio n. 27
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            RadButtonElement button = new RadButtonElement();

            button.Text    = "button";
            button.MinSize = new System.Drawing.Size(button.MinSize.Width, 24);
            surface1.Element.Children.Add(new SurfaceObject(65, 154, button));
            surface1.Element.CurrentObjectChanged += new EventHandler(Element_CurrentObjectChanged);
            surface1.Element.CurrentObject         = (SurfaceObject)surface1.Element.Children[0];

            radButtonRemove.Enabled = false;
        }
Esempio n. 28
0
    protected override void CreateChildElements()
    {
        base.CreateChildElements();
        RadButtonElement button = new RadButtonElement()
        {
            Text = "Click me!", AutoSize = true, TextAlignment = ContentAlignment.MiddleRight
        };

        this.InformationTipPanel.Children.First().Visibility = ElementVisibility.Collapsed;
        this.InformationTipPanel.Children.Add(button);
        button.ButtonFillElement.BackColor     = System.Drawing.Color.Red;
        button.ButtonFillElement.GradientStyle = GradientStyles.Solid;
        button.Click += button_Click;
    }
Esempio n. 29
0
        private void CreatDataSouceGroup()
        {
            _addDatasource                   = new RadButtonElement();
            _addDatasource.Text              = "添加数据源";
            _addDatasource.ImageAlignment    = ContentAlignment.TopCenter;
            _addDatasource.TextAlignment     = ContentAlignment.MiddleCenter;
            _addDatasource.TextImageRelation = TextImageRelation.ImageAboveText;
            RadRibbonBarGroup group6 = new RadRibbonBarGroup();

            group6.Text = "更多数据源";
            group6.Items.AddRange(new RadItem[] { _addDatasource });

            //_tab.Items.Add(group6);
        }
Esempio n. 30
0
        public void setFavorites(DataTable Datos)
        {
            ((RibbonTab)radRibbonBar1.CommandTabs[0]).Items.Clear();

            int item2 = -1;
            int item3 = -1;

            RadRibbonBarGroup[] radRibbonBarGroup = new RadRibbonBarGroup[40];
            RadButtonElement[]  radButtonElement  = new RadButtonElement[50];

            item2++;
            radRibbonBarGroup[item2]         = new RadRibbonBarGroup();
            radRibbonBarGroup[item2].Text    = "Mis Items Favoritos";
            radRibbonBarGroup[item2].MinSize = new Size(300, 300);
            ((RibbonTab)radRibbonBar1.CommandTabs[0]).Items.Add(radRibbonBarGroup[item2]);

            item3++;
            radButtonElement[item3]                = new RadButtonElement();
            radButtonElement[item3].Text           = "Favoritos";
            radButtonElement[item3].TextAlignment  = ContentAlignment.BottomCenter;
            radButtonElement[item3].TextWrap       = true;
            radButtonElement[item3].Tag            = "Favoritos";
            radButtonElement[item3].ImageIndex     = 13;
            radButtonElement[item3].ImageAlignment = ContentAlignment.MiddleCenter;
            radButtonElement[item3].Size           = new Size(100, 80);
            radButtonElement[item3].AutoSize       = false;
            radButtonElement[item3].Click         += ClickRibbonbar;
            radRibbonBarGroup[item2].Items.Add(radButtonElement[item3]);

            DataTable dtfavorites = dtfavorites = C.SQL("MISFAVORITOS_L " + C.vUserID);

            foreach (DataRow vRow in dtfavorites.Rows)
            {
                if (vRow["Access"].ToString() == "1")
                {
                    item3++;
                    radButtonElement[item3]                = new RadButtonElement();
                    radButtonElement[item3].Text           = vRow["Detalle"].ToString();
                    radButtonElement[item3].TextAlignment  = ContentAlignment.BottomCenter;
                    radButtonElement[item3].TextWrap       = true;
                    radButtonElement[item3].Tag            = ((string)vRow["FormName"]);
                    radButtonElement[item3].ImageIndex     = ((int)vRow["ImageID"]);
                    radButtonElement[item3].ImageAlignment = ContentAlignment.MiddleCenter;
                    radButtonElement[item3].Size           = new Size(100, 80);
                    radButtonElement[item3].AutoSize       = false;
                    radButtonElement[item3].Click         += ClickRibbonbar;
                    radRibbonBarGroup[item2].Items.Add(radButtonElement[item3]);
                }
            }
        }
Esempio n. 31
0
File: Dead.cs Progetto: Vla00/alone
 private void radGridView2_CellFormatting(object sender, CellFormattingEventArgs e)
 {
     if (e.CellElement.ColumnInfo is GridViewCommandColumn)
     {
         RadButtonElement button = (RadButtonElement)e.CellElement.Children[0];
         if (e.CellElement.BackColor == Color.Red)
         {
             button.Enabled = true;
         }
         else
         {
             button.Enabled = false;
         }
     }
 }
Esempio n. 32
0
        public void NewChat(string jabberID, bool setFocus)
        {

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChatWindow));

            if (myChatSessions.List[jabberID] == null)
            {
                ChatSession tmplChatSession = new ChatSession();
                this.tmplChatTab = new Telerik.WinControls.UI.TabItem();
                this.tmplChatTabSplitter = new System.Windows.Forms.SplitContainer();
                this.tmplChatTabConversation = new System.Windows.Forms.WebBrowser();
                this.tmplChatTabMessage = new System.Windows.Forms.TextBox();
                this.tmplChatTab.ContentPanel.SuspendLayout();
                this.tmplChatTabSplitter.Panel1.SuspendLayout();
                this.tmplChatTabSplitter.Panel2.SuspendLayout();
                this.tmplChatTabSplitter.SuspendLayout();
                this.myChatSessionsTabControl.Items.AddRange(new Telerik.WinControls.RadItem[] { this.tmplChatTab });
                //
                // tmplChatTab
                this.tmplChatTab.AccessibleDescription = "";
                this.tmplChatTab.CanFocus = true;
                this.tmplChatTab.Class = "TabItem";
                this.tmplChatTab.Tag = jabberID;
                this.tmplChatTab.ImageIndex = 0;
                this.tmplChatTab.TextImageRelation = TextImageRelation.ImageBeforeText;
                //
                // tmplChatTab.ContentPanel
                //
                this.tmplChatTab.ContentPanel.BackColor = System.Drawing.Color.Transparent;
                this.tmplChatTab.ContentPanel.Controls.Add(this.tmplChatTabSplitter);
                this.tmplChatTab.ContentPanel.Font = new System.Drawing.Font("Trebuchet MS", 9F, System.Drawing.FontStyle.Regular);
                this.tmplChatTab.ContentPanel.Location = new System.Drawing.Point(1, 22);
                this.tmplChatTab.ContentPanel.Name = "ContentPanel";
                this.tmplChatTab.ContentPanel.Size = new System.Drawing.Size(490, 241);
                this.tmplChatTab.ContentPanel.Dock = DockStyle.Fill;
                this.tmplChatTab.ContentPanel.TabIndex = 0;
                this.tmplChatTab.Text = jabberID;
                this.tmplChatTab.ToolTipText = null;
                //
                // tmplChatTabSplitter
                //
                this.tmplChatTabSplitter.Dock = System.Windows.Forms.DockStyle.Fill;
                this.tmplChatTabSplitter.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
                this.tmplChatTabSplitter.Location = new System.Drawing.Point(0, 0);
                this.tmplChatTabSplitter.Name = "tmplChatTabSplitter";
                this.tmplChatTabSplitter.Orientation = System.Windows.Forms.Orientation.Horizontal;
                //
                // tmplChatTabSplitter.Panel1
                //
                this.tmplChatTabSplitter.Panel1.Controls.Add(this.tmplChatTabConversation);
                //
                // tmplChatTabSplitter.Panel2
                //
                this.tmplChatTabSplitter.Panel2.Controls.Add(this.tmplChatTabMessage);
                this.tmplChatTabSplitter.Size = new System.Drawing.Size(459, 264);
                this.tmplChatTabSplitter.SplitterDistance = 153;
                this.tmplChatTabSplitter.TabIndex = 0;
                //
                // tmplChatTabConversation
                //
                this.tmplChatTabConversation.AllowNavigation = false;
                this.tmplChatTabConversation.AllowWebBrowserDrop = false;
                this.tmplChatTabConversation.Dock = System.Windows.Forms.DockStyle.Fill;
                this.tmplChatTabConversation.IsWebBrowserContextMenuEnabled = false;
                this.tmplChatTabConversation.Location = new System.Drawing.Point(0, 0);
                this.tmplChatTabConversation.MinimumSize = new System.Drawing.Size(20, 20);
                this.tmplChatTabConversation.Name = "tmplChatTabConversation";
                this.tmplChatTabConversation.ScriptErrorsSuppressed = true;
                this.tmplChatTabConversation.Size = new System.Drawing.Size(459, 153);
                this.tmplChatTabConversation.TabIndex = 0;
                this.tmplChatTabConversation.WebBrowserShortcutsEnabled = false;
                this.tmplChatTabConversation.DocumentText = "<HTML><BODY></BODY></HTML>";

                //ToolStrip Buttons
                this.tmplChatWindowToolStrip = new System.Windows.Forms.ToolStrip();
                this.tmplChangeFontToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplChangeColorToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonSeparatorToolStripButton = new System.Windows.Forms.ToolStripSeparator();
                this.tmplEmoticonSmileToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonGrinToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonEvilGrinToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonWinkToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonHappyToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonSurprisedToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonToungeToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonUnhappyToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplEmoticonWaiiToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplToolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
                this.tmplSendMessageToolStripButton = new System.Windows.Forms.ToolStripButton();

                this.tmplVideoCallToolStripButton = new System.Windows.Forms.ToolStripButton();
                this.tmplVoiceCallToolStripButton = new System.Windows.Forms.ToolStripButton();





                this.tmplChatWindowToolStrip.SuspendLayout();

                this.tmplChatTabSplitter.Panel2.Controls.Add(this.tmplChatWindowToolStrip);

                // 
                // tmplChatWindowToolStrip
                // 
                this.tmplChatWindowToolStrip.AllowItemReorder = true;
                this.tmplChatWindowToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
                this.tmplChatWindowToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tmplChangeFontToolStripButton,
            this.tmplChangeColorToolStripButton,
            this.tmplEmoticonSeparatorToolStripButton,
            this.tmplEmoticonSmileToolStripButton,
            this.tmplEmoticonGrinToolStripButton,
            this.tmplEmoticonEvilGrinToolStripButton,
            this.tmplEmoticonWinkToolStripButton,
            this.tmplEmoticonHappyToolStripButton,
            this.tmplEmoticonSurprisedToolStripButton,
            this.tmplEmoticonToungeToolStripButton,
            this.tmplEmoticonUnhappyToolStripButton,
            this.tmplEmoticonWaiiToolStripButton,
                       this.tmplVideoCallToolStripButton,
                this.tmplVoiceCallToolStripButton,
                 this.tmplSendMessageToolStripButton,
                 this.tmplToolStripSeparator
                 });
                this.tmplChatWindowToolStrip.Location = new System.Drawing.Point(0, 0);
                this.tmplChatWindowToolStrip.Name = "tmplChatWindowToolStrip";
                this.tmplChatWindowToolStrip.Size = new System.Drawing.Size(490, 25);
                this.tmplChatWindowToolStrip.TabIndex = 0;
                this.tmplChatWindowToolStrip.Text = "";
                // 
                // tmplChangeFontToolStripButton
                // 
                this.tmplChangeFontToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplChangeFontToolStripButton.Image = myMessageMenuImagesList.Images[0];
                this.tmplChangeFontToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplChangeFontToolStripButton.Name = "tmplChangeFontToolStripButton";
                this.tmplChangeFontToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplChangeFontToolStripButton.Text = "";
                this.tmplChangeFontToolStripButton.Click += new EventHandler(tmplChangeFontToolStripButton_Click);
                // 
                // tmplChangeColorToolStripButton
                // 
                this.tmplChangeColorToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplChangeColorToolStripButton.Image = myMessageMenuImagesList.Images[1];
                this.tmplChangeColorToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplChangeColorToolStripButton.Name = "tmplChangeColorToolStripButton";
                this.tmplChangeColorToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplChangeColorToolStripButton.Text = "";
                this.tmplChangeColorToolStripButton.Click += new EventHandler(tmplChangeColorToolStripButton_Click);
                // 
                // tmplEmoticonSeparatorToolStripButton
                // 
                this.tmplEmoticonSeparatorToolStripButton.Name = "tmplEmoticonSeparatorToolStripButton";
                this.tmplEmoticonSeparatorToolStripButton.Size = new System.Drawing.Size(6, 25);
                // 
                // tmplEmoticonSmileToolStripButton
                // 
                this.tmplEmoticonSmileToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonSmileToolStripButton.Image = myMessageMenuImagesList.Images[2];
                this.tmplEmoticonSmileToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonSmileToolStripButton.Name = "tmplEmoticonSmileToolStripButton";
                this.tmplEmoticonSmileToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonSmileToolStripButton.ToolTipText = "smile";
                this.tmplEmoticonSmileToolStripButton.Click += new EventHandler(tmplEmoticonSmileToolStripButton_Click);
                // 
                // tmplEmoticonEvilGrinToolStripButton
                // 
                this.tmplEmoticonEvilGrinToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonEvilGrinToolStripButton.Image = myMessageMenuImagesList.Images[4];
                this.tmplEmoticonEvilGrinToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonEvilGrinToolStripButton.Name = "tmplEmoticonEvilGrinToolStripButton";
                this.tmplEmoticonEvilGrinToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonEvilGrinToolStripButton.ToolTipText = "evilgrin";
                this.tmplEmoticonEvilGrinToolStripButton.Click += new EventHandler(tmplEmoticonEvilGrinToolStripButton_Click);
                // 
                // tmplEmoticonGrinToolStripButton
                // 
                this.tmplEmoticonGrinToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonGrinToolStripButton.Image = myMessageMenuImagesList.Images[3];
                this.tmplEmoticonGrinToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonGrinToolStripButton.Name = "tmplEmoticonGrinToolStripButton";
                this.tmplEmoticonGrinToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonGrinToolStripButton.ToolTipText = "grin";
                this.tmplEmoticonGrinToolStripButton.Click += new EventHandler(tmplEmoticonGrinToolStripButton_Click);
                // 
                // tmplEmoticonHappyToolStripButton
                // 
                this.tmplEmoticonHappyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonHappyToolStripButton.Image = myMessageMenuImagesList.Images[6];
                this.tmplEmoticonHappyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonHappyToolStripButton.Name = "tmplEmoticonHappyToolStripButton";
                this.tmplEmoticonHappyToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonHappyToolStripButton.ToolTipText = "happy";
                this.tmplEmoticonHappyToolStripButton.Click += new EventHandler(tmplEmoticonHappyToolStripButton_Click);
                // 
                // tmplEmoticonSurprisedToolStripButton
                // 
                this.tmplEmoticonSurprisedToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonSurprisedToolStripButton.Image = myMessageMenuImagesList.Images[7];
                this.tmplEmoticonSurprisedToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonSurprisedToolStripButton.Name = "tmplEmoticonSurprisedToolStripButton";
                this.tmplEmoticonSurprisedToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonSurprisedToolStripButton.ToolTipText = "surprised";
                this.tmplEmoticonSurprisedToolStripButton.Click += new EventHandler(tmplEmoticonSurprisedToolStripButton_Click);
                // 
                // tmplEmoticonToungeToolStripButton
                // 
                this.tmplEmoticonToungeToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonToungeToolStripButton.Image = myMessageMenuImagesList.Images[8];
                this.tmplEmoticonToungeToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonToungeToolStripButton.Name = "tmplEmoticonToungeToolStripButton";
                this.tmplEmoticonToungeToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonToungeToolStripButton.Text = "tongue";
                this.tmplEmoticonToungeToolStripButton.Click += new EventHandler(tmplEmoticonToungeToolStripButton_Click);
                // 
                // tmplEmoticonUnhappyToolStripButton
                // 
                this.tmplEmoticonUnhappyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonUnhappyToolStripButton.Image = myMessageMenuImagesList.Images[9];
                this.tmplEmoticonUnhappyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonUnhappyToolStripButton.Name = "tmplEmoticonUnhappyToolStripButton";
                this.tmplEmoticonUnhappyToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonUnhappyToolStripButton.ToolTipText = "unhappy";
                this.tmplEmoticonUnhappyToolStripButton.Click += new EventHandler(tmplEmoticonUnhappyToolStripButton_Click);
                // 
                // tmplEmoticonWaiiToolStripButton
                // 
                this.tmplEmoticonWaiiToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonWaiiToolStripButton.Image = myMessageMenuImagesList.Images[10];
                this.tmplEmoticonWaiiToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonWaiiToolStripButton.Name = "tmplEmoticonWaiiToolStripButton";
                this.tmplEmoticonWaiiToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonWaiiToolStripButton.ToolTipText = "waii";
                this.tmplEmoticonWaiiToolStripButton.Click += new EventHandler(tmplEmoticonWaiiToolStripButton_Click);
                // 
                // tmplEmoticonWinkToolStripButton
                // 
                this.tmplEmoticonWinkToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.tmplEmoticonWinkToolStripButton.Image = myMessageMenuImagesList.Images[5];
                this.tmplEmoticonWinkToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplEmoticonWinkToolStripButton.Name = "tmplEmoticonWinkToolStripButton";
                this.tmplEmoticonWinkToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplEmoticonWinkToolStripButton.ToolTipText = "wink";
                this.tmplEmoticonWinkToolStripButton.Click += new EventHandler(tmplEmoticonWinkToolStripButton_Click);
                // 
                // tmplToolStripSeparator
                // 
                this.tmplToolStripSeparator.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
                this.tmplToolStripSeparator.Name = "tmplToolStripSeparator";
                this.tmplToolStripSeparator.Size = new System.Drawing.Size(6, 25);
                // 
                // tmplSendMessageToolStripButton
                // 
                this.tmplSendMessageToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
                this.tmplSendMessageToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
                this.tmplSendMessageToolStripButton.Image = myMessageMenuImagesList.Images[11];
                this.tmplSendMessageToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplSendMessageToolStripButton.Name = "tmplSendMessageToolStripButton";
                this.tmplSendMessageToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplSendMessageToolStripButton.ToolTipText = "Send message";
                this.tmplSendMessageToolStripButton.Text = "Send";
                this.tmplSendMessageToolStripButton.Click += new EventHandler(tmplSendMessageToolStripButton_Click);
                // 
                // tmplVoiceCallToolStripButton
                // 
                this.tmplVoiceCallToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
                this.tmplVoiceCallToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
                this.tmplVoiceCallToolStripButton.Image = myMessageMenuImagesList.Images[12];
                this.tmplVoiceCallToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplVoiceCallToolStripButton.Name = "tmplVoiceCallToolStripButton";
                this.tmplVoiceCallToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplVoiceCallToolStripButton.ToolTipText = "Start a PC to PC call";
                this.tmplVoiceCallToolStripButton.Text = "Call";
                this.tmplVoiceCallToolStripButton.Click += new EventHandler(tmplVoiceCallToolStripButton_Click);
                // 
                // tmplVideoCallToolStripButton
                // 
                this.tmplVideoCallToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText;
                this.tmplVideoCallToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
                this.tmplVideoCallToolStripButton.Image = myMessageMenuImagesList.Images[13];
                this.tmplVideoCallToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
                this.tmplVideoCallToolStripButton.Name = "tmplVideoCallToolStripButton";
                this.tmplVideoCallToolStripButton.Size = new System.Drawing.Size(23, 22);
                this.tmplVideoCallToolStripButton.ToolTipText = "Start video call";
                this.tmplVideoCallToolStripButton.Text = "Video";
                this.tmplVideoCallToolStripButton.Click += new EventHandler(tmplVideoCallToolStripButton_Click);
                //
                // tmplChatTabMessage
                //
                this.tmplChatTabMessage.Dock = System.Windows.Forms.DockStyle.Fill;
                this.tmplChatTabMessage.Location = new System.Drawing.Point(0, 25);
                this.tmplChatTabMessage.Multiline = true;
                this.tmplChatTabMessage.Name = "tmplChatTabMessage";
                this.tmplChatTabMessage.Size = new System.Drawing.Size(354, 82);
                this.tmplChatTabMessage.TabIndex = 0;
                this.tmplChatTabMessage.KeyUp += new KeyEventHandler(tmplChatTabMessage_KeyUp);

                this.tmplChatTab.ContentPanel.ResumeLayout(false);
                this.tmplChatTabSplitter.Panel1.ResumeLayout(false);
                this.tmplChatTabSplitter.Panel2.ResumeLayout(false);
                this.tmplChatTabSplitter.ResumeLayout(false);
                this.tmplChatWindowToolStrip.ResumeLayout(false);
                this.tmplChatWindowToolStrip.PerformLayout();
                this.myChatSessionsTabControl.SelectedTab = this.tmplChatTab;

                RadButtonElement tmplCloseButton = new RadButtonElement("x");
                tmplCloseButton.ToolTipText = "Close Tab";
                tmplCloseButton.Click += new EventHandler(tmplCloseButton_Click);

                tmplCloseButton.Alignment = ContentAlignment.TopRight;
                // Let's say that you want to place the close button in "tabItem1"                
                tmplChatTab.Children[2].Margin = new Padding(0, 0, 15, 0);
                tmplChatTab.Children.Add(tmplCloseButton);

                tmplChatSession.ChatTab = tmplChatTab;
                tmplChatSession.ChatTabConversation = tmplChatTabConversation;
                tmplChatSession.ChatTabMessage = tmplChatTabMessage;
                tmplChatSession.JabberID = jabberID;


                myChatSessions.List.Add(jabberID, tmplChatSession);
            }
            else
            {
                ChatSession tmplChatSession = (ChatSession)myChatSessions.List[jabberID];
                tmplChatSession.ChatTab.Visibility = ElementVisibility.Visible;

            }
            try
            {

           
            
            if (myClientForm.myUserAccount.LoggedIn())
            {
                this.Update();
                this.Show();
                UpdatePresence(jabberID,(int)myClientForm.myBuddyPresence[jabberID]);
            }
        }
            catch (Exception)
            {
                
             //   throw;
                ;
            }


        }
Esempio n. 33
0
        public void NewChat(JabberUser jabberUser, bool setFocus)
        {
            int presenceStatus = 0;
            if (myClientForm.myBuddyPresence.Contains(jabberUser.JID)) presenceStatus = (int)myClientForm.myBuddyPresence[jabberUser.JID];

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChatWindow));

            if (myChatSessions[jabberUser.JID] == null)
            {
                ChatSession tmplChatSession = new ChatSession();
                ChatBox tmplChatBox = new ChatBox();
                tmplChatBox.JID = jabberUser.JID;
                tmplChatBox.ResetHTML();

                tmplChatSession.LastStatus = presenceStatus;
                tmplChatBox.wbConversation.GotFocus += new EventHandler(wbConversation_GotFocus);

                this.tmplChatTab = new Telerik.WinControls.UI.TabItem();

                //
                // tmplChatTab
                this.tmplChatTab.AccessibleDescription = "";
                this.tmplChatTab.CanFocus = true;
                this.tmplChatTab.Class = "TabItem";
                this.tmplChatTab.Tag = jabberUser.JID;
                this.tmplChatTab.ImageIndex = presenceStatus;
                this.tmplChatTab.TextImageRelation = TextImageRelation.ImageBeforeText;
                //
                // tmplChatTab.ContentPanel
                //
                this.tmplChatTab.ContentPanel.BackColor = System.Drawing.Color.Transparent;
                this.tmplChatTab.ContentPanel.Font = new System.Drawing.Font("Trebuchet MS", 9F, System.Drawing.FontStyle.Regular);
                this.tmplChatTab.ContentPanel.Location = new System.Drawing.Point(1, 22);
                this.tmplChatTab.ContentPanel.Name = "ContentPanel";
                this.tmplChatTab.ContentPanel.Size = new System.Drawing.Size(490, 241);
                this.tmplChatTab.ContentPanel.Dock = DockStyle.Fill;
                this.tmplChatTab.ContentPanel.TabIndex = 0;
                this.tmplChatTab.Text = jabberUser.Nick;
                this.tmplChatTab.ToolTipText = null;

                this.myChatSessionsTabControl.Items.AddRange(new Telerik.WinControls.RadItem[] { this.tmplChatTab });
                this.tmplChatTab.ContentPanel.BackgroundImage = null;
                this.tmplChatTab.ContentPanel.BackColor = Color.White;
                this.tmplChatTab.ContentPanel.Controls.Add(tmplChatBox);
                tmplChatBox.Dock = DockStyle.Fill;
                this.tmplChatTab.ContentPanel.Invalidate();

                //wire up all events

                tmplChatBox.toolStripCallUser.Click += new EventHandler(tmplVoiceCallToolStripButton_Click); ;
                tmplChatBox.toolStripColor.Click += new EventHandler(tmplChangeColorToolStripButton_Click); ;
                tmplChatBox.toolStripEmotSmile.Click += new EventHandler(tmplEmoticonSmileToolStripButton_Click); ;
                tmplChatBox.toolStripEvilgrin.Click += new EventHandler(tmplEmoticonEvilGrinToolStripButton_Click); ;
                tmplChatBox.toolStripFont.Click += new EventHandler(tmplChangeFontToolStripButton_Click);
                tmplChatBox.toolStripGrin.Click += new EventHandler(tmplEmoticonGrinToolStripButton_Click); ;
                tmplChatBox.toolStripHappy.Click += new EventHandler(tmplEmoticonHappyToolStripButton_Click); ;
                tmplChatBox.toolStripOpenArchive.Click += new EventHandler(toolStripOpenArchive_Click); ;
                tmplChatBox.toolStripSendMessage.Click += new EventHandler(tmplSendMessageToolStripButton_Click); ;
                tmplChatBox.toolStripStartVideo.Click += new EventHandler(tmplVideoCallToolStripButton_Click); ;
                tmplChatBox.toolStripSurprised.Click += new EventHandler(tmplEmoticonSurprisedToolStripButton_Click); ;
                tmplChatBox.toolStripTongue.Click += new EventHandler(tmplEmoticonToungeToolStripButton_Click); ;
                tmplChatBox.toolStripUnhappy.Click += new EventHandler(tmplEmoticonUnhappyToolStripButton_Click); ;
                tmplChatBox.toolStripWaii.Click += new EventHandler(tmplEmoticonWaiiToolStripButton_Click); ;
                tmplChatBox.toolStripWink.Click += new EventHandler(tmplEmoticonWinkToolStripButton_Click); ;
                tmplChatBox.toolStripSendNudge.Click += new EventHandler(toolStripSendNudge_Click);
                tmplChatBox.toolStripSendFile.Click += new EventHandler(toolStripSendFile_Click);
                tmplChatBox.tbMessage.KeyUp += new KeyEventHandler(tmplChatTabMessage_KeyUp);

                //disable foreign networks features
                if (jabberUser.Network != ConfigXMPPNetwork.Default)
                {
                    tmplChatBox.toolStripCallUser.Enabled = false;
                    tmplChatBox.toolStripStartVideo.Enabled = false;
                    tmplChatBox.toolStripSendNudge.Enabled = false;
                    tmplChatBox.toolStripSendFile.Enabled = false;
                    tmplChatBox.toolStripCallUser.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                    tmplChatBox.toolStripStartVideo.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                    tmplChatBox.toolStripSendNudge.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                    tmplChatBox.toolStripSendFile.ToolTipText = Properties.Localization.txtChatFeatureOnlyHomeNetwork;
                }

#if NOVIDEO
                tmplChatBox.toolStripStartVideo.Visible = false;
                tmplChatBox.toolStripStartVideo.Enabled = false;
#endif
#if NOFILESHARING
                tmplChatBox.toolStripSendFile.Visible = false;
                tmplChatBox.toolStripSendFile.Enabled = false;
#endif

                tmplChatBox.LinkClicked += new ChatBox.LinkClickedHandler(tmplChatBox_LinkClicked);
                tmplChatBox.FileDroped += new ChatBox.FilesDropedHandler(tmplChatBox_FileDroped);

                this.myChatSessionsTabControl.SelectedTab = this.tmplChatTab;

                this.tmplChatTab.ContentPanel.ResumeLayout(true);

                RadButtonElement tmplCloseButton = new RadButtonElement("x");
                tmplCloseButton.ToolTipText = Properties.Localization.txtChatInfoCloseTab;
                tmplCloseButton.Tag = jabberUser.JID;
                tmplCloseButton.Click += new EventHandler(tmplCloseButton_Click);

                tmplCloseButton.Alignment = ContentAlignment.TopRight;
                tmplChatTab.Children[2].Margin = new Padding(0, 0, 15, 0);
                tmplChatTab.Children.Add(tmplCloseButton);

                tmplChatSession.ChatTab = tmplChatTab;
                tmplChatSession.ChatBox = tmplChatBox;
                tmplChatSession.JabberUser = jabberUser;

                myChatSessions.Add(jabberUser.JID, tmplChatSession);
                Search("%");
                tmplChatSession.ChatBox.ChatTabMessage.Focus();
            }
            else
            {
                ChatSession tmplChatSession = (ChatSession)myChatSessions[jabberUser.JID];
                myChatSessionsTabControl.SelectedTab = tmplChatSession.ChatTab;
            }

            if (myClientForm.mUserAccount.LoggedIn)
            {
                ShowIt();
            }

        }