private void SetDataSet(DumpingProperty saveForLaterAdding1) { switch (saveForLaterAdding1.Code) { case Code.CODE_DIGITAL: case Code.CODE_ANALOG: Description.DataSet = 1; break; case Code.CODE_CUSTOM: case Code.CODE_LIMITSET: Description.DataSet = 2; break; case Code.CODE_SINGLENOE: case Code.CODE_MULTIPLENODE: Description.DataSet = 3; break; case Code.CODE_CONSUMER: case Code.CODE_SOURCE: Description.DataSet = 4; break; case Code.CODE_MOTION: case Code.CODE_SENSOR: Description.DataSet = 5; break; } }
private void AddToCdIfPossible(ref DumpingProperty saveForLaterAdding1, ref DumpingProperty saveForLaterAdding2) { if (saveForLaterAdding1 != null) { Description.DumpingPropertyCollection.Clear(); Description.DumpingPropertyCollection.Add(saveForLaterAdding1); Description.DumpingPropertyCollection.Add(saveForLaterAdding2); SetDataSet(saveForLaterAdding1); WaitingValues.Remove(saveForLaterAdding1.Code); WaitingValues.Remove(saveForLaterAdding2.Code); CheckSavedCodes(saveForLaterAdding1, saveForLaterAdding2); saveForLaterAdding1 = null; saveForLaterAdding2 = null; } }
private void CheckSavedCodes(DumpingProperty saveForLaterAdding1, DumpingProperty saveForLaterAdding2) { if (SavedCodes.Contains(saveForLaterAdding1.Code)) { IsAddedCode1 = true; } else { SavedCodes.Add(saveForLaterAdding1.Code); IsAddedCode1 = false; } if (SavedCodes.Contains(saveForLaterAdding2.Code)) { IsAddedCode2 = true; } else { SavedCodes.Add(saveForLaterAdding2.Code); IsAddedCode2 = false; } }
private void FindDataSet(out DumpingProperty saveForLaterAdding1, out DumpingProperty saveForLaterAdding2) { Code oposite; saveForLaterAdding1 = null; saveForLaterAdding2 = null; foreach (var item in WaitingValues) { oposite = Datasets.FindOpositeInSet(item.Key); foreach (var item2 in WaitingValues) { if (oposite == item2.Key) { saveForLaterAdding1 = item.Value; saveForLaterAdding2 = item2.Value; break; } } if (saveForLaterAdding1 != null && saveForLaterAdding2 != null) { break; } } }