Exemplo n.º 1
0
        public string NesneBilgileri(myPanel nesne)
        {
            JsonNesnem jsondata = new JsonNesnem();

            jsondata.NesneTipi         = nesne.GetType().ToString();
            jsondata.Name              = nesne.Name;
            jsondata.GosterilecekMetin = nesne.GosterilecekMetin;
            jsondata.YapilacakIslem    = nesne.YapilacakIslem;
            try
            {
                jsondata.Next1 = nesne.Next1.Name;
            }
            catch (Exception)
            {
                jsondata.Next1 = "";
            }

            if (nesne.GetType() == typeof(for_) || nesne.GetType() == typeof(Eger))
            {
                try
                {
                    jsondata.Next2 = nesne.Next2.Name;
                }
                catch (Exception)
                {
                    jsondata.Next2 = "";
                }
            }
            else
            {
                jsondata.Next2 = "";
            }

            jsondata.Width  = nesne.Width;
            jsondata.Height = nesne.Height;
            jsondata.Top    = nesne.Top;
            jsondata.Left   = nesne.Left;
            if (nesne.GetType() == typeof(Giris))
            {
                jsondata.DegiskenAdi = ((Giris)nesne).DegiskenAdi;
            }
            else if (nesne.GetType() == typeof(Cikis))
            {
                jsondata.DegiskenAdi = ((Cikis)nesne).DegiskenAdi;
            }
            else
            {
                jsondata.DegiskenAdi = "null";
            }
            string strjson = JsonConvert.SerializeObject(jsondata) + ",";

            return(strjson);
        }
Exemplo n.º 2
0
        public string NesneBilgileri(myPanel nesne)
        {
            JsonNesnem jsondata = new JsonNesnem();
             jsondata.NesneTipi = nesne.GetType().ToString() ;
             jsondata.Name = nesne.Name;
             jsondata.GosterilecekMetin = nesne.GosterilecekMetin;
             jsondata.YapilacakIslem = nesne.YapilacakIslem;
             try
             {
                 jsondata.Next1 = nesne.Next1.Name;
             }
             catch (Exception)
             {
                 jsondata.Next1 = "";
             }

             if (nesne.GetType() == typeof(for_) || nesne.GetType() == typeof(Eger))
             {
                 try
                 {
                     jsondata.Next2 = nesne.Next2.Name;
                 }
                 catch (Exception)
                 {
                     jsondata.Next2 = "";
                 }
             }
             else
             {
                 jsondata.Next2 = "";
             }

             jsondata.Width = nesne.Width;
             jsondata.Height = nesne.Height;
             jsondata.Top = nesne.Top;
             jsondata.Left = nesne.Left;
             if (nesne.GetType() == typeof(Giris))
             {
                 jsondata.DegiskenAdi = ((Giris)nesne).DegiskenAdi;
             }
             else if (nesne.GetType() == typeof(Cikis))
             {
                 jsondata.DegiskenAdi = ((Cikis)nesne).DegiskenAdi;
             }
             else
             {
                 jsondata.DegiskenAdi = "null";
             }
             string strjson = JsonConvert.SerializeObject(jsondata)+",";
             return strjson;
        }