public void Expand(Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages) { if (!_isExpanded) { Inheritance = Inheritance?.Select(i => ApiBuildOutputUtility.GetReferenceViewModel(i.Uid, references, supportedLanguages)).ToList(); Syntax?.Expand(references, supportedLanguages); SeeAlsos?.ForEach(e => e.Expand(references, supportedLanguages)); Sees?.ForEach(e => e.Expand(references, supportedLanguages)); Exceptions?.ForEach(e => e.Expand(references, supportedLanguages)); _isExpanded = true; } }
public void Expand(Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages) { if (_needExpand) { _needExpand = false; Inheritance = Inheritance?.Select(i => ApiBuildOutputUtility.GetReferenceViewModel(i.Uid, references, supportedLanguages)).ToList(); Implements = Implements?.Select(i => ApiBuildOutputUtility.GetApiNames(i.Uid, references, supportedLanguages)).ToList(); Syntax?.Expand(references, supportedLanguages); Overridden = ApiBuildOutputUtility.GetApiNames(Overridden?.Uid, references, supportedLanguages); SeeAlsos?.ForEach(e => e.Expand(references, supportedLanguages)); Sees?.ForEach(e => e.Expand(references, supportedLanguages)); Exceptions?.ForEach(e => e.Expand(references, supportedLanguages)); } }
private BaseLogic GetResult() { try { Sees formula1 = Formula1 as Sees; Believe formula2 = Formula2 as Believe; if (formula1 != null && formula1.Formula.GetType() == typeof(EncryptedSecret)) { if (formula2 != null && formula2.Formula.GetType() == typeof(SharedSecret)) { var sharedSecretFormula = formula2.Formula as SharedSecret; var sharedSecretFormula2 = formula1.Formula as EncryptedSecret; if (sharedSecretFormula2 != null && sharedSecretFormula != null && sharedSecretFormula.Key.Equals(sharedSecretFormula2.Key, StringComparison.InvariantCultureIgnoreCase) && formula1.Agent1.Equals(formula2.Agent1) && sharedSecretFormula.Agent2.Equals(formula1.Agent1)) { return(new Believe { Agent1 = formula1.Agent1, Formula = new Said { Agent1 = sharedSecretFormula.Agent1, Message = sharedSecretFormula.Key } }); } } } } catch (Exception e) { Console.WriteLine(e); throw; } return(null); }
private BaseLogic GetResult() { try { Sees formula1 = Formula1 as Sees; Believe formula2 = Formula2 as Believe; if (formula1 != null && formula1.Formula.GetType() == typeof(EncryptedSecret)) { if (formula2 != null && formula2.Formula.GetType() == typeof(PublicEncryption)) { var encryptedFormula = formula2.Formula as PublicEncryption; var encryptedSecret = formula1.Formula as EncryptedSecret; if (encryptedSecret != null && (encryptedFormula != null && (encryptedFormula.Key.Equals(encryptedSecret.Key) && Equals(formula1.Agent1, formula2.Agent1) && encryptedFormula.Agent1.Equals(formula1.Agent1)))) { return(new Believe { Agent1 = formula1.Agent1, Formula = new Said { Agent1 = encryptedFormula.Agent1, Message = encryptedSecret.Message } }); } } } } catch (Exception e) { Console.WriteLine(e); throw; } return(null); }