public ConvertNode(Source source, CodeTreeNode child, CodeTreeNode type) : base(source) { this.child = child; this.type = type; }
public static IEnumerable<MangaData> getNews(Source source) { var web = new HtmlAgilityPack.HtmlWeb(); web.AutoDetectEncoding = true; var htmlMainDoc = web.Load(@"http://www.mangareader.net/latest"); var itemsManga = htmlMainDoc.DocumentNode.SelectNodes(@"/html/body/div[@id='container']/div[@id='wrapper_body']/div[@id='latest']/div[@id='latestchapters']/table[@class='updates']/tr[@class='c2']"); for (int i = itemsManga.Count-1; i >=0; i--) { var itemManga = itemsManga[i]; MangaData manga = new MangaData(source,true); var mangaNode = itemManga.SelectSingleNode(@"td[2]/a[@class='chapter']"); var mangaName = mangaNode.InnerText; var mangaDetailLink = "http://www.mangareader.net" + mangaNode.GetAttributeValue("href", ""); manga.DetailMangaSource = source.CreateDetailMangaSource(manga, mangaDetailLink); manga.Name = mangaName; foreach (var itemChapter in itemManga.SelectNodes(@"td[2]/a[@class='chaptersrec']")) { ChapterData chapter = new ChapterData(); //// ////var matches = Regex.Matches(itemChapter.SelectSingleNode("a").InnerText, @"\d+"); //// ////var chapterName = matches[matches.Count - 1].Value; var chapterName = itemChapter.InnerText; var chapterLink = "http://www.mangareader.net" + itemChapter.GetAttributeValue("href", ""); chapter.Name = chapterName; chapter.ChapterSource = source.CreateChapterSource(chapterLink); manga.ChaptersData.Add(chapter); } yield return manga; } }
public SourceStream(Source soruce, char[] symbols, int start, int length = 0) { Soruce = soruce; Symbols = symbols; Start = start; Length = length; }
public IsExpression(Source source, object obj, object type) : base(source) { this.obj = (Expression) obj; this.type = (Expression) type; }
private Source ParseCore(string source) { var result = Source.Default; if (!string.IsNullOrEmpty(source)) { var regex = new Regex( TwitterDefinitions.Regex.Source, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled); var matches = regex.Match(source); if (matches.Success) { var client = matches.Groups["client"].ToString(); var url = matches.Groups["url"].ToString(); Uri uri; result = new Source(client, Uri.TryCreate(url, UriKind.Absolute, out uri) ? uri : null); this.sources.Add(source, result); } else { DebugMonitor.WriteLine("unmatched source string: " + source); } } return result; }
public SourcePage(Source source) : this(source.UniqueId, source.Name, null, source.Order) { this.source = source; source.Properties.PropertyChanged += OnPropertyChanged; UpdateIcon (); }
public static void TestUseCase() { var s = new Source(); s.Fire(); Assert.AreEqual(s.Counter, 1, "Bridge520 Counter"); }
public ILangErrorToken(Source source, ILangErrorCode error, char current) : base(source) { TokenType = "error"; Value = error; Text = current.ToString(); }
private void downloadData(Source source, string url, string bland) { WebClient wc = new WebClient(); Stream st = wc.OpenRead(url); Encoding enc = Encoding.GetEncoding("utf-8"); StreamReader sr = new StreamReader(st, enc); html = sr.ReadToEnd(); sr.Close(); st.Close(); //HTMLを解析する HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(html); //XPathで取得するNodeを指定 foreach (Field field in m_nodeName[source].Keys) { try { doc.DocumentNode.SelectNodes(m_nodeName[source][field]); var node = doc.DocumentNode.SelectSingleNode(m_nodeName[source][field]); m_marketData[bland][field] = node.InnerText; } catch (Exception err) { } } }
/** * Handles an error. * * The behaviour of this method is defined by the * implementation. It may simply record the error message, or * it may throw an exception. */ public void handleError(Source source, int line, int column, String msg) { errors++; print(source.getName() + ":" + line + ":" + column + ": error: " + msg); }
public CallExpression(Source source, object callable, object parameters) : base(source) { this.callable = (Expression) callable; this.parameters = (List<object>) parameters; }
public MultiplyExpression(Source source, object a, object b) : base(source) { this.a = (Expression) a; this.b = (Expression) b; }
public EqualityExpression(Source source, object a, object b) : base(source) { this.a = (Expression) a; this.b = (Expression) b; }
public SubtractExpression(Source source, object a, object b) : base(source) { this.a = (Expression) a; this.b = (Expression) b; }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { var list = JObject.Load(reader).ToObject<StripeList<dynamic>>(); var result = new StripeList<Source> { Data = new List<Source>(), HasMore = list.HasMore, Object = list.Object, TotalCount = list.TotalCount, Url = list.Url }; foreach (var item in list.Data) { var source = new Source(); if (item.SelectToken("object").ToString() == "bank_account") { source.Type = SourceType.BankAccount; source.BankAccount = Mapper<StripeBankAccount>.MapFromJson(item.ToString()); } if (item.SelectToken("object").ToString() == "card") { source.Type = SourceType.Card; source.Card = Mapper<StripeCard>.MapFromJson(item.ToString()); } result.Data.Add(source); } return result; }
public void WhenParseLiteralTokenFromAndSaveResultAs(Source source, string key) { var parser = new LiteralTokenParser(Settings); var stream = new SourceStream(source); var result = parser.Parse(stream); ScenarioContext.Current.Set(result, key); }
public static ChapterData getChapters(Source source, string link) { ChapterData chapter = new ChapterData(); var web = new HtmlAgilityPack.HtmlWeb(); web.AutoDetectEncoding = true; var htmlpage1 = web.Load(link); var pages = new List<IObservable<HtmlDocument>>(); pages.Add(Observable.Return(htmlpage1)); var linksToPages = htmlpage1.DocumentNode.SelectNodes(@"/html/body/section[@class='readpage_top']/div[@class='go_page clearfix']/span[@class='right']/select[@class='wid60']/option"); for (int i = 1; i < linksToPages.Count; i++) { var linkToPage=linksToPages[i].GetAttributeValue("value", ""); pages.Add(Observable.Start<HtmlDocument>( ()=>{ var web2 = new HtmlAgilityPack.HtmlWeb(); web.AutoDetectEncoding = true; return htmlpage1 = web.Load(linkToPage); } )); } foreach (IObservable<HtmlDocument> item in pages) { HtmlDocument pagehtml = item.Wait(); chapter.Images.Add(pagehtml.DocumentNode.SelectSingleNode(@"/html/body/section[@id='viewer']/a/img[@id='image']/@src").GetAttributeValue("src","")) ; } return chapter; }
public static IEnumerable<MangaData> getNews(Source source) { var web = new HtmlAgilityPack.HtmlWeb(); web.AutoDetectEncoding = true; var htmlMainDoc = web.Load(@"http://www.mangahere.com/latest/"); var itemsManga = htmlMainDoc.DocumentNode.SelectNodes(@"/html/body/section[@class='page_main']/div[@class='latest_released']/div[@class='manga_updates']/dl"); for (int i = itemsManga.Count-1; i >+0; i--) { var itemManga = itemsManga[i]; MangaData manga = new MangaData(source, true); var mangaNode = itemManga.SelectSingleNode(@"dt"); var mangaName = mangaNode.SelectSingleNode("a").InnerHtml; var mangaDetailLink = mangaNode.SelectSingleNode("a").GetAttributeValue("href", ""); manga.DetailMangaSource = source.CreateDetailMangaSource(manga, mangaDetailLink); manga.Name = mangaName; foreach (var itemChapter in itemManga.SelectNodes("dd")) { ChapterData chapter = new ChapterData(); //var matches = Regex.Matches(itemChapter.SelectSingleNode("a").InnerText, @"\d+"); //var chapterName = matches[matches.Count - 1].Value; var chapterName = itemChapter.SelectSingleNode("a").InnerText; var chapterLink = itemChapter.SelectSingleNode("a").GetAttributeValue("href", ""); chapter.Name = chapterName; chapter.ChapterSource = source.CreateChapterSource(chapterLink); manga.ChaptersData.Add(chapter); } yield return manga; } }
public void Should_use_passed_in_configuration() { var source = new Source {Value = 5}; var dest = Mapper.Map<Source, Dest>(source); dest.Value.ShouldEqual(source.Value); }
public MemberNode(Source source, CodeTreeNode obj, string member) : base(source) { this.obj = obj; this.member = member; }
/// <summary> /// Render a helpful description of the location of the error in the GraphQL /// Source document. /// </summary> private static string highlightSourceAtLocation(Source source, SourceLocation location) { var line = location.Line; var prevLineNum = (line - 1).ToString(); var lineNum = line.ToString(); var nextLineNum = (line + 1).ToString(); var padLen = nextLineNum.Length; var lines = _lineSplitter.Split(source.Body); var errorMessage = new StringBuilder(); if (line >= 2) { errorMessage.AppendLine(prevLineNum.PadLeft(padLen, ' ') + ": " + lines[line - 2]); } else { errorMessage.AppendLine(); } errorMessage.AppendLine(lineNum.PadLeft(padLen, ' ') + ": " + lines[line - 1]); errorMessage.AppendLine(new String(' ', padLen + location.Column) + "^"); if (line < lines.Length) { errorMessage.AppendLine(nextLineNum.PadLeft(padLen, ' ') + ": " + lines[line]); } else { errorMessage.AppendLine(); } return errorMessage.ToString(); }
public Reference(Source source, string name, string title, string chapter, string verse) : this(source, name) { this.title = title; this.chapter = chapter; this.verse = verse; }
public DatabaseSource (string generic_name, string name, string id, int order, Source parent) : base (generic_name, name, order, id) { if (parent != null) { SetParentSource (parent); } DatabaseSourceInitialize (); }
public DomainEventFunnel(object observable, Source.Of<object> observer) { this.observable = new WeakReference<object>(observable); this.observer = observer; GetDomainEventAddMethodsFrom(observable).ForEach(e => e.Invoke(observable, new object[] {observer})); }
public ErrorsSource(string name, Source source) : base(name, 50) { this.source = source; this.source.AddChildSource (this); scrolled_window = new ScrolledWindow(); scrolled_window.ShadowType = ShadowType.In; scrolled_window.VscrollbarPolicy = PolicyType.Automatic; scrolled_window.HscrollbarPolicy = PolicyType.Automatic; view = new TreeView(); scrolled_window.Add(view); scrolled_window.ShowAll(); TreeViewColumn message_col = view.AppendColumn(Catalog.GetString("Message"), new CellRendererText(), "text", 0); TreeViewColumn file_col = view.AppendColumn(Catalog.GetString("File Name"), new CellRendererText(), "text", 1); message_col.Resizable = true; file_col.Resizable = true; store = new ListStore(typeof(string), typeof(string), typeof(Exception)); view.Model = store; }
public Pascal(String operation, String filePath, String flags) { try{ bool intermediate = flags.IndexOf('i') > 1; bool xref = flags.IndexOf('x') > 1; source = new Source(new StreamReader(filePath)); source.AddMessageListener(new SourceMessageListener()); parser = FrontEndFactory.CreateParser("pascal","top-down",source); parser.AddMessageListener(new ParserMessageListener()); backend = BackendFactory.CreateBackend("compile"); backend.AddMessageListener(new BackendMessageListener()); parser.Parse(); source.close(); intermediateCode = parser.IntermediateCode; symbolTable = Parser.SymbolTable; backend.Process(intermediateCode,symbolTable); } catch(Exception ex){ Console.WriteLine ("Internal translation error"); Console.WriteLine (ex.StackTrace); } }
public void ShouldNotMapFromStaticProperties() { Mapper.CreateMap<Source, Destination>(); var source = new Source(); Destination destination = Mapper.Map<Source, Destination>(source); Assert.NotEqual(100, destination.Static); }
void Instance_OnSourceChanged(Source newSource) { if (newSource != m_currentSource) { Slide currentSlide = PresentationController.Instance.SelectedSlide; if (currentSlide == null) return; Display disp = currentSlide.DisplayList.Find(d => d.EquipmentType == m_Display.EquipmentType); if (disp == null) return; Window wnd = disp.WindowList.Where(x => x.Source == newSource).FirstOrDefault(); if (wnd != null) { SelectedSource = new RectangleF(wnd.Left / (float)m_Display.Width, wnd.Top / (float)m_Display.Height, wnd.Width / (float)m_Display.Width, wnd.Height / (float)m_Display.Height); m_currentSource = wnd.Source; } else { SelectedSource = null; m_currentSource = null; } if (OnSourceSelected != null) OnSourceSelected(); } }
public AssignExpression(Source source, object to, object from) : base(source) { this.from = (Expression) from; this.to = (Expression) to; }
public override void CreateOrUpdateOrganization(RmUnifyOrganization organization, Source source) { using (var context = new UsersContext()) { // Get the school (if it exists) School school = (from s in context.Schools where s.RmUnifyOrganizationId == organization.Id select s).SingleOrDefault(); if (school == null) { // School does not exist - create school = new School() { RmUnifyOrganizationId = organization.Id, DisplayName = organization.Name }; context.Schools.Add(school); context.SaveChanges(); } else { // School exists - update if (school.Deleted != null || school.RmUnifyOrganizationId != organization.Id) { school.Deleted = null; school.RmUnifyOrganizationId = organization.Id; context.SaveChanges(); } } } }
public static extern void SourceSetBuffer(Source source, Buffer buffer);
public void Dispose() { Source.Dispose(); Results.Dispose(); }
public override Expression Resolve( ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext) { // this simply streams its input data to the output without modifying its structure, so we resolve by passing on the data to the previous node return(Source.Resolve(inputParameter, expressionToBeResolved, clauseGenerationContext)); }
/// <summary> /// Same type of query as <see cref="PersistenceIds"/> but the stream /// is completed immediately when it reaches the end of the "result set". Persistent /// actors that are created after the query is completed are not included in the stream. /// </summary> public Source <string, NotUsed> CurrentPersistenceIds() => Source.ActorPublisher <string>(AllPersistenceIdsPublisher.Props(false, _writeJournalPluginId)) .MapMaterializedValue(_ => NotUsed.Instance) .Named("CurrentPersistenceIds") as Source <string, NotUsed>;
/// <summary> /// Same type of query as <see cref="EventsByPersistenceId"/> but the event stream /// is completed immediately when it reaches the end of the "result set". Events that are /// stored after the query is completed are not included in the event stream. /// </summary> public Source <EventEnvelope, NotUsed> CurrentEventsByPersistenceId(string persistenceId, long fromSequenceNr, long toSequenceNr) => Source.ActorPublisher <EventEnvelope>(EventsByPersistenceIdPublisher.Props(persistenceId, fromSequenceNr, toSequenceNr, null, _maxBufferSize, _writeJournalPluginId)) .MapMaterializedValue(_ => NotUsed.Instance) .Named("CurrentEventsByPersistenceId-" + persistenceId) as Source <EventEnvelope, NotUsed>;
/// <summary> /// Compute the string value of this span. /// </summary> /// <returns>A string with the value of this span.</returns> public string ToStringValue() { EnsureHasValue(); return(Source.Substring(Position.Absolute, Length)); }
public virtual TimeSpan GetTravelTime() { return(Source.GetTravelTime(Target, Speed)); }
/// <summary> /// Collect paintable resources /// </summary> private void CollectResource() { var resources = Source.Platform == PsbSpec.krkr ? Source.CollectResources() : Source.CollectSpiltedResources(); foreach (var motion in (PsbDictionary)Source.Objects["object"].Children("all_parts").Children("motion")) { //Console.WriteLine($"Motion: {motion.Key}"); var layerCol = motion.Value.Children("layer") as PsbCollection; foreach (var layer in layerCol) { if (layer is PsbDictionary o) { Travel(o, null); } } } Resources.Sort((md1, md2) => (int)((md1.ZIndex - md2.ZIndex) * 100)); //Travel void Travel(IPsbCollection collection, (float x, float y, float z)?baseLocation, bool baseVisible = true) { if (collection is PsbDictionary dic) { if (dic.ContainsKey("frameList") && dic["frameList"] is PsbCollection col) { //Collect Locations var coordObj = col .Where(o => o is PsbDictionary d && d.ContainsKey("content") && d["content"] is PsbDictionary d2 && d2.ContainsKey("coord")) .Select(v => v.Children("content").Children("coord")); if (coordObj.Any()) { var coord = coordObj.First() as PsbCollection; var coordTuple = (x : (float)(PsbNumber)coord[0], y : (float)(PsbNumber)coord[1], z : (float)(PsbNumber)coord[2]); if (baseLocation == null) { //Console.WriteLine($"Set coord: {coordTuple.x},{coordTuple.y},{coordTuple.z}"); baseLocation = coordTuple; } else { var loc = baseLocation.Value; baseLocation = (loc.x + coordTuple.x, loc.y + coordTuple.y, loc.z + coordTuple.z); //Console.WriteLine($"Update coord: {loc.x},{loc.y},{loc.z} -> {baseLocation?.x},{baseLocation?.y},{baseLocation?.z}"); } } //Collect Parts var srcObj = col .Where(o => o is PsbDictionary d && d.ContainsKey("content") && d["content"] is PsbDictionary d2 && d2.ContainsKey("src")) .Select(s => s as PsbDictionary); if (srcObj.Any()) { bool visible = baseVisible; foreach (var obj in srcObj) { var content = (PsbDictionary)obj["content"]; var s = content["src"] as PsbString; var opa = content.ContainsKey("opa") ? (int)(PsbNumber)content["opa"] : 10; var icon = content.ContainsKey("icon") ? content["icon"].ToString() : null; int time = obj["time"] is PsbNumber n ? n.IntValue : 0; bool suggestVisible = baseVisible && time <= 0 && opa > 0; if (s == null || string.IsNullOrEmpty(s.Value)) { continue; } //Krkr if (s.Value.StartsWith("src/")) { //var iconName = dic["icon"].ToString(); var iconName = s.Value.Substring(s.Value.LastIndexOf('/') + 1); var partName = new string(s.Value.SkipWhile(c => c != '/').Skip(1).TakeWhile(c => c != '/') .ToArray()); var res = resources.FirstOrDefault(resMd => resMd.Part == partName && resMd.Name == iconName); if (baseLocation != null && res != null && !Resources.Contains(res)) { var location = baseLocation.Value; //Console.WriteLine($"Locate {partName}/{iconName} at {location.x},{location.y},{location.z}"); res.OriginX = location.x; res.OriginY = location.y; res.ZIndex = location.z; res.Opacity = opa; res.Visible = time <= 0 && visible; Resources.Add(res); } } else if (s.Value.StartsWith("motion/")) { if (baseLocation != null) { var ps = s.Value.Substring("motion/".Length) .Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); Travel( (IPsbCollection)Source.Objects["object"].Children(ps[0]).Children("motion") .Children(ps[1]).Children("layer"), baseLocation, suggestVisible); } } //win else if (!string.IsNullOrEmpty(icon) && ((PsbDictionary)Source.Objects["source"]).ContainsKey(s.Value)) { //src var res = resources.FirstOrDefault(resMd => resMd.Part == s.Value && resMd.Name == icon); if (baseLocation != null && res != null && !Resources.Contains(res)) { var location = baseLocation.Value; //Console.WriteLine($"Locate {partName}/{iconName} at {location.x},{location.y},{location.z}"); res.OriginX = location.x; res.OriginY = location.y; res.ZIndex = location.z; res.Opacity = opa; res.Visible = time <= 0 && visible; Resources.Add(res); } } else if (!string.IsNullOrEmpty(icon) && ((PsbDictionary)Source.Objects["object"]).ContainsKey(s.Value)) { //motion if (baseLocation != null) { Travel( (IPsbCollection)Source.Objects["object"].Children(s.Value).Children("motion") .Children(icon).Children("layer"), baseLocation, suggestVisible); } } } } } if (dic.ContainsKey("children") && dic["children"] is PsbCollection ccol) { Travel(ccol, baseLocation, baseVisible); } if (dic.ContainsKey("layer") && dic["layer"] is PsbCollection ccoll) { Travel(ccoll, baseLocation, baseVisible); } } else if (collection is PsbCollection ccol) { foreach (var cc in ccol) { if (cc is IPsbCollection ccc) { Travel(ccc, baseLocation, baseVisible); } } } } }
public ReceiverLink(Session session, string name, Source source, OnAttached onAttached) : this(session, name, new Attach() { Source = source, Target = new Target() }, onAttached) { }
public TypeName(Source source, DesignerNode node, SnapshotPoint point) : base(source, node, point) { }
public static extern void SourceSetPan(Source source, float pan);
public override Expression Resolve(ParameterExpression inputParameter, Expression expressionToBeResolved, ClauseGenerationContext clauseGenerationContext) { return(Source.Resolve(inputParameter, expressionToBeResolved, clauseGenerationContext)); }
public static extern void SourceDestroy(Source source);
public static extern double SourceGetPosition(Source source);
public static extern void SourcePush3D(Source source, ref Vector3 pos, ref Vector3 forward, ref Vector3 up, ref Vector3 vel, ref Matrix worldTransform);
public static extern bool SourceIsPlaying(Source source);
public static extern void SourceSetGain(Source source, float gain);
public static extern void SourceSetPitch(Source source, float pitch);
public static extern void SourceSetLooping(Source source, bool looped);
public static extern void SourceSetRange(Source source, double startTime, double stopTime);
public static extern void SourcePause(Source source);
public static extern void SourceStop(Source source);
public static extern Buffer SourceGetFreeBuffer(Source source);
public static extern void SourcePlay(Source source);
/// <summary>Find a (conformance) resource based on its canonical uri.</summary> /// <remarks>The source ensures that resolved <see cref="StructureDefinition"/> instances have a snapshot component.</remarks> public Resource ResolveByCanonicalUri(string uri) => ensureSnapshot(Source.ResolveByCanonicalUri(uri));
public static extern void SourceQueueBuffer(Source source, Buffer buffer, IntPtr pcm, int bufferSize, BufferType streamType);
public async Task AddSourceToClusterThenRemoveIt() { //Arrange var store = new { Clusters = new Dictionary <string, Cluster>(), Users = new Dictionary <string, User>(), Sources = new Dictionary <string, Source>(), ClusterSources = new Dictionary <string, string[]>(), ClusterUsers = new Dictionary <string, string[]>() }; var cAdder = new Func <string, Cluster>(n => { store.Clusters.Add(n, Cluster.Create(n)); return(store.Clusters[n]); }); var aAdder = new Func <string, string, Source>((n, d) => { store.Sources.Add(n, Source.Create(n, d)); return(store.Sources[n]); }); var uAdder = new Func <string, User>(n => { store.Users.Add(n, User.Create(n)); return(store.Users[n]); }); var cuAdder = new Func <string, string, Relationship <Cluster, User> >((c, u) => { store.ClusterUsers.Add(c, new[] { u }); var user = store.Users[store.ClusterUsers[c][0]]; var cluster = store.Clusters[c].SetUser(user); store.Clusters[c] = cluster; return(new Relationship <Cluster, User>(cluster, user)); }); var caAdder = new Func <string, string, Relationship <Cluster, Source> >((c, u) => { store.ClusterSources.Add(c, new[] { u }); var app = store.Sources[store.ClusterSources[c][0]]; var cluster = store.Clusters[c].AddSource(app); store.Clusters[c] = cluster; return(new Relationship <Cluster, Source>(cluster, app)); }); var caRemover = new Func <string, string, Relationship <Cluster, Source> >((c, u) => { store.ClusterSources[c] = new[] { u }; var user = store.Sources[u]; return(new Relationship <Cluster, Source>(Cluster.Create(c), user)); }); var sut = new VisibilityHolder(new StubIVisibilityStore { AddClusterStringBoolean = (n, _) => Task.FromResult(new ValueOrError <Cluster>(cAdder(n))), AddUserStringBoolean = (n, _) => Task.FromResult(new ValueOrError <User>(uAdder(n))), AddSourceStringStringBoolean = (n, d, _) => Task.FromResult(new ValueOrError <Source>(aAdder(n, d))), AddUserToClusterStringStringBoolean = (c, u, _) => Task.FromResult(new ValueOrError <Relationship <Cluster, User> >(cuAdder(c, u))), AddSourceToClusterStringStringBoolean = (c, u, _) => Task.FromResult(new ValueOrError <Relationship <Cluster, Source> >(caAdder(c, u))), RemoveSourceFromClusterStringStringBoolean = (c, u, _) => Task.FromResult(new ValueOrError <Relationship <Cluster, Source> >(caRemover(c, u))) }); Delta <Relationship <Cluster, Source> > observed = null; sut.GetClusterSourcesSequence().Subscribe(p => { observed = p; }); var cAnswer = await sut.AddCluster(ClusterName); var uAnswer = await sut.AddUser(UserName); var aAnswer = await sut.AddSource(SourceName, SourceName); Assert.NotNull(cAnswer); Assert.True(cAnswer.HasValue); Assert.NotNull(uAnswer); Assert.True(uAnswer.HasValue); Assert.NotNull(aAnswer); Assert.True(aAnswer.HasValue); //Act var __ = await sut.AddUserToCluster(cAnswer.Value.Name, uAnswer.Value.Name); var ___ = await sut.AddSourceToCluster(cAnswer.Value.Name, aAnswer.Value.SourceId); var caAnswer = await sut.RemoveSourceFromCluster(cAnswer.Value.Name, aAnswer.Value.SourceId); var caCheck = caAnswer.Value.Primary.Sources; //Assert Assert.Equal(ClusterName, caAnswer.Value.Primary.Name); Assert.Equal(SourceName, caAnswer.Value.Secondary.SourceId); Assert.Equal(0, caCheck.Count()); Assert.NotNull(observed); Assert.NotNull(observed.Target); Assert.Equal(ClusterName, observed.Target.Primary.Name); Assert.Equal(SourceName, observed.Target.Secondary.SourceId); Assert.Equal(DeltaType.Removed, observed.Type); }
public ADIFChoose() { InitializeComponent(); choice = Source.LOTW_UPDATE; }
public RtpEL(Source source) : base(LOG_NAME, ".", source.ToString()) { }
private void button2_Click(object sender, EventArgs e) { this.Close(); choice = Source.CANCEL; }