Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("BlahId,BlahValue")] Blah blah)
        {
            if (id != blah.BlahId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _uow.Blahs.Update(blah);
                    await _uow.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BlahExists(blah.BlahId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(blah));
        }
Exemple #2
0
    public static int Test1()
    {
        Blah f = new Blah();

        MyDelegate del = new MyDelegate(f.Foo);

        MyDelegate another = new MyDelegate(del);

        int number = del(2, 3);

        int i = another(4, 6);

        Console.WriteLine("Delegate invocation of one returned : " + number);

        Console.WriteLine("Delegate invocation of the other returned : " + i);

        if (number == 5 && i == 10)
        {
            return(0);
        }
        else
        {
            return(1);
        }
    }
 static void Main()
 {
     using (Blah b = new Blah())
     {
         Console.WriteLine("...");
     }
 }
    public static Blah Deserialize()
    {
        var b = new Blah();

        b.DoSomething(default(StreamingContext));
        return(b);
    }
 public static void ActUpon(IGenericAction action)
 {
     if (action.Act <T>())
     {
         Blah <Blah <T> > .ActUpon(action);
     }
 }
Exemple #6
0
        public static void Main(string[] args)
        {
            Form           f    = new Form();
            DictionaryGrid grid = new DictionaryGrid();

            grid.Dock = DockStyle.Fill;
            f.Controls.Add(grid);

            Blah blah = new Blah();

            grid.ValueAdded   += new DictionaryValueAddedHandler(blah.RowAdded);
            grid.ValueChanged += new DictionaryValueChangeHandler(blah.RowChanged);
            grid.ValueDeleted += new DictionaryValueDeleteHandler(blah.RowRemoved);

            Application.Run(f);

            Console.WriteLine("this.values");
            Console.WriteLine("-----------");
            foreach (DictionaryEntry entry in grid.values)
            {
                Console.WriteLine("{0} => {1}", entry.Key, entry.Value);
            }

            Console.WriteLine("blah.dict");
            Console.WriteLine("---------");
            foreach (DictionaryEntry entry in blah.dict)
            {
                Console.WriteLine("{0} => {1}", entry.Key, entry.Value);
            }
        }
	static int Main ()
	{
		Blah a = new Blah ("abc", 1);
		Blah b = new Blah ("ab" + 'c', 1);
		long start, end;
		start = Environment.TickCount;

		start = Environment.TickCount;
		for (int i = 0; i < 1000000; i++)
			a.GetHashCode ();
		end = Environment.TickCount;
		Console.WriteLine ("struct common GetHashCode(): {0}", end-start);

		start = Environment.TickCount;
		for (int i = 0; i < 1000000; i++)
			a.Equals (b);
		end = Environment.TickCount;
		Console.WriteLine ("struct common Equals(): {0}", end-start);

		Blah2 a2 = new Blah2 ("abc", 1);
		Blah2 b2 = new Blah2 ("abc", 1);
		start = Environment.TickCount;
		for (int i = 0; i < 1000000; i++)
			a2.GetHashCode ();
		end = Environment.TickCount;
		Console.WriteLine ("struct specific GetHashCode(): {0}", end-start);

		start = Environment.TickCount;
		for (int i = 0; i < 1000000; i++)
			a2.Equals (b2);
		end = Environment.TickCount;
		Console.WriteLine ("struct specific Equals(): {0}", end-start);

		return 0;
	}
Exemple #8
0
        public static PrtSpecMachine CreateSpec_Blah(StateImpl application)
        {
            var machine = new Blah(application);

            ((machine).observes).Add(Events_1528637394.Ping);
            return(machine);
        }
Exemple #9
0
        public void Test1()
        {
            // backing storage device
            using var log   = Devices.CreateLogDevice("hlog2.log");
            using var store = new FasterKV <long, Blah>
                              (
                      1L << 20, // hash table size (number of 64-byte buckets)
                          new LogSettings { LogDevice = log } // log settings (devices, page size, memory size, etc.)
                              );

            // Create a session per sequence of interactions with FASTER
            // We use default callback functions with a custom merger:
            //   RMW merges input by adding it to value
            using var s = store.NewSession
                          (
                      new SimpleFunctions <long, Blah>((a, b) => a + b)
                          );

            long key = 1;
            Blah value = 1, input = 10, output = 0;

            // Upsert and Read
            s.Upsert(ref key, ref value);
            s.Read(ref key, ref output);
            Debug.Assert(output == value);

            // Read-Modify-Write (add input to value)
            s.RMW(ref key, ref input);
            s.RMW(ref key, ref input);
            s.Read(ref key, ref output);
            Debug.Assert(output == value + 20);

            Console.WriteLine("Success!");
        }
Exemple #10
0
    public static int Main()
    {
        Blah b = new Blah();

        b.table.Add("Ravi", (IFoo)b);

        return(0);
    }
Exemple #11
0
	public static int Main ()
	{
		Blah b = new Blah ();

		b.table.Add ("Ravi", (IFoo) b);

		return 0;
	}
    public static int Main()
    {
        Blah k;

        k = new Blah();

        float f = (float)k;
    }
Exemple #13
0
                public override void Execute(StateImpl application, PrtMachine _parent)
                {
                    Blah             parent  = (Blah)(_parent);
                    PrtFunStackFrame currFun = parent.PrtPopFunStackFrame();
                    PrtValue         swap;

                    parent.PrtFunContReturn(null);
                }
Exemple #14
0
	public static int Main ()
	{
		Blah k;
		
		k = new Blah ();
		
		float f = (float) k;
		
	}
Exemple #15
0
        public async Task <IActionResult> Create([Bind("BlahId,BlahValue")] Blah blah)
        {
            if (ModelState.IsValid)
            {
                _uow.Blahs.Add(blah);
                await _uow.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(blah));
        }
Exemple #16
0
    public static int Main()
    {
        var r = new Blah <ulong> .WrapperWrapper <byte>().NewWrapperWrapper(Wrapper <byte> .Empty);

        if (r == null)
        {
            return(1);
        }

        return(0);
    }
    public static int Main()
    {
        Blah k = new Blah();

        Foo f = k;

        object o = k;

        if (f is Foo)
        {
            Console.WriteLine("I am a Foo!");
        }

        Hello ihello = f;

        Another ianother = f;

        ihello = ianother;

        bool b = f.MyMethod(22);

        MyDelegate del = new MyDelegate(k.Bar);

        del(2, 3);

        Delegate tmp = del;

        // Explicit reference conversions

        MyDelegate adel = (MyDelegate)tmp;

        adel(4, 7);

        Blah l = (Blah)o;

        l.Bar(20, 30);

        l = (Blah)f;

        l.Bar(2, 5);

        f = (Foo)ihello;

        // The following cause exceptions even though they are supposed to work
        // according to the spec

        // This one sounds ridiculous !
        // ITest t = (ITest) l;

        // ITest u = (ITest) ihello;

        return(0);
    }
Exemple #18
0
	public static int Main ()
	{
		Blah k = new Blah ();

		Foo f = k;

		object o = k;

		if (f is Foo)
			Console.WriteLine ("I am a Foo!");

		Hello ihello = f;

		Another ianother = f;

		ihello = ianother; 

		bool b = f.MyMethod (22);

		MyDelegate del = new MyDelegate (k.Bar);

		del (2, 3);
		
		Delegate tmp = del;

		// Explicit reference conversions
		
		MyDelegate adel = (MyDelegate) tmp;

		adel (4, 7);

		Blah l = (Blah) o;

		l.Bar (20, 30);

		l = (Blah) f;

		l.Bar (2, 5);

		f = (Foo) ihello;

		// The following cause exceptions even though they are supposed to work
		// according to the spec

		// This one sounds ridiculous !
		// ITest t = (ITest) l;
		
		// ITest u = (ITest) ihello;

		return 0;

	}
Exemple #19
0
 public static int Main ()
 {
  Blah k = new Blah ();

  float f = k;

  if (f == 2){
   Console.WriteLine ("Best implicit operator selected correctly");
   return 0;
  }
  return 1;

 }
Exemple #20
0
	public static int Main ()
	{
		Blah i = new Blah ();
		MyDelegate del = new MyDelegate (i.Foo);

		int number = del (2);

		Console.WriteLine (number);
		if (number != 9)
			return 1;

		return 0;
	}
Exemple #21
0
    public static int Main()
    {
        Blah k = new Blah();

        float f = k;

        if (f == 2)
        {
            Console.WriteLine("Best implicit operator selected correctly");
            return(0);
        }
        return(1);
    }
Exemple #22
0
	public static int Main ()
	{
		Blah k = new Blah ();

		Foo i = k;

		if (i.MyMethod ())
			return 0;
		else
			return 1;
			       

	}
Exemple #23
0
	public static int Main ()
	{
		Blah i = new Blah ();

		MyDelegate del = new MyDelegate (i.Foo);

		int number = del (2);

		if (number == 5)
			return 0;
		else
			return 1;

	}
Exemple #24
0
    public static int Main()
    {
        Blah k = new Blah();

        Foo i = k;

        if (i.MyMethod())
        {
            return(0);
        }
        else
        {
            return(1);
        }
    }
Exemple #25
0
    public static int Main()
    {
        Blah       i   = new Blah();
        MyDelegate del = new MyDelegate(i.Foo);

        int number = del(2);

        Console.WriteLine(number);
        if (number != 9)
        {
            return(1);
        }

        return(0);
    }
    public static int Main()
    {
        Blah b = new Blah();

        b.Connect();

        b.Button1.OnClick(2, 3);

        b.Disconnect();

        Console.WriteLine("Now calling OnClick again");
        b.Button1.OnClick(3, 7);

        Console.WriteLine("Events test passes");
        return(0);
    }
Exemple #27
0
	public static int Main ()
	{
		int [][] i = new int [2][];

		int [,][] j = new int [3,6][];

		Blah [] k = new Blah [2];

		Blah [,][] l = new Blah [3,4][];

		//Uri [] uri = new Uri [4];

		Console.WriteLine ("All arrays successfully created");

		return 0;
	}
Exemple #28
0
        static void Main(string[] args)
        {
            Car  car1  = new Car();
            Bike bike1 = new Bike();

            car1.SetSpeedAndPassengers(50, 4);
            bike1.SetSpeedAndPassengers(30, 1);

            Blah message = new Blah(car1.Message);

            string delegateMessage = message();

            Console.WriteLine(delegateMessage);

            Console.ReadLine();
        }
Exemple #29
0
	public static int Main ()
	{
		Blah b = new Blah ();

		b.Connect ();

		b.Button1.OnClick (2, 3);

		b.Disconnect ();

		Console.WriteLine ("Now calling OnClick again");
		b.Button1.OnClick (3, 7);

		Console.WriteLine ("Events test passes");
		return 0;
	}
Exemple #30
0
    public static int Main()
    {
        int [][] i = new int [2][];

        int [, ][] j = new int [3, 6][];

        Blah [] k = new Blah [2];

        Blah [, ][] l = new Blah [3, 4][];

        Uri [] uri = new Uri [4];

        Console.WriteLine("All arrays successfully created");

        return(0);
    }
    public static int Main()
    {
        Blah i = new Blah();

        MyDelegate del = new MyDelegate(i.Foo);

        int number = del(2, "a string");

        if (number == 5)
        {
            return(0);
        }
        else
        {
            return(1);
        }
    }
    static int Main()
    {
        Blah a = new Blah("abc", 1);
        Blah b = new Blah("ab" + 'c', 1);
        long start, end;

        start = Environment.TickCount;

        start = Environment.TickCount;
        for (int i = 0; i < 1000000; i++)
        {
            a.GetHashCode();
        }
        end = Environment.TickCount;
        Console.WriteLine("struct common GetHashCode(): {0}", end - start);

        start = Environment.TickCount;
        for (int i = 0; i < 1000000; i++)
        {
            a.Equals(b);
        }
        end = Environment.TickCount;
        Console.WriteLine("struct common Equals(): {0}", end - start);

        Blah2 a2 = new Blah2("abc", 1);
        Blah2 b2 = new Blah2("abc", 1);

        start = Environment.TickCount;
        for (int i = 0; i < 1000000; i++)
        {
            a2.GetHashCode();
        }
        end = Environment.TickCount;
        Console.WriteLine("struct specific GetHashCode(): {0}", end - start);

        start = Environment.TickCount;
        for (int i = 0; i < 1000000; i++)
        {
            a2.Equals(b2);
        }
        end = Environment.TickCount;
        Console.WriteLine("struct specific Equals(): {0}", end - start);

        return(0);
    }
        public void Test1()
        {
            var container = new SerializationContainer();

            var sr = container.Add(new JsonContractSerializer());

            container.Start();

            var test = new Blah {
                Message = "Hmm"
            };

            var blob = container.PayloadSerialize(test);

            var resolve = container.PayloadDeserialize <Blah>(blob);

            Assert.AreEqual(test, resolve);
        }
Exemple #34
0
        public void Test1()
        {
            var container = new ServiceHandlerContainer();

            var sr = container.Serialization.Add(new JsonContractSerializer());

            container.Start();

            var test = new Blah {
                Message = "Hmm"
            };

            var blob = container.Serialization.SerializeToBlob(test);

            var resolve = container.Serialization.DeserializeToObject <Blah>(blob);

            Assert.AreEqual(test, resolve);
        }
Exemple #35
0
	public static int Test1 ()
	{
		Blah f = new Blah ();

		MyDelegate del = new MyDelegate (f.Foo);

		MyDelegate another = new MyDelegate (del);

		int number = del (2, 3);

		int i = another (4, 6);
		
		Console.WriteLine ("Delegate invocation of one returned : " + number);

		Console.WriteLine ("Delegate invocation of the other returned : " + i);

		if (number == 5 && i == 10)
			return 0;
		else
			return 1;
	}
Exemple #36
0
	public static void Main () {
		using (Blah b = new Blah ()) {
			Console.WriteLine ("...");
		}
	}
Exemple #37
0
 public static void Main()
 {
     Blah b = new Blah();
 }
        public void PipelineAI1()
        {
            try
            {
                var pipeline = new MicroservicePipeline("TestPipeline");

                IPipelineChannelIncoming <MicroservicePipeline> cpipeIn  = null;
                IPipelineChannelOutgoing <MicroservicePipeline> cpipeOut = null;

                PersistenceInternalService <Guid, Blah> persistence = null;
                PersistenceBlahMemory persistBlah = null;
                int signalChange = 0;

                pipeline
                .AdjustPolicyTaskManager((t, c) =>
                {
                    t.ConcurrentRequestsMin = 1;
                    t.ConcurrentRequestsMax = 4;
                })
                .CallOut(ConfigureServiceRoot)
                .AddChannelIncoming("internalIn", internalOnly: true)
                .CallOut(ChannelInConfigure)
                .AttachCommand(new PersistenceBlahMemory(), assign: (p) => persistBlah = p)
                .AttachCommand(new PersistenceInternalService <Guid, Blah>(), assign: (c) => persistence = c, channelResponse: cpipeOut)
                .CallOut((c) => cpipeIn = c)
                .Revert()
                .AddChannelOutgoing("internalOut", internalOnly: true)
                .CallOut((c) => cpipeOut = c)
                .Revert();

                persistBlah.OnEntityChangeAction += ((o, e) => { signalChange++; });

                pipeline.Start();


                Guid cId  = Guid.NewGuid();
                var  blah = new Blah {
                    ContentId = cId, Message = "Hello", VersionId = Guid.NewGuid()
                };
                var result = persistence.Create(blah).Result;
                Assert.IsTrue(result.IsSuccess);

                var result2 = persistence.Read(cId).Result;
                Assert.IsTrue(result2.IsSuccess);

                blah.VersionId = Guid.NewGuid();
                var result3 = persistence.Update(blah).Result;
                Assert.IsTrue(result3.IsSuccess);

                var result4 = persistence.Delete(blah.ContentId).Result;
                Assert.IsTrue(result4.IsSuccess);


                Assert.IsTrue(signalChange == 3);
                pipeline.Stop();
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
	public static void Main ()
	{
		Blah b = new Blah ();
	}
	static int Main ()
	{
		Blah b = new Blah (Blah.Operator.A);

		return 0;
	}
        static void addImportGroup(ProjectRootElement root, string label, string condition, Blah blah)
        {
            var avar = root.CreateImportGroupElement();

            root.AppendChild(avar);
            if (!string.IsNullOrEmpty(label))
                avar.Label = label;
            if (!string.IsNullOrEmpty(condition))
                avar.Condition = condition;
            if (blah != null)
                blah(root, avar);
        }
Exemple #42
0
        private void ClickShowdownImportPKMModded(object sender, EventArgs e)
        {
            if (!Clipboard.ContainsText())
            {
                WinFormsUtil.Alert("Clipboard does not contain text."); return;
            }

            if (!Directory.Exists(MGDatabasePath))
            {
                Directory.CreateDirectory(MGDatabasePath);
            }

            int    TID           = -1;
            int    SID           = -1;
            string OT            = "";
            int    gender        = 0;
            string Country       = "";
            string SubRegion     = "";
            string ConsoleRegion = "";

            if (File.Exists(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\trainerdata.txt"))
            {
                string   text  = File.ReadAllText(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\trainerdata.txt", System.Text.Encoding.UTF8);
                string[] lines = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
                TID = Convert.ToInt32(lines[0].Split(':')[1].Trim());
                SID = Convert.ToInt32(lines[1].Split(':')[1].Trim());
                OT  = lines[2].Split(':')[1].Trim();
                if (lines[3].Split(':')[1].Trim() == "F" || lines[3].Split(':')[1].Trim() == "Female")
                {
                    gender = 1;
                }
                try
                {
                    Country       = lines[4].Split(':')[1].Trim();
                    SubRegion     = lines[5].Split(':')[1].Trim();
                    ConsoleRegion = lines[6].Split(':')[1].Trim();
                }
                catch { }
            }

            string source = Clipboard.GetText().TrimEnd();

            string[] stringSeparators = new string[] { "\n\r" };
            string[] result;

            // ...
            result = source.Split(stringSeparators, StringSplitOptions.None);
            Console.WriteLine(result.Length);

            if (result.Length > 1)
            {
                for (int i = 0; i < result.Length; i++)
                {
                    ShowdownSet Set = new ShowdownSet(result[i]);
                    if (Set.InvalidLines.Any())
                    {
                        WinFormsUtil.Alert("Invalid lines detected:", string.Join(Environment.NewLine, Set.InvalidLines));
                    }

                    // Set Species & Nickname
                    bool resetForm = false;
                    PKME_Tabs.hardReset();
                    if (Set.Form == null)
                    {
                    }
                    else if (Set.Form.Contains("Mega") || Set.Form == "Primal" || Set.Form == "Busted")
                    {
                        resetForm = true;
                        Console.WriteLine(Set.Species);
                    }
                    PKME_Tabs.LoadShowdownSet(Set);
                    PKM p = PreparePKM();
                    p.Version = (int)GameVersion.MN;
                    Blah b     = new Blah();
                    PKM  legal = b.LoadShowdownSetModded_PKSM(p, Set, resetForm, TID, SID, OT, gender);
                    PKME_Tabs.PopulateFields(legal);
                    if (Country != "" && SubRegion != "" && ConsoleRegion != "")
                    {
                        PKME_Tabs.SetRegions(Country, SubRegion, ConsoleRegion);
                    }
                    PKM pk = PreparePKM();
                    PKME_Tabs.ClickSet(C_SAV.Box.SlotPictureBoxes[0], i);
                }
            }
            else
            {
                // Get Simulator Data
                ShowdownSet Set = new ShowdownSet(Clipboard.GetText());

                if (Set.Species < 0)
                {
                    WinFormsUtil.Alert("Set data not found in clipboard."); return;
                }

                if (Set.Nickname?.Length > C_SAV.SAV.NickLength)
                {
                    Set.Nickname = Set.Nickname.Substring(0, C_SAV.SAV.NickLength);
                }

                if (DialogResult.Yes != WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Import this set?", Set.Text))
                {
                    return;
                }

                if (Set.InvalidLines.Any())
                {
                    WinFormsUtil.Alert("Invalid lines detected:", string.Join(Environment.NewLine, Set.InvalidLines));
                }

                // Set Species & Nickname
                //PKME_Tabs.LoadShowdownSet(Set);
                bool resetForm = false;
                PKME_Tabs.hardReset();
                if (Set.Form == null)
                {
                }
                else if (Set.Form.Contains("Mega") || Set.Form == "Primal" || Set.Form == "Busted")
                {
                    resetForm = true;
                    Console.WriteLine(Set.Species);
                }
                PKME_Tabs.LoadShowdownSet(Set);
                PKM p = PreparePKM();
                p.Version = (int)GameVersion.MN;
                Blah b     = new Blah();
                PKM  legal = b.LoadShowdownSetModded_PKSM(p, Set, resetForm, TID, SID, OT, gender);
                PKME_Tabs.PopulateFields(legal);
                if (Country != "" && SubRegion != "" && ConsoleRegion != "")
                {
                    PKME_Tabs.SetRegions(Country, SubRegion, ConsoleRegion);
                }
            }
        }
Exemple #43
0
 public ScopedBlahUser(Blah blah)
 {
     Blah = blah;
 }
Exemple #44
0
 public SingletonBlahUser(Blah blah)
 {
     Blah = blah;
 }
Exemple #45
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
   Blah ex = new Blah();
   ex.Data = "example...";
   DataContext = ex;
 }
 public FooFactory()
 {
     FooX = new Foo();
     Blah = new Blah();
 }
Exemple #47
0
	public static void Main ()
	{
		Blah i = new Blah ();

		MyDelegate del = new MyDelegate ();
	}