public bool toList() { ChangingList = true; unchanged = true; string text = InputTextReq(); if (autoChar) { loading = true; var sugg = SplitterHintReq?.Invoke(); if (sugg == null) { var grps = text.Where(c => Program.invalidPathChars.Contains(c)).ToLookup(c => c).ToArray(); char theChar = ';'; if (grps.Length > 0) { var counts = grps.ToLookup(g => g.Count()); theChar = counts[counts.Max(g => g.Key)].FirstOrDefault()?.Key ?? theChar; } splitchar.Text = theChar + ""; } else { splitchar.Text = sugg; } loading = false; } if (unchanged = splitchar.Text.Length == 0) { return(false); } list.Items.Clear(); string[] lines = text.Split(new[] { splitchar.Text }, StringSplitOptions.None); int? minY = null, maxY = null; //minX = null, //maxX = null; foreach (var l in lines) { var lvi = list.Items.Add(l); var y = lvi.Index * list.Font.Height; //minX = minX == null ? p.X : Math.Min(minX.Value, p.X); minY = minY == null ? y : Math.Min(minY.Value, y); //maxX = maxX == null ? p.X : Math.Max(maxX.Value, p.X); maxY = maxY == null ? y : Math.Max(maxY.Value, y); } //cvalue.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); //var realContentWidth = cvalue.Width - 2; cvalue.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); int width = cvalue.Width = Math.Max(cvalue.Width, prefWidth) + 10; SizeHint?.Invoke(new Size(width, maxY.Value - minY.Value)); ChangingList = false; lengthSignal(); return(true); }
public RenderTexture(uint width, uint height, uint layers, VkFormat format, VkImageUsageFlags usage, VkSampleCountFlags samples = VkSampleCountFlags.Count1, SizeHint sizeHint = SizeHint.None) { this.extent = new VkExtent3D(width, height, 1); this.layers = layers; this.format = format; this.imageUsageFlags = usage; this.samples = samples; this.sizeHint = sizeHint; Create(); }
public AttachmentInfo(StringID id, SizeHint sizeHint, VkFormat format, VkImageUsageFlags usage, VkSampleCountFlags samples = VkSampleCountFlags.Count1) { this.id = id; this.SizeHint = sizeHint; this.Usage = usage; attachmentDescription = new VkAttachmentDescription(format, samples); if (Device.IsDepthFormat(format)) { ClearValue = new VkClearDepthStencilValue(1, 0); } else { ClearValue = new VkClearColorValue(0, 0, 0, 1); } }
public void ImplementIMessageAndOperator(ZMessage message) { var sizeHint = new SizeHint(_writer); sizeHint.Generate(message); _writer.WriteLine(); var serializer = new Serialize(_writer); serializer.Generate(message, typeof(SpanScriber)); _writer.WriteLine(); serializer.Generate(message, typeof(MemoryScriber)); _writer.WriteLine(); serializer.Generate(message, typeof(StreamScriber)); _writer.WriteLine(); var exactSize = new ExactSize(_writer); exactSize.Generate(message, message.FullName, $"in {message.FullName} message"); _writer.WriteLine(); exactSize.Generate(message, message.FullName, $"{message.FullName} message"); _writer.WriteLine(); var tryDeserialize = new TryDeserialize(_writer); tryDeserialize.Generate(message, message.FullName, typeof(SpanDataStreamer <>)); _writer.WriteLine(); tryDeserialize.Generate(message, message.FullName, typeof(MemoryDataStreamer <>)); _writer.WriteLine(); tryDeserialize.Generate(message, message.FullName, typeof(StreamDataStreamer <>)); _writer.WriteLine(); }