//统计标签 protected void StatLabel(ServerConnection conn, ProjectInfo projectInfo, LabelTag tag, ref string strError) { if (tag.PartInfo.PartID == 0) { return; } for (int i = 0; i < tag.Items.Length; i++) { LabelItem item = tag.Items[i]; if (item.TagName.Length == 2) { StatPassrate(conn, projectInfo.ProjectID, tag.PartInfo.PartID, ref item.Value[0], ref item.Value[1], ref strError); } else { if (item.TagName[0] == "平均合格率" && item.Value[0] < 0) { item.Value[0] = StatPassrate(conn, projectInfo.ProjectID, tag.PartInfo.PartID, ref strError); item.Value[0] = (float)Math.Round(item.Value[0] * 100, 1); } if (item.TagName[0] == "CII指数" && item.Value[0] < 0) { item.Value[0] = StatCII(conn, projectInfo.ProjectID, tag.PartInfo.PartID, ref strError); } } } }
public override void UpdateMainStatusBarInfo() { ContentStatusBarManager.Instance.StatusBarMainItemsContainer.SubItems.Clear(); var titleLabel = new LabelItem(); titleLabel.Text = _browserControl.BrowserSettings.StatusBarTitle; if (ContentStatusBarManager.Instance.TextColor.HasValue) { titleLabel.ForeColor = ContentStatusBarManager.Instance.TextColor.Value; } ContentStatusBarManager.Instance.StatusBarMainItemsContainer.SubItems.Add(titleLabel); if (SelectedSite != null) { var urlLabel = new LabelItem(); urlLabel.Text = SelectedSite?.CurrentUrl; if (ContentStatusBarManager.Instance.TextColor.HasValue) { urlLabel.ForeColor = ContentStatusBarManager.Instance.TextColor.Value; } ContentStatusBarManager.Instance.StatusBarMainItemsContainer.SubItems.Add(urlLabel); } ContentStatusBarManager.Instance.StatusBarMainItemsContainer.RecalcSize(); ContentStatusBarManager.Instance.StatusBar.RecalcLayout(); }
/// <summary> /// Change the color of the LabelItem to red if it contains a negative sign ("-") or to blue if it does not. /// /// The negative sign will be removed if present. /// </summary> /// <param name="labelItem">The LabelItem to be updated.</param> public static void ColorizeNumericLabelItem(LabelItem labelItem) { if (numericLabelItemUpdating) { return; } if (labelItem.Text == null) { return; } if (labelItem.Text[0] == '-') { numericLabelItemUpdating = true; // Prevents endless loop caused in some situations by the next line. labelItem.Text = labelItem.Text.Remove(0, 1); labelItem.ForeColor = Color.Red; } else { labelItem.ForeColor = Color.Blue; } numericLabelItemUpdating = false; }
public void BuildSections(IEnumerable <OptionsItem> items) { _items.Clear(); SectionItemsPanel.Children.Clear(); foreach (var optionsItem in items) { var labelItem = new LabelItem(); labelItem.Build(optionsItem); _items[optionsItem.Name] = labelItem; labelItem.ChangedEvent += OnChanged; var label = labelItem.Label; label.MouseUp += delegate { SelectedNewItem(labelItem, label); }; label.MouseMove += delegate { label.Background = _selectedItem == labelItem.Item.Name ? _gradient : _gradientHover; label.FontWeight = _selectedItem == labelItem.Item.Name ? FontWeights.Bold : FontWeights.Normal; }; label.MouseLeave += delegate { label.Background = _selectedItem == labelItem.Item.Name ? _gradient : _transparent; label.FontWeight = _selectedItem == labelItem.Item.Name ? FontWeights.Bold : FontWeights.Normal; }; SectionItemsPanel.Children.Add(label); } }
//private void InitialCatalogPanel() //{ // //根据所选versionname列出所有相关网格的code // this.itemPanel3.Items.Clear(); // //添加标题: // LabelItem labelitem = new LabelItem("待检查图幅", "待检查图幅"); // this.itemPanel3.Items.Add(labelitem as BaseItem); // //添加图幅列表: // IFeatureWorkspace checkWorkspace = m_GlobalWorkspace as IFeatureWorkspace; // ITable table = checkWorkspace.OpenTable("TaskGridLog"); // ICursor cursor = CheckFeatueEditor.UncheckGridCode(table, AppManager.GetInstance().TaskName); // if (cursor != null) // { // IRow row = cursor.NextRow(); // while (row != null) // { // int rowindex = row.Fields.FindFieldByAliasName("图幅号"); // string text = row.get_Value(rowindex) as string; // ButtonItem buttonitem = new ButtonItem(text, text); // this.itemPanel3.Items.Add(buttonitem as BaseItem); // row = cursor.NextRow(); // } // } // this.itemPanel3.Refresh(); //} private void InitialItemPanel() { this.itemPanel1.Items.Clear(); this.itemPanel2.Items.Clear(); LabelItem labelitem = new LabelItem("待检查面要素", "待检查面要素"); this.itemPanel1.Items.Add(labelitem as BaseItem); labelitem = new LabelItem("已检查面要素", "已检查面要素"); this.itemPanel2.Items.Add(labelitem as BaseItem); LoadAllUncheckedItems("CheckItemPoly"); LoadAllCheckedItems("CheckItemPoly"); labelitem = new LabelItem("待检查线要素", "待检查线要素"); this.itemPanel1.Items.Add(labelitem as BaseItem); labelitem = new LabelItem("已检查线要素", "已检查线要素"); this.itemPanel2.Items.Add(labelitem as BaseItem); LoadAllUncheckedItems("CheckItemLn"); LoadAllCheckedItems("CheckItemLn"); labelitem = new LabelItem("待检查点要素", "待检查点要素"); this.itemPanel1.Items.Add(labelitem as BaseItem); labelitem = new LabelItem("已检查点要素", "已检查点要素"); this.itemPanel2.Items.Add(labelitem as BaseItem); LoadAllUncheckedItems("CheckItemPtn"); LoadAllCheckedItems("CheckItemPtn"); itemPanel1.Refresh(); itemPanel2.Refresh(); }
private void CreateStudentMenuItem() { btnAddTempStudent.SubItems.Clear(); if (K12.Presentation.NLDPanels.Student.TempSource.Count == 0) { LabelItem item = new LabelItem("No", "沒有任何學生在待處理"); btnAddTempStudent.SubItems.Add(item); return; } List <StudentRecord> studTempRecList = Student.SelectByIDs(K12.Presentation.NLDPanels.Student.TempSource); foreach (StudentRecord stud in studTempRecList) { string strclassname = "", strSeatNo = "";; if (stud.Class != null) { strclassname = stud.Class.Name; } if (stud.SeatNo.HasValue) { strSeatNo = stud.SeatNo.Value.ToString(); } ButtonItem item = new ButtonItem(stud.ID, stud.Name + "(" + strclassname + ")"); item.Tooltip = "班級:" + strclassname + "\n座號:" + strSeatNo + "\n學號:" + stud.StudentNumber; item.Tag = stud; item.Click += new EventHandler(item_Click); btnAddTempStudent.SubItems.Add(item); } }
private void ParseBlocks() { VoidPtr dataAddr = Header; int len = Header->_header._length; int total = WorkingUncompressed.Length; SetSizeInternal(len); //Look for labl block LABLHeader *labl = (LABLHeader *)(dataAddr + len); if ((total > len) && (labl->_tag == LABLHeader.Tag)) { int count = labl->_numEntries; _labels = new LabelItem[count]; count = labl->_numEntries; for (int i = 0; i < count; i++) { LABLEntry *entry = labl->Get(i); _labels[i] = new LabelItem() { String = entry->Name, Tag = entry->_id }; } len += labl->_size; } //Set data source if (total > len) { _audioSource = new DataSource(dataAddr + len, total - len); } }
public AppStatus(LabelItem statusLabel1, LabelItem statusLabel2, ProgressBarItem pbItem) { label1 = statusLabel1; label2 = statusLabel2; progressBar = pbItem; }
private void timer1_Tick(object sender, EventArgs e) { StartM++; LabelItem label = this.ToolBarLItemGet(-1, ToolButtonName.lblFormStatus.ToString()); label.Text = "查询开始,分析数据需要几分钟,请耐心等待。。。。已经用时" + StartM + "S"; }
public void SLoad() { try{ itemPanel1.Items.Clear(); using (SQLiteCommand cmd = new SQLiteCommand(VDB.SDB)) { cmd.CommandText = "SELECT * FROM TDI"; SQLiteDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { LabelItem lb = new LabelItem(); lb.Text = (string)dr["app"] + "|" + (string)dr["access"]; lb.Name = "lb" + itemPanel1.Items.Count.ToString(); itemPanel1.Items.Add(lb); } } } catch (Exception ex) { AntiCrash.LogException(ex); } finally { } }
private void addbtn_Click(object sender, EventArgs e) { try{ if (switchButton1.Value) { Firewall.Add("AllowAll", filetxt.Text); LabelItem lb = new LabelItem(); lb.Text = filetxt.Text + "|AllowAll"; lb.Name = "lb" + itemPanel1.Items.Count.ToString(); itemPanel1.Items.Add(lb); } else { Firewall.Add("DenyAll", filetxt.Text); LabelItem lb = new LabelItem(); lb.Text = filetxt.Text + "|DenyAll"; lb.Name = "lb" + itemPanel1.Items.Count.ToString(); itemPanel1.Items.Add(lb); } } catch (Exception ex) { AntiCrash.LogException(ex); } finally { } }
private void CreateStudentMenuItem() { btnAdd.SubItems.Clear(); if (Student.Instance.TemporaList.Count == 0) { LabelItem item = new LabelItem("No", "沒有任何學生在待處理"); btnAdd.SubItems.Add(item); return; } foreach (StudentRecord each in Student.Instance.TemporaList) { if (each.Class != null) { ButtonItem item = new ButtonItem(each.ID, each.Name + " (" + Class.Instance.Items[each.Class.ID].Name + ")"); item.Tooltip = "班級:" + Class.Instance.Items[each.Class.ID].Name + "\n座號:" + each.SeatNo + "\n學號:" + each.StudentNumber; item.Tag = each; item.Click += new EventHandler(AttendStudent_Click); btnAdd.SubItems.Add(item); } else { ButtonItem item = new ButtonItem(each.ID, each.Name + " (未分班級)"); item.Tooltip = "班級:(未分班級)\n座號:" + each.SeatNo + "\n學號:" + each.StudentNumber; item.Tag = each; item.Click += new EventHandler(AttendStudent_Click); btnAdd.SubItems.Add(item); } } }
public void UpdateLabel(LabelItem label, string val) { InvokeLabel d = new InvokeLabel(UpdateCurFile); label.Invoke(d, new object[2] { val, label }); }
/// <summary> /// Checks specified label. /// </summary> private static void AssertLabel( string expectedName, int expectedLineNumber, LabelItem label) { Assert.AreEqual(expectedName, label.Name); Assert.IsTrue(label.LineNumber.HasValue); Assert.AreEqual(expectedLineNumber, label.LineNumber); }
void work_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { StartM = 0; timer1.Stop(); gridView1.GridControl.DataSource = GridView1Table; gridView1.GridControl.Show(); LabelItem label = this.ToolBarLItemGet(-1, ToolButtonName.lblFormStatus.ToString()); label.Text = "查询结束"; }
private void GetNextInfo(int index) { itemPanel1.BeginUpdate(); itemPanel1.Items.Clear(); //itemPanel2.Items.Clear(); List <string> nextIntaskList = InTaskList.GetInTaskCigNamesByIndex(index); if (nextIntaskList.Count > 0) { labncigname.Text = "(" + nextIntaskList[0].Split('-')[2] + ")" + nextIntaskList[0].Split('-')[0]; labnbarcode.Text = nextIntaskList[0].Split('-')[1]; nextIntaskList.RemoveAt(0); } else { labnbarcode.Text = "无"; labncigname.Text = "无"; } foreach (string inTask in nextIntaskList) { LabelItem labelItem = new LabelItem(); labelItem.Text = "(" + inTask.Split('-')[2] + ")" + inTask.Split('-')[0]; labelItem.TextAlignment = StringAlignment.Center; labelItem.ForeColor = Color.Red; itemPanel1.Items.Add(labelItem); //LabelItem labelItem1 = new LabelItem(); //labelItem1.Text = inTask.Split('-')[2]; //labelItem1.TextAlignment = StringAlignment.Center; //labelItem1.ForeColor = Color.Red; //itemPanel1.Items.Add(labelItem1); } itemPanel1.EndUpdate(); //itemPanel1.Update(); //if (_comfirmintask != null && !string.IsNullOrEmpty(_comfirmintask.ID)) //{ // panelEx4.Visible = true; // labnextport.Text = _comfirmintask.INPORTCODE; // labnextindexno.Text = _comfirmintask.INDEXNO.ToString(); // labnextbarcode.Text = _comfirmintask.BARCODE; // labnextcigname.Text = _comfirmintask.CIGNAME; // labnextqty.Text = (_comfirmintask.INQTY / 50).ToString(); //} //else //{ // panelEx4.Visible = false; //} }
/// <summary> /// The handler of the message of removing the component from the designer. /// It performs the label removal from the control. /// </summary> /// <param name="sender">the object invoked the event.</param> /// <param name="e">the event's parameters</param> private void componentChangeService_ComponentRemoving(object sender, ComponentEventArgs e) { LabelItem item = e.Component as LabelItem; if (item != null) { this.skinTooltip.Labels.Remove(item); skinTooltip.Invalidate(); skinTooltip.Update(); } }
private void Li_DoubleClick(object sender, EventArgs e) { LabelItem li = sender as LabelItem; ItemContainer ic = li.Parent as ItemContainer; if (ic != null) { string remoteFilePath = ic.Name; openRemoteFile(remoteFilePath); } }
public bool MakeChoice(LabelItem labelItem) { if (CurrentLabelItem != labelItem) { return(false); } GenerateBoard(); return(true); }
/// <summary> /// the handler of the message of changing the selected component. /// </summary> /// <param name="sender">the object invoked the event.</param> /// <param name="e">the event's parameters.</param> private void selectionService_SelectionChanged(object sender, EventArgs e) { LabelItem item = this.selectionService.PrimarySelection as LabelItem; if (item != null) { UnselectAllItems(); item.Selected = true; } }
private void SelectedNewItem(LabelItem labelItem, TextBlock label) { labelItem.ChangedEvent(labelItem.Item.Name); if (!string.IsNullOrEmpty(_selectedItem)) { _items[_selectedItem].Label.Background = _transparent; _items[_selectedItem].Label.FontWeight = FontWeights.Normal; } _selectedItem = labelItem.Item.Name; label.Background = _gradient; }
public IParseItem Visit(LabelItem target) { if (target == null) { throw new ArgumentNullException(nameof(target)); } _tree.DefineLabel(target); return(target); }
private void addbtn_Click(object sender, EventArgs e) { try{ if (Directory.Exists(filetxt.Text)) { uint x = 0; if (readcheck.Checked) { x |= (uint)(0x00000020 | 0x00000200); } if (delcheck.Checked) { x |= (uint)(0x00000100 | 0x00004000); } if (wrcheck.Checked) { x |= (uint)(0x00000400 | 0x00000040 | 0x00000080); } if (rencheck.Checked) { x |= (uint)(0x00002000); } if (qscheck.Checked) { x |= (uint)(0x00020000 | 0x00010000 | 0x00001000 | 0x00008000 | 0x00000800 | 0x00000010); } if (accheck.Checked) { x |= (uint)(0x00040000); } using (StreamWriter str = new StreamWriter(Application.StartupPath + @"\Conf\FSR.klist", true)) str.WriteLine(x.ToString() + "=" + filetxt.Text); LabelItem lb = new LabelItem(); lb.Text = filetxt.Text + "|" + x.ToString(); lb.Name = filetxt.Text; itemPanel1.Items.Add(lb); } } catch (Exception ex) { AntiCrash.LogException(ex); } }
/// <summary> /// Defines a new label in the current block. /// </summary> /// <param name="label">The label to define.</param> public void DefineLabel(LabelItem label) { foreach (var item in _cur.Labels) { if (item.Name == label.Name) { throw new ArgumentException(string.Format(Resources.LabelAlreadyDefined, item.Name)); } } _cur.Labels.Add(label); }
/// <summary> /// Called when the item is a label item. /// </summary> /// <param name="target">The object that was passed to IParseItem.Visit.</param> /// <returns>The passed target or a modification of it.</returns> /// <exception cref="System.ArgumentNullException">If target is null.</exception> public IParseItem Visit(LabelItem target) { if (target == null) { throw new ArgumentNullException(nameof(target)); } target.UserData = target.UserData ?? compiler.CurrentGenerator.DefineLabel(); compiler.CurrentGenerator.MarkLabel((Label)target.UserData); return(target); }
public static int GetParent(int typeId) { LabelItem item = dicItems[typeId]; if (null == item) { Debug.LogError("not exist typeId:" + typeId); return(-2); } return(item.directParent); }
public void Init() { try{ itemPanel1.Items.Clear(); itemPanel2.Items.Clear(); itemPanel3.Items.Clear(); itemPanel4.Items.Clear(); foreach (GIGNewsEntry news in GigSpace.Client.GetNews()) { LabelItem it = new LabelItem(); it.Name = news.Name; it.Text = news.Name + " : " + news.Content; itemPanel3.Items.Add(it); } GigSpace.SetSTAT("Recherche des informations..."); CommunityInfo ci = GigSpace.Client.GetCommunityInfo(); GigSpace.SetSTAT("Informations trouvé..."); GigSpace.Connected = ci.NumberPlayers; GigSpace.SetCON(ci.NumberPlayers); foreach (GigServer sv in ci.Servers) { LabelItem it = new LabelItem(); it.Name = sv.Name; it.Text = sv.Name + " : (" + sv.EP.ToString() + ")"; itemPanel4.Items.Add(it); } int i = 0; foreach (string s in ci.TopTenPlayers) { i++; LabelItem it = new LabelItem(); it.Name = s; it.Text = i.ToString() + ". " + s; itemPanel1.Items.Add(it); } i = 0; foreach (string s in ci.TopTenRich) { i++; LabelItem it = new LabelItem(); it.Name = s; it.Text = i.ToString() + ". " + s; itemPanel2.Items.Add(it); } } catch (Exception ex) { GigSpace.LogError(ex); } }
private void GetPOutPortInfo() { _poutport = new OutPort(pindexno); _poutport.GetCustInfo(); int onesum = 0; int twosum = 0; int threesum = 0; Dictionary <string, Color> ciginfo = _poutport.GetCigInfo(ref onesum, ref twosum, ref threesum); labponesum.Text = onesum.ToString(); labptwosum.Text = twosum.ToString(); labpthreesum.Text = threesum.ToString(); labponetwosum.Text = (onesum + twosum).ToString(); labelX31.Text = _poutport["INDEXNO"]; foreach (Control control in this.panel4.Controls) { if (control is LabelX && control.Tag != null) { if (_poutport.ContainsKey(control.Tag.ToString())) { ((LabelX)control).Text = _poutport[control.Tag.ToString()]; } } } itemPanel2.BeginUpdate(); itemPanel2.Items.Clear(); foreach (var s in ciginfo) { LabelItem labelItem = new LabelItem(); labelItem.Text = s.Key.Replace("(", " ").Replace(")", ""); labelItem.Font = new System.Drawing.Font("黑体", 14); if (s.Key.Contains("*")) { labelItem.ForeColor = Color.Red; } else { labelItem.ForeColor = s.Value; } labelItem.BorderSide = eBorderSide.All; labelItem.BorderType = eBorderType.Bump; labelItem.TextLineAlignment = StringAlignment.Center; labelItem.Width = 225; labelItem.Height = 25; //labelItem.WordWrap = true; itemPanel2.Items.Add(labelItem); } itemPanel2.EndUpdate(); }
/// <summary> /// The handler method for clicking the "Add label" command in design-time. /// </summary> /// <param name="sender">The object that invoked the event.</param> /// <param name="e">the event's arguments.</param> protected void OnAddLabel(object sender, EventArgs e) { LabelItem item = this.designerHost.CreateComponent(typeof(LabelItem)) as LabelItem; item.Parent = skinTooltip; skinTooltip.Labels.Add(item); item.LabelText = "New label"; Random rand = new Random(); item.LabelRect = new Rectangle(rand.Next(skinTooltip.Width - 55), rand.Next(skinTooltip.Height - 15), 55, 15); }
public async Task <ActionResult> printLabel([FromBody] printLabelRequest printLabelRequest) { try { var items = await(from o in db.TbtOrder where printLabelRequest.DocNums.Contains(o.DocNum) select o).ToListAsync(); List <LabelItem> labelItems = new List <LabelItem>(); items.ForEach(x => { LabelItem l = new LabelItem { Dscription = x.Dscription, Quantity = x.Quantity, }; labelItems.Add(l); }); LabelDocumentModel labelDocumentModel = new LabelDocumentModel { Address = items.FirstOrDefault().Address, CardName = items.FirstOrDefault().CardName, DocDate = items.FirstOrDefault().DocDate, DocDueDate = items.FirstOrDefault().DocDueDate, DocNum = string.Join(",", printLabelRequest.DocNums.ToArray()), labelItems = labelItems, Remark = items.FirstOrDefault().Remark }; LabelDocument pDoc = new LabelDocument(this._hostingEnvironment); Stream resultPDFStream = pDoc.CreatePDF(labelDocumentModel); resultPDFStream.Position = 0; if (resultPDFStream.Length != 0) { FileStreamResult fileStreamResult = new FileStreamResult(resultPDFStream, "application/pdf"); fileStreamResult.FileDownloadName = "label_" + "" + ".pdf"; return(fileStreamResult); } else { return(NotFound()); } } catch (Exception ex) { return(StatusCode(500, ex)); } }
protected override LabelItem CreateTitleLabel() { LabelItem label = new LabelItem(); label.GlobalItem = false; try { label.Font = new Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); } catch { label.Font = SystemFonts.MenuFont; // SystemInformation.MenuFont; } label.Stretch = true; label.TextLineAlignment = StringAlignment.Center; label.TextAlignment = StringAlignment.Center; label.Text = this.Text; label.PaddingLeft = 3; label.PaddingRight = 1; return label; }
void Layout() { if (banner == null) banner = new BannerItem (this); items.Clear (); items.Add (banner); Item item = new LabelItem (this, "Common Actions:", 0, banner.Bounds.Bottom + 3 * padding); items.Add (item); item = new LinkItem (this, "Create New Profile", StartEventType.Create, null, 0, item.Bounds.Bottom + text_padding); items.Add (item); item = new LinkItem (this, "Open Profile Log File", StartEventType.Open, null, 0, item.Bounds.Bottom); items.Add (item); int y = item.Bounds.Bottom + 3 * padding; if (history.LogFiles.Count > 0) { item = new LabelItem (this, "Recent Logs:", 0, y); y = item.Bounds.Bottom + text_padding; items.Add (item); foreach (LogInfo info in history.LogFiles) { item = new LinkItem (this, info.Caption, info.Detail, StartEventType.Open, info.Filename, 0, y); items.Add (item); y = item.Bounds.Bottom; } } int x = Allocation.Width / 2; if (history.Configs.Count > 0) { item = new LabelItem (this, "Quick Sessions:", x, banner.Bounds.Bottom + 3 * padding); items.Add (item); y = item.Bounds.Bottom + text_padding; foreach (ProfileConfiguration config in history.Configs) { string text = config.ToString (); int idx = text.IndexOf (":"); item = new QuickStartItem (this, config, text.Substring (0, idx), text.Substring (idx + 1), x, y); items.Add (item); y = item.Bounds.Bottom; } } }
public override void OnPopulate() { RWSDHeader* rwsd = Header; RWSD_DATAHeader* data = rwsd->Data; RuintList* list = &data->_list; int count = list->_numEntries; new RWSDDataGroupNode().Initialize(this, Header->Data, Header->_dataLength); if (Header->_waveOffset > 0 && VersionMinor < 3) new RWSDSoundGroupNode().Initialize(this, Header->Wave, Header->_waveLength); else if (VersionMinor >= 3) new RWARNode() { _name = "Audio" }.Initialize(this, _audioSource.Address, _audioSource.Length); //Get labels RSARNode parent; int count2 = Header->Data->_list._numEntries; if ((_labels == null) && ((parent = RSARNode) != null)) { //Get them from RSAR SYMBHeader* symb2 = parent.Header->SYMBBlock; INFOHeader* info = parent.Header->INFOBlock; VoidPtr offset = &info->_collection; RuintList* soundList2 = info->Sounds; count2 = soundList2->_numEntries; _labels = new LabelItem[count2]; INFOSoundEntry* entry; for (uint i = 0; i < count2; i++) if ((entry = (INFOSoundEntry*)soundList2->Get(offset, (int)i))->_fileId == _fileIndex) { int x = ((WaveSoundInfo*)entry->GetSoundInfoRef(offset))->_soundIndex; _labels[x] = new LabelItem() { Tag = i, String = symb2->GetStringEntry(entry->_stringId) }; } } for (int i = 0; i < count; i++) { RWSD_DATAEntry* entry = (RWSD_DATAEntry*)list->Get(list, i); RWSDDataNode node = new RWSDDataNode() { _name = _labels[i].String }; node._offset = list; node.Initialize(Children[0], entry, 0); } }
//Finds labels using LABL block between header and footer, also initializes array protected bool GetLabels(int count) { RWSDHeader* header = (RWSDHeader*)WorkingUncompressed.Address; int len = header->_header._length; LABLHeader* labl = (LABLHeader*)((int)header + len); if ((WorkingUncompressed.Length > len) && (labl->_tag == LABLHeader.Tag)) { _labels = new LabelItem[count]; count = labl->_numEntries; for (int i = 0; i < count; i++) { LABLEntry* entry = labl->Get(i); _labels[i] = new LabelItem() { String = entry->Name, Tag = entry->_id }; } return true; } return false; }
private void ParseBlocks() { VoidPtr dataAddr = Header; int len = Header->_header._length; int total = WorkingUncompressed.Length; SetSizeInternal(len); //Look for labl block LABLHeader* labl = (LABLHeader*)(dataAddr + len); if ((total > len) && (labl->_tag == LABLHeader.Tag)) { int count = labl->_numEntries; _labels = new LabelItem[count]; count = labl->_numEntries; for (int i = 0; i < count; i++) { LABLEntry* entry = labl->Get(i); _labels[i] = new LabelItem() { String = entry->Name, Tag = entry->_id }; } len += labl->_size; } //Set data source if (total > len) _audioSource = new DataSource(dataAddr + len, total - len); }