private static ExtList <TreeCell> AddRow(ExtList <ExtList <TreeCell> > table, int rowIndex, int spaces) { ExtList <TreeCell> result = new ExtList <TreeCell>(true); table.Insert(rowIndex, result); return(result); }
public static ExtList <PatriarchObj> GetPatriarchsLinks(IBaseContext context, int gensMin, bool datesCheck, bool loneSuppress) { ExtList <PatriarchObj> patList = GetPatriarchsList(context, gensMin, datesCheck); IProgressController progress = AppHost.Progress; progress.ProgressInit(LangMan.LS(LSID.LSID_LinksSearch), patList.Count); try { int num2 = patList.Count; for (int i = 0; i < num2; i++) { PatriarchObj patr = patList[i]; for (int j = i + 1; j < num2; j++) { PatriarchObj patr2 = patList[j]; GEDCOMIndividualRecord cross = TreeTools.PL_SearchDesc(patr.IRec, patr2.IRec); if (cross != null) { patr.HasLinks = true; patr2.HasLinks = true; if (cross.Sex == GEDCOMSex.svFemale) { patr.Links.Add(patr2); } else { patr2.Links.Add(patr); } } } progress.ProgressStep(); } } finally { progress.ProgressDone(); } if (loneSuppress) { for (int i = patList.Count - 1; i >= 0; i--) { PatriarchObj patr = patList[i]; if (!patr.HasLinks) { patList.Delete(i); } } patList.Pack(); } return(patList); }
public bool BuildFile(CheckedListBox.CheckedItemCollection checkedItems) { ExtList list = new ExtList(); _projectOptions.Extensions = list; foreach (Ext fileExt in checkedItems) { list.Add(fileExt); } if ((_projectFile == null) || "".Equals(_projectTitle) || "".Equals(_basedir) || list.Count == 0) { return(false); } _projectOptions.SaveOptions(); BuildProjectFile(); FileInfo legacy = ProjectBuildFile; if (legacy != null && legacy.Exists) { legacy.Delete(); } return(true); }
public LBItemList(ListBox owner, LBItem parentItem) { fList = new ExtList <LBItem>(); fOwner = owner; fParentItem = parentItem; fSorted = false; }
public GKMapBrowser() { fMapPoints = new ExtList <GeoPoint>(true); fUpdateCount = 0; fShowPoints = true; fShowLines = true; }
private void btnPatSearch_Click(object sender, EventArgs e) { ListPatriarchs.BeginUpdate(); ExtList <PatriarchObj> lst = null; try { ListPatriarchs.ClearItems(); lst = PatriarchsMan.GetPatriarchsList(fBase.Context, (int)edMinGens.Value, !chkWithoutDates.Checked.GetValueOrDefault()); lst.QuickSort(PatriarchsCompare); int num = lst.Count; for (int i = 0; i < num; i++) { PatriarchObj pObj = lst[i]; string pSign = ((pObj.IRec.Patriarch) ? "[*] " : ""); ListPatriarchs.AddItem(pObj.IRec, new object[] { pSign + GKUtils.GetNameString(pObj.IRec, true, false), pObj.BirthYear, pObj.DescendantsCount, pObj.DescGenerations }); } } finally { if (lst != null) { lst.Dispose(); } ListPatriarchs.EndUpdate(); } }
public static void CopyPoints(IMapBrowser browser, ExtList <GeoPoint> gmapPoints, bool byPerson) { if (gmapPoints == null) { throw new ArgumentNullException("gmapPoints"); } browser.BeginUpdate(); try { browser.ClearPoints(); int num = gmapPoints.Count; for (int i = 0; i < num; i++) { GeoPoint pt = gmapPoints[i]; string stHint = pt.Hint; if (byPerson) { stHint = stHint + " [" + pt.Date.ToString() + "]"; } browser.AddPoint(pt.Latitude, pt.Longitude, stHint); } browser.ZoomToBounds(); } finally { browser.EndUpdate(); } }
//Присылается, когда изменился список фигур public void RefShapes(int index, ref ExtList <Shape> shapelist) { lvShapes.Items.Clear(); for (int i = 0; i < shapelist.Count; i++) { ListViewItem lvNItem = new ListViewItem(shapelist[i].description); if (shapelist[i] is sCross) { lvNItem.ImageIndex = 0; } if (shapelist[i] is sLine) { lvNItem.ImageIndex = 1; } if (shapelist[i] is sCircle) { lvNItem.ImageIndex = 2; } if (shapelist[i] is sRect) { lvNItem.ImageIndex = 3; } lvShapes.Items.Add(lvNItem); } }
public void Search() { fView.PatriarchsList.BeginUpdate(); ExtList <PatriarchObj> lst = null; try { fView.PatriarchsList.ClearItems(); lst = PatriarchsMan.GetPatriarchsList(fBase.Context, (int)fView.MinGensNum.Value, !fView.WithoutDatesCheck.Checked); lst.QuickSort(PatriarchsCompare); int num = lst.Count; for (int i = 0; i < num; i++) { PatriarchObj pObj = lst[i]; string pSign = ((pObj.IRec.Patriarch) ? "[*] " : ""); fView.PatriarchsList.AddItem(pObj.IRec, new object[] { pSign + GKUtils.GetNameString(pObj.IRec, true, false), pObj.BirthYear, pObj.DescendantsCount, pObj.DescGenerations }); } } finally { if (lst != null) { lst.Dispose(); } fView.PatriarchsList.EndUpdate(); } }
public void Test_GetPointsFrame() { CoordsRect coordsRect = PlacesLoader.GetPointsFrame(null); Assert.AreEqual(0.0d, coordsRect.MinLon); Assert.AreEqual(0.0d, coordsRect.MinLat); Assert.AreEqual(0.0d, coordsRect.MaxLon); Assert.AreEqual(0.0d, coordsRect.MaxLat); ExtList <GeoPoint> mapPoints = new ExtList <GeoPoint>(); mapPoints.Add(new GeoPoint(11, 13, "pt1")); mapPoints.Add(new GeoPoint(22, 25, "pt1")); coordsRect = PlacesLoader.GetPointsFrame(mapPoints); Assert.AreEqual(13.0d, coordsRect.MinLon); Assert.AreEqual(11.0d, coordsRect.MinLat); Assert.AreEqual(25.0d, coordsRect.MaxLon); Assert.AreEqual(22.0d, coordsRect.MaxLat); mapPoints.Clear(); mapPoints.Add(new GeoPoint(21, 21, "pt1")); coordsRect = PlacesLoader.GetPointsFrame(mapPoints); Assert.AreEqual(1.0d, coordsRect.MinLon); Assert.AreEqual(1.0d, coordsRect.MinLat); Assert.AreEqual(41.0d, coordsRect.MaxLon); Assert.AreEqual(41.0d, coordsRect.MaxLat); }
public static ExtList <PatriarchObj> GetPatriarchsList(IBaseContext context, int gensMin, bool datesCheck) { ExtList <PatriarchObj> patList = new ExtList <PatriarchObj>(true); IProgressController progress = AppHost.Progress; progress.ProgressInit(LangMan.LS(LSID.LSID_PatSearch), context.Tree.RecordsCount); GKUtils.InitExtCounts(context.Tree, -1); try { int num = context.Tree.RecordsCount; for (int i = 0; i < num; i++) { GEDCOMRecord rec = context.Tree[i]; if (rec is GEDCOMIndividualRecord) { GEDCOMIndividualRecord iRec = rec as GEDCOMIndividualRecord; var parts = GKUtils.GetNameParts(iRec); int birthDate = context.FindBirthYear(iRec); int descGens = GKUtils.GetDescGenerations(iRec); bool res = (iRec.ChildToFamilyLinks.Count == 0); res = (res && iRec.Sex == GEDCOMSex.svMale); res = (res && /*nf != "" && nf != "?" &&*/ parts.Name != "" && parts.Name != "?"); res = (res && descGens >= gensMin); if (datesCheck) { res = (res && birthDate != 0); } if (res) { PatriarchObj pObj = new PatriarchObj(); pObj.IRec = iRec; pObj.BirthYear = birthDate; pObj.DescendantsCount = GKUtils.GetDescendantsCount(iRec) - 1; pObj.DescGenerations = descGens; patList.Add(pObj); } } progress.ProgressStep(); } } finally { progress.ProgressDone(); } return(patList); }
protected override void Dispose(bool disposing) { if (disposing) { fList.Dispose(); fList = null; } base.Dispose(disposing); }
public GKMapBrowser() { BrowserContextMenuEnabled = false; fMapPoints = new ExtList <GeoPoint>(true); fUpdateCount = 0; fShowPoints = true; fShowLines = true; }
public void Test_AddPoint() { var gmapPoints = new ExtList <GeoPoint>(); PlacesLoader.AddPoint(gmapPoints, new GeoPoint(0, 0, "test"), new PlaceRef(null, null)); Assert.AreEqual(1, gmapPoints.Count); PlacesLoader.AddPoint(gmapPoints, new GeoPoint(0, 0, "test"), new PlaceRef(null, null)); Assert.AreEqual(1, gmapPoints.Count); // duplicate will be excluded }
public bool IsStickPlatform(string layer) { int isForbidden = ExtList.ContainSubStringInArray(stickPlatform, layer); if (isForbidden != -1) { return(true); } return(false); }
public bool IsFastForwardLayer(int layer) { int isFastForward = ExtList.ContainSubStringInArray(fastForwardPlatform, LayerMask.LayerToName(layer)); if (isFastForward != -1) { return(true); } return(false); }
private void InternalGenerate() { bool includeGens = fOptions.PedigreeOptions.IncludeGenerations; fWriter.addParagraph(fTitle, fTitleFont, CustomWriter.TextAlignment.taCenter); fPersonList = new ExtList <PedigreePerson>(true); fSourceList = new StringList(); try { GenStep(null, fRoot, 1, 1); ReIndex(); int curLevel = 0; int num = fPersonList.Count; for (int i = 0; i < num; i++) { PedigreePerson person = fPersonList[i]; if (includeGens && curLevel != person.Level) { curLevel = person.Level; string genTitle = LangMan.LS(LSID.LSID_Generation) + " " + SysUtils.GetRome(curLevel); fWriter.beginParagraph(CustomWriter.TextAlignment.taLeft, 12f, 6f); fWriter.addParagraphChunk(genTitle, fChapFont); fWriter.endParagraph(); } WritePerson(person); } if (fSourceList.Count > 0) { fWriter.beginParagraph(CustomWriter.TextAlignment.taCenter, 12f, 6f); fWriter.addParagraphChunk(LangMan.LS(LSID.LSID_RPSources), fChapFont); fWriter.endParagraph(); int num2 = fSourceList.Count; for (int j = 0; j < num2; j++) { string sn = (j + 1).ToString(); string sst = sn + ". " + fSourceList[j]; string sanc = "src_" + sn; fWriter.addParagraphAnchor(sst, fTextFont, sanc); } } } finally { fSourceList.Dispose(); fPersonList.Dispose(); } }
private void WideTable(ExtList <ExtList <TreeCell> > table, int cols) { for (int i = 0; i < table.Count; i++) { var row = table[i]; while (row.Count < cols) { AddCell(row, null, CellKind.ckSpace); } } }
public void Test_CopyPoints() { var mapBrowser = Substitute.For <IMapBrowser>(); Assert.Throws(typeof(ArgumentNullException), () => { PlacesLoader.CopyPoints(mapBrowser, null, true); }); var gmapPoints = new ExtList <GeoPoint>(); gmapPoints.Add(new GeoPoint(0, 0, "test")); PlacesLoader.CopyPoints(mapBrowser, gmapPoints, true); }
public bool IsForbidenLayerSwitch(string layer) { int isForbidden = ExtList.ContainSubStringInArray(walkForbiddenForwardUp, layer); if (isForbidden != -1) { //here we are in front of a forbidden wall !! return(true); } return(false); }
private void OnTriggerExit(Collider other) { if (ExtList.ListContain <GameData.Tags>(tagList, other.tag)) { TriggerController entityNoGravity = other.gameObject.GetComponent <TriggerController>(); if (entityNoGravity) { entityNoGravity.entityTriggerManager.entityNoGravity.LeanInZone(this); } } }
public static CoordsRect GetPointsFrame(ExtList <GeoPoint> mapPoints) { CoordsRect result = new CoordsRect(); if (mapPoints == null || mapPoints.Count <= 0) { return(result); } GeoPoint pt = mapPoints[0]; result.MinLon = pt.Longitude; result.MaxLon = pt.Longitude; result.MinLat = pt.Latitude; result.MaxLat = pt.Latitude; if (mapPoints.Count == 1) { result.MinLon = (result.MinLon - 20.0); result.MaxLon = (result.MaxLon + 20.0); result.MinLat = (result.MinLat - 20.0); result.MaxLat = (result.MaxLat + 20.0); } else { int num = mapPoints.Count; for (int i = 0; i < num; i++) { pt = mapPoints[i]; if (result.MinLon > pt.Longitude) { result.MinLon = pt.Longitude; } else if (result.MaxLon < pt.Longitude) { result.MaxLon = pt.Longitude; } if (result.MinLat > pt.Latitude) { result.MinLat = pt.Latitude; } else if (result.MaxLat < pt.Latitude) { result.MaxLat = pt.Latitude; } } } return(result); }
/// <summary> /// Append all Transform found in this scene into _gameObjectsList list /// </summary> /// <param name="scene"></param> public void AppendAllTransformInSceneToList(Scene scene) { if (!scene.IsValid()) { return; } GameObject[] roots = scene.GetRootGameObjects(); for (int i = 0; i < roots.Length; i++) { Transform[] allChilds = roots[i].GetComponentsInChildren <Transform>(true); ExtList.Append <Transform>(_gameObjectsList, allChilds.ToList()); } }
public LeaderBrain(NWCreature owner) : base(owner) { fDir = Directions.DtNone; fList = new ExtList <NWCreature>(); Formation = PartyFormation.pfWedge; AddMember(owner); fOffsets = new PMPos[PartyMax + 1]; for (int i = 0; i <= PartyMax; i++) { fOffsets[i] = new PMPos(); } }
private void PreparePatriarchs() { using (ExtList <PatriarchObj> lst = PatriarchsMan.GetPatriarchsList(fBase.Context, 2, false)) { lst.QuickSort(PatriarchsCompare); int num = lst.Count; for (int i = 0; i < num; i++) { PatriarchObj pObj = lst[i]; fPatList.AddObject(GKUtils.GetNameString(pObj.IRec, true, false), pObj.IRec); } } }
private static TreeCell AddCell(ExtList <TreeCell> row, GEDCOMIndividualRecord iRec, CellKind cellKind) { TreeCell result = new TreeCell(); result.ColIndex = row.Add(result); result.Kind = cellKind; result.Rec = iRec; result.Row = row; if (iRec != null) { result.Name = iRec.GetPrimaryFullName(); } return(result); }
//констуктор public Editor(int x, int y, ref PictureBox canvas, int index) { real_w = x; real_h = y; cnv = canvas; RedefineXY(x, y); shapelist = new ExtList <Shape>(); shapelist.BeforeChanged += new ChangedEventHandler(shapelist_BeforeChanged); shapelist.AfterChanged += new ChangedEventHandler(shapelist_AfterChanged); shapelist_modificated_private = false; cur_fname = ""; internal_index = index; }
private static ContextListerAsset GenerateContextReferencer() { ContextListerAsset globalContextLister = ExtScriptableObject.CreateAsset <ContextListerAsset>("Assets/Context Lister.asset"); SceneContextAsset context = ExtScriptableObject.CreateAsset <SceneContextAsset>("Assets/Context 1.asset"); context.NameContext = "Demo Scene List"; SceneReference[] sceneItems = SceneReference.GetAllActiveScene(); ExtList.Append(context.SceneToLoad, sceneItems.ToList()); globalContextLister.AddContext(context); globalContextLister.Save(); context.Save(); AssetDatabase.Refresh(); return(globalContextLister); }
//констуктор public Editor(int x, int y, ref PictureBox canvas, int index) { real_w = x; real_h = y; cnv = canvas; RedefineXY(x, y); shapelist = new ExtList<Shape>(); shapelist.BeforeChanged += new ChangedEventHandler(shapelist_BeforeChanged); shapelist.AfterChanged += new ChangedEventHandler(shapelist_AfterChanged); shapelist_modificated_private = false; cur_fname = ""; internal_index = index; }
public void CreateArborGraph(IBaseWindow baseWin, int minGens, bool loneSuppress) { fBase = baseWin; try { fSys = new ArborSystem(1000, 1000, 0.1, null); //(10000, 1000, 0.1, this); fSys.setScreenSize(50, 50); fSys.OnStop += OnArborStop; using (ExtList <PatriarchObj> patList = PatriarchsMan.GetPatriarchsLinks( baseWin.Context, minGens, false, loneSuppress)) { int num = patList.Count; for (int i = 0; i < num; i++) { PatriarchObj pObj = patList[i]; if (!loneSuppress || pObj.HasLinks) { ArborNode node = fSys.addNode(pObj.IRec.XRef); node.Data = pObj; } } for (int i = 0; i < num; i++) { PatriarchObj pat1 = patList[i]; foreach (PatriarchObj pat2 in pat1.Links) { fSys.addEdge(pat1.IRec.XRef, pat2.IRec.XRef); } } } z = -50; fSys.start(); } catch (Exception ex) { Logger.LogWrite("TreeVizControl.CreateArborGraph(): " + ex.Message); } }
public static void AddPoint(ExtList <GeoPoint> mapPoints, GeoPoint gmPt, PlaceRef placeRef) { GeoPoint pt; int num = mapPoints.Count; for (int i = 0; i < num; i++) { pt = mapPoints[i]; if (pt.Hint == gmPt.Hint) { return; } } pt = new GeoPoint(gmPt.Latitude, gmPt.Longitude, gmPt.Hint); pt.Date = placeRef.Date; mapPoints.Add(pt); }
/// <summary> /// Create the specified store. /// </summary> /// <param name="store">The store.</param> /// <returns></returns> public new static DictWrapper _( ExtList< Item > store ) { var temp = new DictWrapper { DictStore = store }; return temp; }
public static void Initializate( ExtList< Item > list ) { var xs = new XmlSerializer( typeof ( ExtList< Item > ) ); var path = Path.Combine( DefaultApplicationPath , DefaultRepositoryFileName ); TextWriter writer = new StreamWriter( path ); using ( var scope = new TransactionScope() ) { xs.Serialize( writer , list ); scope.Complete(); } }
public ExtSection(string name, ExtList<ExtEntry> entries) { Name = name; Entries = entries; }
/// <summary> /// Create a instance with the specified store. /// </summary> /// <param name="store">The store.</param> /// <returns></returns> public static Maintenance _( ExtList< Item > store ) { var instance = new Maintenance { DictStore = store }; return instance; }
/// <summary> /// Persistents the specified list. /// </summary> /// <param name="list">The list.</param> public void Persistent( ExtList< Item > list ) { Persistent( list , Path.Combine( DefaultApplicationPath , DefaultRepositoryFileName ) ); }
//Присылается, когда изменился список фигур public void RefShapes(int index, ref ExtList<Shape> shapelist) { lvShapes.Items.Clear(); for(int i =0; i < shapelist.Count; i++) { ListViewItem lvNItem = new ListViewItem(shapelist[i].description); if (shapelist[i] is sCross) lvNItem.ImageIndex = 0; if (shapelist[i] is sLine) lvNItem.ImageIndex = 1; if (shapelist[i] is sCircle) lvNItem.ImageIndex = 2; if (shapelist[i] is sRect) lvNItem.ImageIndex = 3; lvShapes.Items.Add(lvNItem); } }
public App(ExtList<ExtSection> sections, string[] args) : base(sections) { this.args = args; }
/// <summary> /// Persistents the specified list. /// </summary> /// <param name="list">The list.</param> /// <param name="filePath">The file path.</param> public void Persistent( ExtList< Item > list , String filePath ) { if ( String.IsNullOrEmpty( filePath ) ) filePath = Path.Combine( DefaultApplicationPath , DefaultRepositoryFileName ); var xs = new XmlSerializer( typeof ( ExtList< Item > ) ); using ( var scope = new TransactionScope() ) using ( TextWriter writer = new StreamWriter( filePath ) ) { xs.Serialize( writer , list ); scope.Complete(); } Reload(); }