コード例 #1
0
        public static string ToString(cls x)
        {
            switch (x)
            {
            case cls.VM:
                return("VM");

            case cls.Host:
                return("Host");

            case cls.SR:
                return("SR");

            case cls.Pool:
                return("Pool");

            case cls.VMPP:
                return("VMPP");

            case cls.PVS_proxy:
                return("PVS_proxy");

            default:
                return("unknown");
            }
        }
コード例 #2
0
ファイル: cls.cs プロジェクト: ywwseu/xenadmin
        public static string StringOf(this cls x)
        {
            switch (x)
            {
            case cls.VM:
                return("VM");

            case cls.Host:
                return("Host");

            case cls.SR:
                return("SR");

            case cls.Pool:
                return("Pool");

            case cls.VMPP:
                return("VMPP");

            case cls.VMSS:
                return("VMSS");

            case cls.PVS_proxy:
                return("PVS_proxy");

            case cls.VDI:
                return("VDI");

            default:
                return("unknown");
            }
        }
コード例 #3
0
    public static void Main()
    {
        cls c = new cls();

        c.OnWhatever += new OnWhateverDelegate(Whatever);
        c.CallMyDel("test");
    }
コード例 #4
0
        private static void Main(string[] args)
        {
            cls r1 = new cls(10);
            cls r2 = new cls(20);

            stc s1 = new stc(10);
            stc s2 = new stc(20);

            Console.WriteLine("r1.x:{0}, r2.x:{1}, s1.x:{2}, s2.x:{3}", r1.x, r2.x, s1.x, s2.x);


            r1 = r2;
            s1 = s2;

            Console.WriteLine("r1=r2, s1=s2");
            Console.WriteLine("r1.x:{0}, r2.x:{1}, s1.x:{2}, s2.x:{3}", r1.x, r2.x, s1.x, s2.x);


            r2.x = 100;
            s1.x = 200;

            Console.WriteLine("r1=r2, s1=s2");
            Console.WriteLine("r1.x:{0}, r2.x:{1}, s1.x:{2}, s2.x:{3}", r1.x, r2.x, s1.x, s2.x);

            Console.ReadKey();
        }
コード例 #5
0
ファイル: Message.cs プロジェクト: weiling103/xenadmin
 /// <summary>
 ///
 /// First published in XenServer 5.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_cls">The class of object</param>
 /// <param name="_obj_uuid">The uuid of the object</param>
 /// <param name="_since">The cutoff time</param>
 public static Dictionary <XenRef <Message>, Message> get(Session session, cls _cls, string _obj_uuid, DateTime _since)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.message_get(session.opaque_ref, _cls, _obj_uuid, _since));
     }
     else
     {
         return(XenRef <Message> .Create <Proxy_Message>(session.proxy.message_get(session.opaque_ref, cls_helper.ToString(_cls), _obj_uuid ?? "", _since).parse()));
     }
 }
コード例 #6
0
 public Message(string uuid,
                string name,
                long priority,
                cls cls,
                string obj_uuid,
                DateTime timestamp,
                string body)
 {
     this.uuid      = uuid;
     this.name      = name;
     this.priority  = priority;
     this.cls       = cls;
     this.obj_uuid  = obj_uuid;
     this.timestamp = timestamp;
     this.body      = body;
 }
コード例 #7
0
ファイル: cls.cs プロジェクト: huizh/xenadmin
 public static string ToString(cls x)
 {
     switch (x)
     {
         case cls.VM:
             return "VM";
         case cls.Host:
             return "Host";
         case cls.SR:
             return "SR";
         case cls.Pool:
             return "Pool";
         case cls.VMPP:
             return "VMPP";
         default:
             return "unknown";
     }
 }
コード例 #8
0
        static void Main(string[] args)
        {
            stc kareals = new stc();
            cls karealc = new cls();



            Console.Write("Karesi alınacak sayıyı giriniz :");
            int sayi = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("class : sayi * sayi = " + karealc.kare(sayi));



            Console.Write("Karesi alınacak sayıyı giriniz :");
            sayi = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("class : sayi * sayi = " + kareals.kare(sayi));

            Console.ReadKey();
        }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Insert")
        {
            using (dbcms db = new dbcms())
            {
                cls c1     = new cls();
                var footer = ((GridView)sender).FooterRow;
                c1.name        = ((TextBox)footer.Cells[1].FindControl("t1")).Text;
                c1.keywords    = ((TextBox)footer.Cells[1].FindControl("t2")).Text;
                c1.description = ((TextBox)footer.Cells[1].FindControl("t3")).Text;
                string jb = ((DropDownList)footer.Cells[1].FindControl("drop")).Text;
                try
                {
                    c1.sort = Convert.ToInt32(((TextBox)footer.Cells[1].FindControl("t5")).Text);
                }
                catch
                {
                    c1.sort = null;
                }
                clsRepository cr = new clsRepository(db);
                c1.id = cr.MaxId() + 1;

                if (jb != "0")
                {
                    c1.jb = db.cls.Where(d => d.id == Convert.ToInt32(jb)).First().jb + c1.id + "|";
                }
                else
                {
                    c1.jb = c1.id + "|";
                }
                c1.display = true;
                db.cls.InsertOnSubmit(c1);
                db.SubmitChanges();
                GridView1.DataBind();
            }
        }
    }
