Inheritance: Foo
コード例 #1
0
ファイル: test.cs プロジェクト: mono/gert
	static void Main ()
	{
		Moo moo = new Moo (ValTyp.Empty);
		Assert.IsFalse (moo.nvt.HasValue, "#1");
		moo = new Moo (ValTyp.Empty);
		Assert.IsFalse (moo.nvt.HasValue, "#2");
	}
コード例 #2
0
ファイル: test.cs プロジェクト: deplinenoise/blobct
        public static void Main(string[] args)
        {
            var m = new Moo();

            var a = new BlobArray<uint>();
            a.Add(89);
            a.Add(99);
            a.Add(109);
            m.Po = a;

            m.Text = "A string!";

            m.Array[0].Meh = 7;
            m.Array[1].Beh = 2.7f;

            m.Array2[0][1] = 2;

            BlobSerializer s = new BlobSerializer();
            s.BigEndian = false;
            s.Write(m);

            using (Stream data = File.OpenWrite("output"))
            using (Stream relocs = File.OpenWrite("output.relocs"))
            {
                s.GenerateOutput(data, relocs);
            }
        }
コード例 #3
0
ファイル: InstallSpec.cs プロジェクト: beccasaurus/mooget
            public void can_install_a_nupkg()
            {
                Moo.Packages.Should(Be.Empty);

                Directory.Exists(PathToTempHome(".moo")).ShouldBeFalse();

                Moo.Install(PathToContent("packages", "MarkdownSharp.1.13.0.0.nupkg"));

                Directory.Exists(PathToTempHome(".moo")).ShouldBeTrue();

                // nupkg should be copied into ~/.moo/cache
                File.Exists(PathToTempHome(".moo", "cache", "MarkdownSharp-1.13.0.0.nupkg")).ShouldBeTrue();

                // nuspec should be copied into ~/.moo/specifications
                File.Exists(PathToTempHome(".moo", "specifications", "MarkdownSharp-1.13.0.0.nuspec")).ShouldBeTrue();

                // bin directory should be created, although MarkdownSharp doesn't have any executables, so it will be empty
                Directory.Exists(PathToTempHome(".moo", "bin")).ShouldBeTrue();

                // it should unpack MarkdownSharp into ~/.moo/packages/
                // we don't currently mess with anything in the nupkg except we don't unpack stupid things like the psmdcp or [Content_Types] or _rels
                // we will probably want to normalize the FrameworkName?
                // NOTE System.Runtime.Versioning.FrameworkName is only available in .NET 4.0 so we need to make our own
                File.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "lib", "35", "MarkdownSharp.dll")).ShouldBeTrue();

                // ignore stupid stuff!
                File.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "[Content_Types].xml")).ShouldBeFalse();
                Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "_rels")).ShouldBeFalse();
                Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0", "package")).ShouldBeFalse();

                Moo.Packages.Count.ShouldEqual(1);
                Moo.Packages.First().Id.ShouldEqual("MarkdownSharp");
            }
コード例 #4
0
ファイル: Program.cs プロジェクト: Sagie-BH/DelegateSummary
        public void BeTrippedOver()
        {
            //if (Moo != null)
            //    //takes in this object(Cow), And No Addindg Information (Empty)
            //    Moo(this, EventArgs.Empty);

            // Same thing - if(?) Moo() not null
            Moo?.Invoke(this, EventArgs.Empty);
        }
コード例 #5
0
            public void can_unpack_a_nupkg_into_the_current_directory()
            {
                Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeFalse();

                // Unpack(nupkg [, directory to unpack into]);
                Moo.Unpack(PathToContent("packages", "MarkdownSharp.1.13.0.0.nupkg"), TempDirectory);

                Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeTrue();
                File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "MarkdownSharp.nuspec")).ShouldBeTrue();
                File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "lib", "35", "MarkdownSharp.dll")).ShouldBeTrue();
            }
コード例 #6
0
            public void unpacks_into_properly_named_directory_even_if_nupkg_is_named_wrong()
            {
                Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeFalse();

                // Unpack(nupkg [, directory to unpack into]);
                Moo.Unpack(PathToContent("packages", "unnamed.nupkg"), TempDirectory);

                Directory.Exists(PathToTemp("MarkdownSharp-1.13.0.0")).ShouldBeTrue();
                File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "MarkdownSharp.nuspec")).ShouldBeTrue();
                File.Exists(PathToTemp("MarkdownSharp-1.13.0.0", "lib", "35", "MarkdownSharp.dll")).ShouldBeTrue();
            }
