public void AreNotEqual() { ISectionID expected = SectionID.FromString("1234B012"); ISectionID actual = SectionID.FromString("4321A121"); Assert.AreNotEqual(expected, actual); }
public void ReadFromStream(PacketStream stream) { DeltaState = new DreamDeltaState(stream.ReadUInt32()); while (stream.Position < stream.Length) { SectionID sectionID = (SectionID)stream.ReadByte(); switch (sectionID) { case SectionID.AtomCreations: ReadAtomCreationsSection(stream); break; case SectionID.AtomDeletions: ReadAtomDeletionsSection(stream); break; case SectionID.AtomDeltas: ReadAtomDeltasSection(stream); break; case SectionID.AtomLocationDeltas: ReadAtomLocationDeltasSection(stream); break; case SectionID.TurfDeltas: ReadTurfDeltasSection(stream); break; case SectionID.Client: ReadClientSection(stream); break; case SectionID.NewIconAppearances: ReadNewIconAppearancesSection(stream); break; default: throw new Exception("Invalid section ID in delta game state packet (" + sectionID + ")"); } } }
public void SectionIdToString_Success() { string expected = "1234B012"; ISectionID actual = SectionID.FromString(expected); Assert.AreEqual(expected, actual.ToString()); }
public void AreEqual() { string sectionIdString = "1234B012"; ISectionID expected = SectionID.FromString(sectionIdString); ISectionID actual = SectionID.FromString(sectionIdString); Assert.AreEqual(expected, actual); }
public void FromString_Success_ItemNumberWithLeadingZeroes() { string itemNumber = "0002"; string yrq = "B012"; ISectionID id = SectionID.FromString(String.Concat(itemNumber, yrq)); Assert.AreEqual(id.ItemNumber, itemNumber); Assert.AreEqual(id.YearQuarter, yrq); }
[Ignore] // this cast doesn't seem to work. Would like to make it work somehow. [email protected] 3/14/2013 public void SubClassed_SafeCast() { string sectionId = "4321A121"; ISectionID actual = SectionID.FromString(sectionId); SubclassedSectionID subclassed = actual as SubclassedSectionID; Assert.IsNotNull(subclassed); }
public void ID_ToString() { string sectionId = "4321A121"; ISectionID actual = SectionID.FromString(sectionId); string actualString = actual.ToString(); Assert.AreEqual(sectionId, actualString); }
public void SubClassed_NewFromISectionID() { string sectionId = "4321A121"; ISectionID actual = SectionID.FromString(sectionId); SubclassedSectionID subclassed = new SubclassedSectionID(actual); Assert.IsNotNull(subclassed); Assert.AreEqual(sectionId, subclassed.ToString()); }
public override string ToString() { string str = "Waymark Presets Section ( ID: " + SectionID.ToString() + ", Offset in File( includes section header ): 0x" + FileOffset.ToString("X") + ", Length: 0x" + SectionData.Length.ToString("X") + " bytes( excluding section header ) )\r\n"; foreach (WaymarkPreset preset in Presets) { str += preset.ToString(); str += "\r\n-----------\r\n"; } return(str); }
private void LoadSections(ref byte[] filebuff, ref int buffPosition) { while (buffPosition < (filebuff.Length - sizeof(uint))) { SectionID sectionID = Common.GetSectionId(ref filebuff, ref buffPosition); switch (sectionID) { case SectionID.MTHD: MidiSection.Parse(ref filebuff, ref buffPosition); break; case SectionID.CASM: CasmSection.Parse(ref filebuff, ref buffPosition); break; // case SectionID.CASM: CasmSection.Parse(ref filebuff, ref buffPosition); break; // case SectionID.CASM: CasmSection.Parse(ref filebuff, ref buffPosition); break; // case SectionID.CASM: CasmSection.Parse(ref filebuff, ref buffPosition); break; // default: throw new ApplicationException("Unknown style-file section"); } } }
protected override bool Execute(CodeActivityContext context) { SectionIntegralComplexResults Res; try { //TODO часовой пояс Res = ARM_Service.SIA_GetSectionIntegralActExcelDocumentWithATSCode( SectionID.Get(context), StartDateTime.Get(context), DataSourceType, DiscreteType, IsPower, IsEnabledRChannel, BusRelation, IsAllocateCA, IsOffsetFromMoscowEnbledForDrums, IsFilterPSEnabled, IsReadCalculatedValues, IsClosedPeriod, null); if (Res.Document != null) { Res.Document.Position = 0; MemoryStream ms = CompressUtility.DecompressGZip(Res.Document); ms.Position = 0; Document.Set(context, ms); } if (Res.Errors != null) { Error.Set(context, Res.Errors.ToString()); } } catch (Exception ex) { Error.Set(context, ex.Message); if (!HideException.Get(context)) { throw ex; } } return(string.IsNullOrEmpty(Error.Get(context))); }
public void Parse(ref byte[] buff, ref int position) { int sectionSize = Common.GetUint(ref buff, ref position); int _old; while (sectionSize > 0) { _old = position; SectionID sectionID = Common.GetSectionId(ref buff, ref position); if (sectionID != SectionID.CSEG) { throw new ApplicationException("Unknown CASM sub structure!"); } CSEGStructure cseg = new CSEGStructure(); cseg.Parse(ref buff, ref position); CSEGS.Add(cseg); sectionSize -= (position - _old); } }
/// Apply a new parent transform to the target gameobjects /// <param name="targets"> The gameobjects to reparent</param> /// <param name="blockoutSection"> The new section that it needs to find in the level above to parent to</param> private void ApplyParentTransformFromSection(GameObject[] targets, SectionID blockoutSection) { for (var i = 0; i < targets.Length; ++i) { var vl = targets[i].GetComponentsInParent <BlockoutSection>().Where(x => x.Section == SectionID.Root) .ToList(); var localRoot = vl.Count > 0 ? vl[0].gameObject : blockoutHierarchy.root.gameObject; BlockoutStaticFunctions.CreateBlockoutSubHeirachyWithRoot(localRoot.transform, localRoot.name + "_"); var targetTransform = localRoot.GetComponentsInChildren <BlockoutSection>() .Where(x => x.Section == blockoutSection) .ToList()[0].transform; targets[i].transform.SetParent(targetTransform); BlockoutStaticFunctions.TrimTargetBlockoutHierarchy(localRoot); } BlockoutStaticFunctions.ApplyCurrentTheme(); }
protected override bool Execute(CodeActivityContext context) { SectionIntegralResults Res; try { Res = ARM_Service.SIA_GetFlowBalanceReport( SectionID.Get(context), TExportExcelAdapterType.toXLS, StartDateTime.Get(context), DataSourceType, BusRelation, true, false, null, true, true, null); if (Res.CompressedDoc != null) { Res.CompressedDoc.Position = 0; MemoryStream ms = CompressUtility.DecompressGZip(Res.CompressedDoc); ms.Position = 0; Document.Set(context, ms); } if (Res.Errors != null) { Error.Set(context, Res.Errors.ToString()); } } catch (Exception ex) { Error.Set(context, ex.Message); if (!HideException.Get(context)) { throw ex; } } return(string.IsNullOrEmpty(Error.Get(context))); }
protected override bool Execute(CodeActivityContext context) { int id = SectionID.Get(context); DateTimeOffset _EventDate = EventDate.Get(context); bool roundData = RoundData.Get(context); try { XMLATSExportSingleObjectResult Res = ARM_Service.XMLExportGetSection80020(_EventDate, id, DataSourceType, BusRelation, TimeZoneId, roundData, false, false, true, false, false, 1, true); Document.Set(context, Res.XMLStream); } catch (Exception ex) { Error.Set(context, ex.Message); if (!HideException.Get(context)) { throw ex; } } return(string.IsNullOrEmpty(Error.Get(context))); }
public void AreNotEqual_String() { ISectionID actual = SectionID.FromString("4321A121"); Assert.AreNotEqual("1234B012", actual); }
// so that it is easy to toggle master pages public void ActivateTab(SectionID sectionID) { }
public override string ToString() { return("Unknown Section Type (ID: " + SectionID.ToString() + ", Offset in File (includes section header): 0x" + FileOffset.ToString("X") + ", Length: 0x" + SectionData.Length.ToString("X") + " bytes (excluding section header))"); }
public void ActivateTab(SectionID sectionID) { string sCSSTop = "current sub"; string sCSSSecondary = "current"; switch (sectionID) { case SectionID.SiteDashboard: tabMainTop.Attributes["class"] = sCSSTop; //tabDashboard.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteInfo: tabMainTop.Attributes["class"] = sCSSTop; tabMain.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentHistory: tabMainTop.Attributes["class"] = sCSSTop; tabHistory.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteTemplate: tabMainTop.Attributes["class"] = sCSSTop; tabMainTemplate.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentSkinEdit: tabMainTop.Attributes["class"] = sCSSTop; tabContentSkin.Attributes["class"] = sCSSSecondary; break; case SectionID.DataImport: tabMainTop.Attributes["class"] = sCSSTop; tabImportContent.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteExport: tabMainTop.Attributes["class"] = sCSSTop; tabExportSite.Attributes["class"] = sCSSSecondary; break; case SectionID.StatusChange: tabMainTop.Attributes["class"] = sCSSTop; tabStatusChange.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentAdd: tabContentTop.Attributes["class"] = sCSSTop; tabContent.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentTemplate: tabContentTop.Attributes["class"] = sCSSTop; tabContentTemplate.Attributes["class"] = sCSSSecondary; break; case SectionID.PageComment: tabContentTop.Attributes["class"] = sCSSTop; tabContentCommentIndex.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentSiteMap: tabContentTop.Attributes["class"] = sCSSTop; tabContentSiteMap.Attributes["class"] = sCSSSecondary; break; case SectionID.Modules: tabExtensions.Attributes["class"] = sCSSTop; tabModules.Attributes["class"] = sCSSSecondary; break; case SectionID.TextWidget: tabExtensions.Attributes["class"] = sCSSTop; tabTxtWidgets.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentSnippet: tabExtensions.Attributes["class"] = sCSSTop; tabSnippets.Attributes["class"] = sCSSSecondary; break; case SectionID.UserAdmin: tabUserSecurity.Attributes["class"] = sCSSTop; tabUserAdmin.Attributes["class"] = sCSSSecondary; break; case SectionID.GroupAdmin: tabUserSecurity.Attributes["class"] = sCSSTop; tabGroupAdmin.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteIndex: tabUserSecurity.Attributes["class"] = sCSSTop; tabSites.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogContentAdd: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogContent.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogIndex: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogContent.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogCategory: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogCategoryIndex.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogTag: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogTagIndex.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogTemplate: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogTemplate.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogComment: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogCommentIndex.Attributes["class"] = sCSSSecondary; break; } }
public void ISectionInstantiation_Success() { ISection section = new Section(SectionID.FromString("1234B012")); }
public void FromString_EmptyString() { SectionID.FromString(String.Empty); Assert.Fail("Should have thrown a FormatException"); }
public void FromString_StringTooLong() { SectionID.FromString("12345B012"); Assert.Fail("Should have thrown a FormatException"); }
public void ActivateTab(SectionID sectionID) { string sCSSTop = "current sub"; string sCSSSecondary = "current"; switch (sectionID) { case SectionID.SiteDashboard: tabMainTop.Attributes["class"] = sCSSTop; //tabDashboard.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteInfo: tabMainTop.Attributes["class"] = sCSSTop; tabMain.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentHistory: tabMainTop.Attributes["class"] = sCSSTop; tabHistory.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteTemplate: tabMainTop.Attributes["class"] = sCSSTop; tabMainTemplate.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentSkinEdit: tabMainTop.Attributes["class"] = sCSSTop; tabContentSkin.Attributes["class"] = sCSSSecondary; break; case SectionID.DataImport: tabMainTop.Attributes["class"] = sCSSTop; tabImportContent.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteExport: tabMainTop.Attributes["class"] = sCSSTop; tabExportSite.Attributes["class"] = sCSSSecondary; break; case SectionID.StatusChange: tabMainTop.Attributes["class"] = sCSSTop; tabStatusChange.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentIndex: tabContentTop.Attributes["class"] = sCSSTop; tabContent.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentAdd: tabContentTop.Attributes["class"] = sCSSTop; tabAddContent.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentTemplate: tabContentTop.Attributes["class"] = sCSSTop; tabContentTemplate.Attributes["class"] = sCSSSecondary; break; case SectionID.PageComment: tabContentTop.Attributes["class"] = sCSSTop; tabContentCommentIndex.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentSiteMap: tabContentTop.Attributes["class"] = sCSSTop; tabContentSiteMap.Attributes["class"] = sCSSSecondary; break; case SectionID.Modules: tabExtensions.Attributes["class"] = sCSSTop; tabModules.Attributes["class"] = sCSSSecondary; break; case SectionID.TextWidget: tabExtensions.Attributes["class"] = sCSSTop; tabTxtWidgets.Attributes["class"] = sCSSSecondary; break; case SectionID.ContentSnippet: tabExtensions.Attributes["class"] = sCSSTop; tabSnippets.Attributes["class"] = sCSSSecondary; break; case SectionID.UserAdmin: tabUserSecurity.Attributes["class"] = sCSSTop; tabUserAdmin.Attributes["class"] = sCSSSecondary; break; case SectionID.GroupAdmin: tabUserSecurity.Attributes["class"] = sCSSTop; tabGroupAdmin.Attributes["class"] = sCSSSecondary; break; case SectionID.SiteIndex: tabUserSecurity.Attributes["class"] = sCSSTop; tabSites.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogContentAdd: tabBlogTop.Attributes["class"] = sCSSTop; tabAddBlogContent.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogIndex: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogContent.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogCategory: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogCategoryIndex.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogTag: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogTagIndex.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogTemplate: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogTemplate.Attributes["class"] = sCSSSecondary; break; case SectionID.BlogComment: tabBlogTop.Attributes["class"] = sCSSTop; tabBlogCommentIndex.Attributes["class"] = sCSSSecondary; break; } }