private void editAccountToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if ((advTree1.SelectedNode.Tag != null && (advTree1.SelectedNode.Tag as ic.accountC).is_sys_account))
     {
         MessageBox.Show("Cannot Edit This Account Because It Is A System Account", "System Account Error");
         return;
     }
     m_action = action_type.update;
     m_object = object_type.Account;
     showpanel(advTree1.SelectedNode);
 }
示例#2
0
        /// <summary>
        /// Constructor for the Circle class to be created with the
        /// information from the server
        /// </summary>
        /// <param name="loc">an x,y coordinate for Circle's location</param>
        /// <param name="argb_color">an int representing the Circle's color</param>
        /// <param name="id">an int representing the Circle's id</param>
        /// <param name="belongs_to">an int representing the Circle's parent to be used for split function</param>
        /// <param name="type">an object_type of food, player, heartbeat, or admin</param>
        /// <param name="Name">a string representing a player's name</param>
        /// <param name="Mass">a float representing the area of a circle</param>
        public Circle(PointF loc, int argb_color, int id, int belongs_to, object_type type, string Name, float Mass)
        {
            this.loc        = loc;
            this.argb_color = argb_color;
            this.id         = id;
            this.belongs_to = belongs_to;
            this.type       = type;
            this.Name       = Name;
            this.Mass       = Mass;

            radius = (float)Math.Sqrt(Mass / (Math.PI));
        }
示例#3
0
        public base_object(string name, object_type type, object value)
        {
            this.name = name;
            this.type = type;
            //   if(String.IsNullOrWhiteSpace(json_data)) return;

/*            switch(type) {
 *              case object_type.@bool    : b_value=   (bool)json_data; break;
 *              case object_type.@decimal : d_value=(decimal)json_data; break;
 *              case object_type.@int     : i_value=    (int)json_data; break;
 *              case object_type.@object  : o_value=         json_data; break;
 *              case object_type.@string  : s_value= (string)json_data; break;
 *              case object_type.array    : lo_value=(List<object>)json_data; break;
 *          }*/
        }
示例#4
0
        public static base_object build(string root_name, string data)
        {
            uint        len             = (uint)data.Length;
            uint        depth           = 0;
            uint        node            = 0;
            bool        in_quote        = false;
            bool        in_name         = false;
            bool        in_value        = false;
            bool        in_array        = false;
            bool        make_new_object = false;
            base_object root            = null;
            base_object curent          = null;
            base_object last            = null;
            object_type type            = object_type.@object;
            int         last_index      = 0;
            string      name            = String.Empty;;

            //objects.Add(root);
            for (int i = 0; i < len; i++)
            {
                char c = data[i];

                if (c == '\"')
                {
                    if (in_quote == true)
                    {
                        in_quote = false;
                    }
                    else
                    {
                        in_quote = true;
                    }
                    continue;
                }

                if (in_quote)
                {
                    continue;
                }


                switch (c)
                {
                case '{': make_new_object = true; in_name = true;  in_value = false;  ++depth; type = object_type.@object; last_index = i;  break;

                case ':': make_new_object = false; in_name = false; in_value = true;   name = data.Substring(last_index, i - last_index); last_index = i; break;

                case '}': make_new_object = true; in_name = false; in_value = false; --depth; last_index = i; break;

                case ',': make_new_object = true; in_name = true;  in_value = false;  ++node;  last_index = i; break;

                case '[': make_new_object = true; in_name = false; in_value = false;  type = object_type.@array; last_index = i; break;

                case ']': make_new_object = true; in_name = false; in_value = false;  type = object_type.none;   last_index = i; break;
                }
                if (make_new_object)
                {
                    make_new_object = false;
                    last            = curent;
                    if (root == null)
                    {
                        name = root_name;
                    }
                    //curent=new json_type(type,);
                    if (null != last)
                    {
                        if (last.type == object_type.array ||
                            last.type == object_type.@object)
                        {
                            last.Add(curent);
                            name = null;
                        }
                        else
                        {
                            last.value = curent;
                        }
                    }
                    else
                    {
                        if (null == root)
                        {
                            root = curent;
                        }
                    }
                }
                //if we have an object and root is set. reference it.  it's the anchor
            }
            return(root);
        } //end funciton
 private void createSubDepartmentToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     m_action = action_type.create;
     m_object = object_type.SubDepartment;
     CreateDummyNode();
 }
 private void editAccountToolStripMenuItem_Click(object sender, EventArgs e)
 {
     m_action = action_type.update;
     m_object = object_type.GroupAccount;
     showpanel(advTree1.SelectedNode);
 }
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     m_action = action_type.create;
     m_object = object_type.Department;
     CreateDummyNode();
 }
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     m_action = action_type.create;
     m_object = object_type.GroupAccount;
     CreateDummyNode();
 }
 private void createSMSFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     m_action = action_type.create;
     m_object = object_type.Account;
     CreateDummyNode();
 }