コード例 #7
0
ファイル: InstallSpec.cs プロジェクト: beccasaurus/mooget
            public void can_uninstall()
            {
                Moo.Install(PathToContent("packages", "MarkdownSharp.1.13.0.0.nupkg"));
                File.Exists(PathToTempHome(".moo", "cache", "MarkdownSharp-1.13.0.0.nupkg")).ShouldBeTrue();
                File.Exists(PathToTempHome(".moo", "specifications", "MarkdownSharp-1.13.0.0.nuspec")).ShouldBeTrue();
                Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0")).ShouldBeTrue();

                Moo.Uninstall("MarkdownSharp");

                File.Exists(PathToTempHome(".moo", "cache", "MarkdownSharp-1.13.0.0.nupkg")).ShouldBeTrue();                 // we keep the cached nupkg
                File.Exists(PathToTempHome(".moo", "specifications", "MarkdownSharp-1.13.0.0.nuspec")).ShouldBeFalse();
                Directory.Exists(PathToTempHome(".moo", "packages", "MarkdownSharp-1.13.0.0")).ShouldBeFalse();
            }
コード例 #8
0
        public static object Run(string[] args)
        {
            var package = Moo.Uninstall(args[0]);

            if (package == null)
            {
                return(string.Format("Package not found: {0}", args[0]));
            }
            else
            {
                return(string.Format("Uninstalled {0}", package.IdAndVersion));
            }
        }
コード例 #9
0
        public void UndefinedTest()
        {
            string u1 = "{}";

            Moo m = JsonUtil.ToObject <Moo>(u1);

            Assert.AreEqual(m.b, null);
            Assert.AreEqual(m.a, null);
            Assert.AreEqual(m.c, null);

            string s = JsonUtil.ToJson(m);

            Assert.AreEqual(s, @"{""a"":null,""b"":null,""c"":null}");
        }
コード例 #10
0
        public void UndefinedTest()
        {
            string u1 = "{}";

            Moo m = Deserialize.To <Moo>(u1);

            Assert.AreEqual(m.b, null);
            Assert.AreEqual(m.a, null);
            Assert.AreEqual(m.c, null);

            string s = Serialize.From(m);

            Assert.AreEqual(s, "{}");
        }
コード例 #11
0
        object Install(string packageName)
        {
            Package package = null;

            if (File.Exists(packageName))
            {
                package = Moo.InstallFromNupkg(packageName);                 // this is a stupid place to pass in DryRun ... we should pass in an object ...
            }
            else
            {
                package = Moo.InstallFromSource(packageName, DryRun);
            }

            if (package == null)
            {
                return(string.Format("Package not found: {0}\n", packageName));
            }
            else
            {
                return(string.Format("Installed {0}\n", package));
            }
        }
コード例 #12
0
ファイル: UnitTest1.cs プロジェクト: Zjonn/University
 public Boo(Moo m)
 {
     this.m = m;
 }
コード例 #13
0
 static void Test1()
 {
     Console.WriteLine("----Test1");
     Moo <Test> moo = new Moo <Test>();
 }
コード例 #14
0
            public ItemView()
            {
                var change = CreateButton("Change", "Change", (items, index) => items[index] = new Moo());

                var removeBar = new StackLayout {
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        CreateButton("- Left",  "RemoveLeft",  (items, index) => items.RemoveAt(index - 1)),
                        CreateButton("Remove",  "Remove",      (items, index) => items.RemoveAt(index)),
                        CreateButton("- Right", "RemoveRight", (items, index) => items.RemoveAt(index + 1)),
                    }
                };

                var addBar = new StackLayout {
                    Orientation       = StackOrientation.Horizontal,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    Children          =
                    {
                        CreateButton("+ Left",          "AddLeft",  (items, index) => items.Insert(index, new Moo())),
                        CreateButton("+ Right",         "AddRight", (items, index) => {
                            if (index == items.Count - 1)
                            {
                                items.Add(new Moo());
                            }
                            else
                            {
                                items.Insert(index + 1, new Moo());
                            }
                        }),
                    }
                };

                var typeNameLabel = new Label()
                {
                    StyleId = "typename"
                };

                typeNameLabel.SetBinding(Label.TextProperty, nameof(Item.TypeName));

                var idLabel = new Label()
                {
                    AutomationId = "ItemId",
                    StyleId      = "id",
                    TextColor    = Color.White
                };

                idLabel.SetBinding(Label.TextProperty, nameof(Item.Id));

                Content = new StackLayout {
                    Children =
                    {
                        typeNameLabel,
                        idLabel,
                        change,
                        removeBar,
                        addBar,
                    }
                };

                PropertyChanged += (s, e) => {
                    if (e.PropertyName == "TextColor")
                    {
                        typeNameLabel.TextColor = TextColor;
                    }
                };
            }
コード例 #15
0
 static void Main()
 {
     Moo <Test> moo = new Moo <Test> ();
 }
コード例 #16
0
 public void CowChecker()
 {
     Moo?.Invoke(this, new CowEventsArgs(CowState.Awake));
 }
コード例 #17
0
        public static object Run(string[] args)
        {
            var package = Moo.Unpack(args[0]);

            return(string.Format("Unpacked {0}", package.IdAndVersion));
        }