public void URLIncrementalReader(bool fakeData) { Class1 c1 = new Class1(); //System.IO.StreamWriter file = File.AppendText("P:\\TEST\\test.html"); //file.Write("<style> a { text-decoration: none; color: black; } </style>\n\r"); //file.Close(); string URL = "http://msdn.microsoft.com/en-us/library/gg145045.aspx"; List<SymbolID> sims = new SymbolCollection().GetSymbolCollection("MSDN"); c1.Fetch(URL, sims[0]); }
public TraceOptions(DataPersistency.BL.UserOptions.LoggingSystemOptions logingOptionsModelReferince) { this.logingOptionsModel = logingOptionsModelReferince; this.symbolCollection = symbolCollection; InitializeComponent(); //bindingSourceOptionsTrace.ResetBindings(true); //logingOptionsModel. bindingSourceOptionsTrace.DataSource = logingOptionsModel; logingOptionsModelReferince.PropertyChanged += new PropertyChangedEventHandler(logingOptionsModelReferince_PropertyChanged); }
public DatabaseOptions(SymbolCollection cymbolCollection) { this.symbolCollection = symbolCollection; InitializeComponent(); if (string.IsNullOrEmpty(SymbolCollection.serverAccess.GetProviderName())) { string provider = SymbolCollection.serverAccess.GetProviderName(); switch (provider) { case "Oracle": OracleRadioButton.Checked = true; break; } } }
RelationItem SymbolToRel(SymbolID s) { SymbolCollection symbolCollectionA = new SymbolCollection(); symbolCollectionA.AddRange(new List<SymbolID>() { s }); //return new RelationItem(0, new int[] { 0, 0 }, s.ID, new int[] { 0, 0 }, new int[] { 0, 0 }, string.Empty); //return new RelationItem(0, new int[] { 0, 0 }, s.ID, new int[] { 0, 0 }, new int[] { 0, 0 }, string.Empty); return null;//=// new RelationItem(symbolCollectionA, new OperatorID(), new SymbolCollection()); }
public List<RelationItem> isTransitive(List<SymbolID> preoperand, List<OperatorID> relation, List<SymbolID> postoperand) { System.Diagnostics.StackTrace stackTrace0 = new System.Diagnostics.StackTrace(); LoggingSystem.BranchName = stackTrace0.GetFrame(0).GetMethod().Name; // first of all prepare solve logical opperations List<int[]> returnedIDs = new List<int[]>(); List<RelationItem> returnedRelations = new List<RelationItem>(); foreach (SymbolID preoperandItem in preoperand) { foreach (SymbolID postoperandItem in postoperand) { if (postoperandItem.Location.A == -100 && postoperandItem.Location.B == 100) { //returnedIDs.AddRange(serverAccess.GetContent(relation[0].ID/*new int[] { 2, 100, 1, 0, 9998, 1 }*/, preoperandItem.Multiplicity, preoperandItem.Location, 10)); //returnedIDs.AddRange(serverAccess.GetContent(relation[0].ID/*new int[] { 2, 100, 1, 0, 9998, 1 }*/, preoperandItem.Multiplicity, preoperandItem.Location, 10)); } else { //=// returnedIDs.AddRange(serverAccess.IsTransitive(new List<int[]>(), relation[0].ID/*new int[] { 2, 100, 1, 0, 9998, 1 }*/, preoperandItem.Location, preoperandItem.Multiplicity, postoperandItem.Location, postoperandItem.Multiplicity, 10)); } if (returnedIDs.Count > 0) { /* bool HaveNoSuchReference = true; //find existent reference List<int[]> referedSymbols = new List<int[]>(); //referedSymbols = serverAccess.GetValue(new int[] { 2, 100, 9998, 1 }, preoperandItem.Location, postoperandItem.Location, 10); // 4 items if (referedSymbols.Count < 1) { //referedSymbols.Add(serverAccess.AssignValue(new int[] { 2, 100, 0, 1 }, preoperandItem.Location, postoperandItem.Location)); //r2r3 } else { //referedSymbols = serverAccess.GetReferince(new int[] { 2, 100, 9998, 1 }, preoperandItem.Location, postoperandItem.Location, 10); // 4 items } List<int[]> ValidReferinces = new List<int[]>(); foreach (int[] MultiplicityReference in referedSymbols) { if (MultiplicityReference[2] != 0 && MultiplicityReference[3] != 0) { ValidReferinces.Add(MultiplicityReference); } else { HaveNoSuchReference = true; } } if (referedSymbols.Count < 0 && HaveNoSuchReference == true) { //create reference //referedSymbols.Add(serverAccess.ReAssignValue(new int[] { 2, 100, 1998, 0 }, candidate[0], SymbID[1])); //referedSymbols.Add(serverAccess.ReAssignValue(new int[] { 2, 100, 1998, 0 }, preoperandItem.Location, postoperandItem.Location)); } foreach (int[] MultiplicityReference in ValidReferinces) { result.Add(new int[] { MultiplicityReference[2], MultiplicityReference[3] }); } */ } else { //if (S //serverAccess.CreateRelation(new int[] { 2, 100, 1, 0, 1998, 1 }, preoperandItem.Multiplicity, preoperandItem.Location, postoperandItem.Multiplicity, postoperandItem.Location); //serverAccess.CreateRelationAsNew(new int[] { 2, 100, 1998, 1 }, SymbID[0], SymbID[1]); } foreach (int[] itemID in returnedIDs) { if (itemID.Count() > 7) { int offset = itemID[8]; int[] rel = new int[] { itemID[2], itemID[3] }; int[] refA = new int[] { itemID[0], itemID[1] }; int[] mul = new int[] { itemID[6], itemID[7] }; int[] refB = new int[] { itemID[4], itemID[5] }; //sresult.Add(new RelationItem(offset, rel, refA, refB, mul, string.Empty)); SymbolCollection symbolCollectionA = new SymbolCollection(); //=//symbolCollectionA.AddRange(IntsToSymbs(new List<int[]>() { refA })); SymbolCollection symbolCollectionB = new SymbolCollection(); //=//symbolCollectionB.AddRange(IntsToSymbs(new List<int[]>() { refB })); //=// returnedRelations.Add(new RelationItem(symbolCollectionA, new OperatorID(new int[] { }, ""), symbolCollectionB)); } } } } #region LOG //=== CUSTOM LOGGER=================================================================================== ElementMethod thisMethod = new ElementMethod(); int logLevel = -1; if (logingOptions != null) logLevel = logingOptions.levelRelations; if (logLevel >= 3) // code { System.Diagnostics.StackTrace stackTrace; System.Diagnostics.StackFrame fr; stackTrace = new System.Diagnostics.StackTrace(); fr = stackTrace.GetFrame(0); thisMethod.ElementNamespaceName = this.GetType().Namespace; thisMethod.ElementClassName = this.GetType().Name; thisMethod.ElementName = stackTrace.GetFrame(0).GetMethod().ToString().Replace(stackTrace.GetFrame(0).GetMethod().Name.ToString(), "<span style='color: red'>" + stackTrace.GetFrame(0).GetMethod().Name.ToString() + "</span>"); } if (logLevel >= 2) // parameters { thisMethod.Parameters.Add(new string[] { "relation", relation.ToString() }); } if (logLevel >= 1) // results { string result = string.Empty; foreach (RelationItem rl in returnedRelations) { result += "{" + rl.ToString() + "}"; } thisMethod.Result = result; } LoggingSystem.LogMethod = thisMethod; //==================================================================================================== #endregion LOG return returnedRelations; }
/// <summary> /// Create new relation /// </summary> /// <param name="collectionA"></param> /// <param name="operatorItem"></param> /// <param name="collectionB"></param> public RelationItem(SymbolCollection collectionA, OperatorItem operatorItem, SymbolCollection collectionB) { this.collectionA = collectionA; this.operatorItem = operatorItem; this.collectionB = collectionB; }