void DataSource_ListChanged(object sender, ListChangedEventArgs e) { switch (e.ListChangedType) { case ListChangedType.ItemAdded: { vScrollBar.Value = 0; Twitter.Status newTweet = DataSource[e.NewIndex]; TweetPane newPane = new TweetPane(newTweet); newPane.Location = new Point(0, 0); newPane.Size = new Size(panelTweetPanels.Width, 140); newPane.Visible = true; foreach (var item in Panes) { item.Location = new Point(item.Location.X, item.Location.Y + 140); } Panes.Add(newPane); panelTweetPanels.Controls.Add(newPane); vScrollBar.Maximum = Panes.Count * 140; newPane.Reply += new TweetReplyEventHandler(TweetPane_Reply); break; } default: break; } }
private void AttachToCurrentWindow() { // If the current window does not yet have our task pane, add it to it IntPtr currentHandle = Bovender.Win32Window.MainWindowHandleProvider(); if (!Panes.ContainsKey(currentHandle)) { Logger.Info("Attaching new WorksheetManager panel to window 0x{0:X08}", currentHandle); WorkbookViewModel viewModel; if (Instance.Default.IsSingleDocumentInterface) { // Create a new workbook view model only if this is an SDI application viewModel = new WorkbookViewModel(Instance.Default.ActiveWorkbook); } else { viewModel = _viewModel; } SheetManagerTaskPane tp = new SheetManagerTaskPane(viewModel, Width, Visible); tp.VisibilityChanged += (object sender, SheetManagerEventArgs args) => { OnVisibilityChanged(args.TaskPane); }; Panes.Add(currentHandle, tp); } else { Logger.Info("Window 0x{0:X08} already has a WorksheetManager panel", currentHandle); } }
private void LoadPanes() { HtmlContainerControl objPaneControl; foreach (Control ctlControl in Controls) { if (ctlControl is HtmlContainerControl) { objPaneControl = ctlControl as HtmlContainerControl; if (objPaneControl != null && !string.IsNullOrEmpty(objPaneControl.ID)) { switch (objPaneControl.TagName.ToLowerInvariant()) { case "td": case "div": case "span": case "p": if (objPaneControl.ID.ToLower() != "controlpanel") { PortalSettings.ActiveTab.Panes.Add(objPaneControl.ID); Panes.Add(objPaneControl.ID.ToLowerInvariant(), new Pane(objPaneControl)); } else { _ControlPanel = objPaneControl; } break; } } } } }
internal void AddPane(DockPane pane) { if (Panes.Contains(pane)) return; Panes.Add(pane); }
public void AddPane(UserControl UIElement) { if (UIElement.DataContext is Models.ViewModelPane vm) { if (Panes.Where(a => a.Header?.ToString().Replace("*", "") == vm.Header.Replace("*", "") && a.IsVisible).Count() > 0) { ShowPane(Panes.Single(a => a.Header?.ToString().Replace("*", "") == vm.Header.Replace("*", "") && a.IsVisible)); } else { var pane = new RadPane { Content = UIElement, }; vm.CloseAction = new Action(() => { pane.IsHidden = true; }); pane.DataContext = vm; pane.IsVisibleChanged += (sender, e) => { }; Binding binding = new Binding(); binding.Path = new PropertyPath("Header"); // свойство элемента-источника pane.SetBinding(RadPane.HeaderProperty, binding); // установка привязки для элемента-приемника Panes.Add(pane); } } else if (UIElement.DataContext is Models.ViewModelPaneReactiveObject vm2) { if (Panes.Where(a => a.Header?.ToString().Replace("*", "") == vm2.Header.Replace("*", "") && a.IsVisible).Count() > 0) { ShowPane(Panes.Single(a => a.Header?.ToString().Replace("*", "") == vm2.Header.Replace("*", "") && a.IsVisible)); } else { var pane = new RadPane { Content = UIElement, }; vm2.CloseAction = new Action(() => { pane.IsHidden = true; }); pane.DataContext = vm2; pane.IsVisibleChanged += (sender, e) => { }; Binding binding = new Binding(); binding.Path = new PropertyPath("Header"); // свойство элемента-источника pane.SetBinding(RadPane.HeaderProperty, binding); // установка привязки для элемента-приемника Panes.Add(pane); } } }
/// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Method[@name="SetPaneIndex(DockPane, int)"]/*'/> public void SetPaneIndex(DockPane pane, int index) { int oldIndex = Panes.IndexOf(pane); if (oldIndex == -1) { throw(new ArgumentException(ResourceHelper.GetString("DockPanel.SetPaneIndex.InvalidPane"))); } if (index < 0 || index > Panes.Count - 1) { if (index != -1) { throw(new ArgumentOutOfRangeException(ResourceHelper.GetString("DockPanel.SetPaneIndex.InvalidIndex"))); } } if (oldIndex == index) { return; } if (oldIndex == Panes.Count - 1 && index == -1) { return; } Panes.Remove(pane); if (index == -1) { Panes.Add(pane); } else if (oldIndex < index) { Panes.AddAt(pane, index - 1); } else { Panes.AddAt(pane, index); } if (pane.DockState == DockState.Float) { pane.FloatWindow.PerformLayout(); } else if (DockHelper.IsDockWindowState(pane.DockState)) { DockWindows[pane.DockState].PerformLayout(); } else if (DockHelper.IsDockStateAutoHide(pane.DockState)) { Refresh(); } }
public INodeEditorConfig <TEntity> AddSection <TDerivedEntity>(Type?customSectionType, Action <IEditorPaneConfig <TDerivedEntity> >?configure) where TDerivedEntity : TEntity { var config = customSectionType == null ? new PaneConfig <TDerivedEntity>(typeof(TDerivedEntity)) : new PaneConfig <TDerivedEntity>(typeof(TDerivedEntity), customSectionType); configure?.Invoke(config); Panes.Add(config); return(this); }
public IListViewConfig <TEntity> AddRow <TDerivedEntity>(Type?customSectionType, Action <IDisplayPaneConfig <TDerivedEntity> > configure) where TDerivedEntity : TEntity { var config = customSectionType == null ? new PaneConfig <TDerivedEntity>(typeof(TDerivedEntity)) : new PaneConfig <TDerivedEntity>(typeof(TDerivedEntity), customSectionType); configure?.Invoke(config); Panes.Add(config); return(this); }
private NodeViewConfig <TEntity> AddSection <TDerivedEntity>(Type?customSectionType, Action <IDisplayPaneConfig <TDerivedEntity> >?configure) where TDerivedEntity : TEntity { var config = customSectionType == null ? new PaneConfig <TDerivedEntity, IFieldConfig <TDerivedEntity> >(typeof(TDerivedEntity)) : new PaneConfig <TDerivedEntity, IFieldConfig <TDerivedEntity> >(typeof(TDerivedEntity), customSectionType); configure?.Invoke(config); Panes.Add(config); return(this); }
public void loadTMXFile(string path, bool bind) { XmlDocument xml = new XmlDocument(); xml.LoadXml(File.ReadAllText(path)); XmlNode mapNode = xml["map"]; //get basic info int mapWidth = int.Parse(mapNode.Attributes["width"].InnerText); int mapHeight = int.Parse(mapNode.Attributes["height"].InnerText); int tileWidth = int.Parse(mapNode.Attributes["tilewidth"].InnerText); int tileHeight = int.Parse(mapNode.Attributes["tileheight"].InnerText); //load world (assumes same sized tiles throughout layers) foreach (XmlNode subNode in mapNode) { if (subNode.Name.EqualsIgnoreCase("tileset")) { string imageAtlasFile = subNode["image"].Attributes["source"].InnerText; string imageAtlasPath = Path.Combine(Path.GetDirectoryName(path), imageAtlasFile); int startIndex = int.Parse(subNode.Attributes["firstgid"].InnerText); TileSets.Add(TileSet <Tile> .fromImageAtlas(imageAtlasPath, startIndex, tileWidth, tileHeight)); rebuildTileLut(); //(future proofing) do now incase layers ever need to inspect the tiles } else if (subNode.Name.EqualsIgnoreCase("layer")) { string layerFormat = subNode["data"].Attributes["encoding"].InnerText; if (layerFormat.EqualsIgnoreCase("csv")) { //get all numbers from the csv [LIKE A BOSS] //int[] indicies = subNode["data"].InnerText.Split(',').Select(n => int.Parse(n.Trim())).ToArray(); int[] indicies = subNode["data"].InnerText.ParseAllIntegers(); Panes.Add(new TiledPane(mapWidth, mapHeight, indicies, this)); } else { WDAppLog.logError(ErrorLevel.Error, "Unsuported layer format", path); } } else if (subNode.Name.EqualsIgnoreCase("objectgroup")) { } else if (subNode.Name.EqualsIgnoreCase("imagelayer")) { string imageFile = subNode["image"].Attributes["source"].InnerText.Trim(); string imagePath = Path.Combine(Path.GetDirectoryName(path), imageFile); Bitmap b = new Bitmap(imagePath); Panes.Add(new ImagePane(b)); } } }
public GRP1(FileReader reader, BxlytHeader header) { LayoutFile = header; Name = reader.ReadString(0x10, true);; int numNodes = reader.ReadUInt16(); reader.Seek(2); //padding for (int i = 0; i < numNodes; i++) { Panes.Add(reader.ReadString(0x10, true)); } }
// Methods private void ConstructSample() { SuspendLayout(); StockPane.PercentHeight = 75f; Pane pane = Panes.Add("VOL"); pane.PercentHeight = 25f; pane.YAxis.MinAuto = false; pane.YAxis.Min = 0.0; pane.PaneFrame.TitleBoxVisible = false; ResumeLayout(); var series = new VolumeSeries("Volume"); var random = new Random(); int num = random.Next(100, 150); DateTime date = DateTime.Today.AddDays(1.0); for (int i = 0; i < 100; i++) { int maxValue = num + random.Next(5, 0x15); int minValue = num - random.Next(5, 0x15); int num4 = random.Next(minValue, maxValue); int num5 = random.Next(0x186a0, 0x989680); if (date.DayOfWeek == DayOfWeek.Friday) { date = date.AddDays(3.0); } else if (date.DayOfWeek == DayOfWeek.Saturday) { date = date.AddDays(2.0); } else { date = date.AddDays(1.0); } StockSeries.Data.Add(num, maxValue, minValue, num4, date); series.Data.Add(num5); num += random.Next(-15, 0x15); } pane.Series.Add(series); var series2 = new LineSeries("MA 10"); series2.Data.SetDataArray(Formula.ExponentialMovingAverage(StockSeries.Data, 10)); StockPane.Series.Add(series2); FitChart(); }
private void LoadPanes() { //iterate page controls foreach (Control ctlControl in Controls) { var objPaneControl = ctlControl as HtmlContainerControl; //Panes must be runat=server controls so they have to have an ID if (objPaneControl != null && !string.IsNullOrEmpty(objPaneControl.ID)) { //load the skin panes switch (objPaneControl.TagName.ToLowerInvariant()) { case "td": case "div": case "span": case "p": case "section": case "header": case "footer": case "main": case "article": case "aside": //content pane if (objPaneControl.ID.ToLower() != "controlpanel") { //Add to the PortalSettings (for use in the Control Panel) PortalSettings.ActiveTab.Panes.Add(objPaneControl.ID); //Add to the Panes collection Panes.Add(objPaneControl.ID.ToLowerInvariant(), new Pane(objPaneControl)); } else { //Control Panel pane _controlPanel = objPaneControl; } break; } } } }
private void BuildPanes() { if (FindControlRecursive(this, "ContentPane") is HtmlContainerControl contentPane) { base.PortalSettings.ActiveTab.Panes.Add(contentPane.ID); Panes.Add(contentPane.ID.ToLowerInvariant(), new Pane(contentPane)); } if (!m2v.HasValue || m2v.HasValue && m2v.Value && !string.IsNullOrEmpty(Request.QueryString["SkinSrc"])) { foreach (ModuleInfo m in PortalSettings.ActiveTab.Modules) { if (FindControl("vj_" + m.ModuleID.ToString()) is HtmlContainerControl paneCtrl) { base.PortalSettings.ActiveTab.Panes.Add(paneCtrl.ID); Panes.Add(paneCtrl.ID.ToLowerInvariant(), new Pane(paneCtrl)); } } } }
public void SetPaneIndex(DockPane pane, int index) { int oldIndex = Panes.IndexOf(pane); if (oldIndex == -1) { throw(new ArgumentException(Strings.DockPanel_SetPaneIndex_InvalidPane)); } if (index < 0 || index > Panes.Count - 1) { if (index != -1) { throw(new ArgumentOutOfRangeException(Strings.DockPanel_SetPaneIndex_InvalidIndex)); } } if (oldIndex == index) { return; } if (oldIndex == Panes.Count - 1 && index == -1) { return; } Panes.Remove(pane); if (index == -1) { Panes.Add(pane); } else if (oldIndex < index) { Panes.AddAt(pane, index - 1); } else { Panes.AddAt(pane, index); } }
public GRP1(FileReader reader, BxlytHeader header) { LayoutFile = header; ushort numNodes = 0; if (header.VersionMajor >= 5) { Name = reader.ReadString(34, true); numNodes = reader.ReadUInt16(); } else { Name = reader.ReadString(24, true);; numNodes = reader.ReadUInt16(); reader.Seek(2); //padding } for (int i = 0; i < numNodes; i++) { Panes.Add(reader.ReadString(24, true)); } }
public void AddPane(RadPane pane) { pane.Unloaded += Pane_Unloaded; Panes.Add(pane); }