コード例 #10
0
ファイル: Message.cs プロジェクト: weiling103/xenadmin
 /// <summary>
 ///
 /// First published in XenServer 5.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_name">The name of the message</param>
 /// <param name="_priority">The priority of the message</param>
 /// <param name="_cls">The class of object this message is associated with</param>
 /// <param name="_obj_uuid">The uuid of the object this message is associated with</param>
 /// <param name="_body">The body of the message</param>
 public static XenRef <Message> create(Session session, string _name, long _priority, cls _cls, string _obj_uuid, string _body)
 {
     if (session.JsonRpcClient != null)
     {
         return(session.JsonRpcClient.message_create(session.opaque_ref, _name, _priority, _cls, _obj_uuid, _body));
     }
     else
     {
         return(XenRef <Message> .Create(session.proxy.message_create(session.opaque_ref, _name ?? "", _priority.ToString(), cls_helper.ToString(_cls), _obj_uuid ?? "", _body ?? "").parse()));
     }
 }
コード例 #11
0
 internal void CallParentDel(cls c, string s)
 {
     c.OnWhatever(s);
 }
コード例 #12
0
ファイル: 1acd.cs プロジェクト: Vaibhavvk9611/csharp.netpgms
 static void Main(string[] args)
 {
     Univ u  = new Univ();
     cls  my = new cls();
 }
コード例 #13
0
 public static string extensionCls(this cls c, string s)
 {
     return("extensionCls: " + s);
 }
コード例 #14
0
 /// <summary>
 ///
 /// First published in XenServer 5.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_name">The name of the message</param>
 /// <param name="_priority">The priority of the message</param>
 /// <param name="_cls">The class of object this message is associated with</param>
 /// <param name="_obj_uuid">The uuid of the object this message is associated with</param>
 /// <param name="_body">The body of the message</param>
 public static XenRef <Message> create(Session session, string _name, long _priority, cls _cls, string _obj_uuid, string _body)
 {
     return(XenRef <Message> .Create(session.proxy.message_create(session.uuid, _name ?? "", _priority.ToString(), cls_helper.ToString(_cls), _obj_uuid ?? "", _body ?? "").parse()));
 }
コード例 #15
0
    public static void Main () {
	cls a = new cls ();
	a.I = 10;
	cls b = new cls (a);
	Console.WriteLine (b.I);	    
    }
コード例 #16
0
ファイル: cls.cs プロジェクト: ywwseu/xenadmin
 public static string ToString(cls x)
 {
     return(x.StringOf());
 }
コード例 #17
0
    public cls (cls right) { 
	i = right.i;	    // No Error: Private member of same type is accessible
    }
コード例 #18
0
	static void Main() 
	{
		cls c = new cls();
		c.OnWhatever += new OnWhateverDelegate( Whatever );
		c.CallMyDel( "test" );
	}
コード例 #19
0
 /// <summary>
 ///
 /// First published in XenServer 5.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_name">The name of the message</param>
 /// <param name="_priority">The priority of the message</param>
 /// <param name="_cls">The class of object this message is associated with</param>
 /// <param name="_obj_uuid">The uuid of the object this message is associated with</param>
 /// <param name="_body">The body of the message</param>
 public static XenRef <Message> create(Session session, string _name, long _priority, cls _cls, string _obj_uuid, string _body)
 {
     return(XenRef <Message> .Create(session.proxy.message_create(session.uuid, (_name != null) ? _name : "", _priority.ToString(), cls_helper.ToString(_cls), (_obj_uuid != null) ? _obj_uuid : "", (_body != null) ? _body : "").parse()));
 }
コード例 #20
0
 /// <summary>
 ///
 /// First published in XenServer 5.0.
 /// </summary>
 /// <param name="session">The session</param>
 /// <param name="_cls">The class of object</param>
 /// <param name="_obj_uuid">The uuid of the object</param>
 /// <param name="_since">The cutoff time</param>
 public static Dictionary <XenRef <Message>, Message> get(Session session, cls _cls, string _obj_uuid, DateTime _since)
 {
     return(XenRef <Message> .Create <Proxy_Message>(session.proxy.message_get(session.uuid, cls_helper.ToString(_cls), (_obj_uuid != null) ? _obj_uuid : "", _since).parse()));
 }
コード例 #21
0
		internal void CallParentDel( cls c, string s )
		{
			c.OnWhatever( s );
		}