public PeopleController(ApplicationDbContext context, DbSetCachingService <Person> cachingService, MemoryCacheManager cacheManager, ISimple simple) { _context = context; _dbCs = cachingService; _cacheManager = cacheManager; _simple = simple; }
public void ShouldAllowPassingDifferentObjectsAndPrimitivesThroughParameters ( [Any] int anInt, [Any] int anInt2, [Any] string aString, [Any] ISimple interfaceImplementation, [Any] IEnumerable <int> anEnumerable, [Any] List <string> concreteList, [Any] IEnumerable <ISimple> interfaceImplementationList, [Any] ProperValueType value //, //[AnyOtherThan(3,4)] int nonThree ) { XAssert.NotEqual(default(int), anInt); XAssert.NotEqual(anInt2, anInt); Assert.False(string.IsNullOrEmpty(aString)); Assert.NotNull(interfaceImplementation); Assert.Greater(anEnumerable.Count(), 0); Assert.Greater(concreteList.Count(), 0); Assert.Greater(concreteList.Count(), 0); Assert.Greater(interfaceImplementationList.Count(), 0); Assert.NotNull(interfaceImplementationList.ToArray()[0]); Assert.NotNull(interfaceImplementationList.ToArray()[1]); Assert.NotNull(interfaceImplementationList.ToArray()[2]); Assert.NotNull(value); //XAssert.NotEqual(3, nonThree); }
static void Main(string[] args) { ServiceHost simpleHost = new ServiceHost(typeof(SimpleService), new Uri("http://localhost/Simple")); simpleHost.Open(); ChannelFactory <ISimple> factory = new ChannelFactory <ISimple>(simpleHost.Description.Endpoints[0]); ISimple proxy = factory.CreateChannel(); Logger.Debug("Calling Work..."); var response1 = proxy.Work(new Request() { Name = "Foo" }); Logger.Debug("Work() returned Success=" + response1.Success + " message='" + response1.ErrorMessage + "'"); Logger.Debug("Calling Fail..."); var response2 = proxy.Fail(new Request() { Name = "FooBar" }); Logger.Debug("Fail() returned Success=" + response2.Success + " message='" + response2.ErrorMessage + "'"); Console.WriteLine("Press ENTER to close the host."); Console.ReadLine(); ((ICommunicationObject)proxy).Shutdown(); simpleHost.Shutdown(); }
public void TestTheBasics() { ISimple class1 = GoInterface <ISimple, SimpleClass> .From(new SimpleClass()); ISimple iface1 = GoInterface <ISimple, IDifferentName> .From(new SimpleClass()); ISimple struct1 = GoInterface <ISimple, SimpleStruct> .From(new SimpleStruct(10)); Assert.AreEqual(25, class1.Mutate(5)); Assert.AreEqual(25, iface1.Mutate(5)); Assert.AreEqual(70, struct1.Mutate(7)); SimpleBase class2 = GoInterface <SimpleBase, SimpleClass> .From(new SimpleClass()); SimpleBase iface2 = GoInterface <SimpleBase, IDifferentName> .From(new SimpleClass()); SimpleBase struct2 = GoInterface <SimpleBase, SimpleStruct> .From(new SimpleStruct(10)); for (int i = 0; i < 10; i++) { Assert.AreEqual(class1.Mutate(i), class2.Mutate(i)); Assert.AreEqual(iface1.Mutate(i), iface2.Mutate(i)); Assert.AreEqual(struct1.Mutate(i), struct2.Mutate(i)); } Assert.AreEqual("forwarded!", struct1.ToString()); Assert.AreEqual("forwarded!", struct2.ToString()); Assert.AreEqual(struct1.GetHashCode(), struct2.GetHashCode()); // Note that struct1.Equals(struct2) returns FALSE because struct2 is // not "really" a SimpleStruct. We must "unwrap" the right-hand side: Assert.That(struct1.Equals(GoInterface.Unwrap(struct2))); Assert.That(struct2.Equals(GoInterface.Unwrap(struct1))); }
public void PlaceFindedCard(GwentCard Card, ISimple SimpleCard) { if (Card is IPlaceable) { Card.CardLine = (SimpleCard.CardLine + 3); if (Card.CardLine > 6) { Card.CardLine = Card.CardLine % 6; } if (!SimpleCard.IsRemoved) { (Card as IPlaceable).PlaceCard(this); } else { RemoveFromLine(Card.CardLine, Card, SimpleCard.IsToUsed); } } else { AddWeatherCard(Card); } this.SelectedCardID = -1; this.AffectedCardID = -1; }
private void ProcessSimple(Package pkg, ISimple Simple) { battlegnd.Control.Dispatcher.Invoke(() => { battlegnd.CardArived(Simple); }); SendGoodCommand(); }
public void CardArived(ISimple SimpleCard) { this.AffectedCardID = SimpleCard.AffectedCardPos; GwentCard FindedCard = GetCardByID(SimpleCard.CardID); GwentCard Card = CopyGwentCard(FindedCard); Card.IsSpecialAbilitiPerformed = Card.WhenSendIsPerformed; PlaceFindedCard(Card, SimpleCard); }
public void AddFigure(ISimple figure) { for (int i = 0; i < _simples.Length; i++) { if (_simples[i] == null) { _simples[i] = figure; break; } } }
public ObjectWithInterfaceInConstructor( int a, ISimple constructorArgument, string b, ObjectWithInterfaceInConstructor constructorNestedArgument) { _a = a; ConstructorArgument = constructorArgument; _b = b; ConstructorNestedArgument = constructorNestedArgument; }
private void ProcessPackage(Package pkg, Battleground battlegnd) { if (pkg is ICommandable) { ICommandable Command = pkg as ICommandable; ProcessCommand(pkg, Command); } if (pkg is ISimple) { ISimple Simple = pkg as ISimple; ProcessSimple(pkg, Simple); } }
static void Main(string[] args) { //SimpleExample simEx = new SimpleExample(); //simEx.SimpleFunc(); //simEx.ExampleFunc(); //using Runtime polmorphism.. IExample ex = new SimpleExample(); ex.ExampleFunc(); //ISimple sim = new SimpleExample(); ISimple sim = (ISimple)ex;//UR object will be now behave like ISimple so that it retains the data U have set using the IExample object. In other words, U share the same object in the form of sim. sim.SimpleFunc(); }
static void Main(string[] args) { ServiceHost simpleHost = new ServiceHost(typeof(SimpleService), new Uri("http://localhost/Simple")); simpleHost.Open(); ChannelFactory <ISimple> factory = new ChannelFactory <ISimple>(simpleHost.Description.Endpoints[0]); factory.Endpoint.EndpointBehaviors.Add(new OperationLoggerEndpointBehavior()); ISimple proxy = factory.CreateChannel(); proxy.DoSomthing("hi"); Console.WriteLine("Press ENTER to close the host."); Console.ReadLine(); ((ICommunicationObject)proxy).Shutdown(); simpleHost.Shutdown(); }
public NeedsBoth(ISimple a, IWithValue b) { _a = a; _b = b; }
public NeedsSimple(ISimple a) { _a = a; }
public NeedsSome(ISimple a, IWithValue b) { _a = a; _b = b; }
public NeedsAny(ISimple a, IWithValue b) { _a = a; _b = b; }
public ConstructorArgTest(ISimple simple, string arg1, string arg2) => Text = $"{simple.Name} {arg1} {arg2}";
public ComplexDependency(ISimple simple, IEnumerable <ISimple> simples) { Simple = simple; Simples = simples; }
internal override void GenCode0(CodeGenContext context) { context.newLine(location); SetLine(context); if (args == null) args = ParentArgs(context); // object arguments = args; bool created; arguments = args.GenArgList(context, out created); if (parent_scope is BLOCK) { arguments.GenSimple(context); LoadBlock(context); context.stfld(Runtime.ArgList.block); } GenCall(context); context.ReleaseLocal(arguments, created); }
public SimpleTypeDecorator(ISimple <T> inner) { _inner = inner; }
internal override void GenCode0(CodeGenContext context) { context.newLine(location); SetLine(context); // Ruby.ArgList arguments = args; bool created; arguments = args.GenArgList(context, out created); GenCall(context); context.ReleaseLocal(arguments, created); }
public Complex(Simple simple, ISimple iSimple, Func <Simple> complexClassFactory) { }
public NeedsSimpleOptional(ISimple a) { _a = a; }
public TypeWithTwoConstructors(ISimple argOne, IAnother argTwo, string somethingElse) { }
public NeedsAny(ISimple a) { _a = a; }
public ComplexBeast(ISimple simple) { this.Simple = simple; }
public Level2(ISimple simple) { }
internal override void GenCode0(CodeGenContext context) { if (Scanner.is_identchar(method_id[0])) context.newLine(location); SetLine(context); bool self_created, arguments_created = false; if (isVarAccess) { context.ldloc(0); context.call(Runtime.Frame.SetCallStatusVCall); } else { context.ldloc(0); context.call(Runtime.Frame.SetCallStatusNone); } // object self = receiver; self = context.PreCompute(receiver, "receiver", out self_created); if (args.ShortAndSimple()) fixed_arguments = args.GenFixedArgs(context, out fixed_created); else arguments = args.GenArgList(context, out arguments_created); GenCall(context); context.ReleaseLocal(self, self_created); if (args.ShortAndSimple()) for (int i = 0; i < fixed_created.Count; i++) context.ReleaseLocal(fixed_arguments[i], fixed_created[i]); else context.ReleaseLocal(arguments, arguments_created); }
internal void AssignOp(CodeGenContext context, string op, Node rhs) { // object a = array; bool a_created; ISimple a = context.PreCompute(array, "array", out a_created); // ArgList index = args; bool index_created; index = args.GenArgList(context, out index_created); // access <=> a[index]; ARRAY_ACCESS access = new ARRAY_ACCESS((Node)a, new ProxyList(Index, location), location); // access1 = (access2 op rhs); access.Assign(context, METHOD_CALL.Create(access, op, rhs, location)); context.ReleaseLocal(a, a_created); context.ReleaseLocal(index, index_created); }
public MyService(IDependency dependency, ISimple simple) { _dependency = dependency; _simple = simple; }
public Another(ISimple simple) { Dependent = simple; }
public TypeWithTwoConstructors(ISimple argOne, IAnother argTwo) { _argOne = argOne; _argTwo = argTwo; }
public AdvancedAdapter(ISimple simplemedia) { this.simplemedia = simplemedia; }