示例#10
0
 private void compile_model_Click(object sender, RoutedEventArgs e)
 {
     if (model_compile_render_type.SelectedIndex == 0)
     {
         string      path = compile_model_path.Text;
         object_type obj  = (object_type)model_compile_obj_type.SelectedIndex;
         new Thread(delegate()
         {
             var process = new ProcessStartInfo();
             process.WorkingDirectory = H2Ek_install_path;
             process.FileName         = GetToolExeName(tool_type.tool);
             if (model_compile_type.HasFlag(model_compile.physics))
             {
                 process.Arguments  = "model-physics \"" + path + "\"";
                 process.Arguments += " pause_after_run";
                 RunProcess(process, true);
             }
             if (model_compile_type.HasFlag(model_compile.collision))
             {
                 process.Arguments  = "model-collision \"" + path + "\"";
                 process.Arguments += " pause_after_run";
                 RunProcess(process, true);
             }
             if (model_compile_type.HasFlag(model_compile.render))
             {
                 process.Arguments  = "model-render \"" + path + "\"";
                 process.Arguments += " pause_after_run";
                 RunProcess(process, true);
             }
             if (model_compile_type.HasFlag(model_compile.obj))
             {
                 process.Arguments  = "model-object " + path + "\\ " + obj;
                 process.Arguments += " pause_after_run";
                 RunProcess(process);
             }
         }).Start();
     }
     if (model_compile_render_type.SelectedIndex == 1)
     {
         string      path = compile_model_path.Text;
         object_type obj  = (object_type)model_compile_obj_type.SelectedIndex;
         new Thread(delegate()
         {
             var process = new ProcessStartInfo();
             process.WorkingDirectory = H2Ek_install_path;
             process.FileName         = GetToolExeName(tool_type.tool);
             if (model_compile_type.HasFlag(model_compile.physics))
             {
                 process.Arguments  = "model-physics \"" + path + "\"";
                 process.Arguments += " pause_after_run";
                 RunProcess(process, true);
             }
             if (model_compile_type.HasFlag(model_compile.collision))
             {
                 process.Arguments  = "model-collision \"" + path + "\"";
                 process.Arguments += " pause_after_run";
                 RunProcess(process, true);
             }
             if (model_compile_type.HasFlag(model_compile.render))
             {
                 process.FileName   = GetToolExeName(tool_type.daeconverter);
                 process.Arguments  = "-compile " + "data\\" + path;
                 process.Arguments += " pause_after_run";
                 RunProcess(process, true);
             }
             if (model_compile_type.HasFlag(model_compile.obj))
             {
                 process.Arguments  = "model-object " + path + "\\ " + obj;
                 process.Arguments += " pause_after_run";
                 RunProcess(process);
             }
         }).Start();
     }
 }
示例#11
0
 public base_object(string name, object_type type)
 {
     this.name = name;
     this.type = type;
 }