Example #1
0
        protected void Push(AnyTypeWindow atw)
        {
            object ob  = treeViewForAny1.SelectedObject;
            Key    key = listViewForAny1.SelectedKey;

            if (key == null)
            {
                if (ob is FuzzyArray)
                {
                    (ob as FuzzyArray).Add(atw.Value);
                }
                else if (ob is FuzzyObject)
                {
                    FuzzyObject fo = ob as FuzzyObject;
                    FuzzySymbol fs = FuzzySymbol.GetSymbol(atw.TextName);
                    if (fo.InstanceVariables.ContainsKey(fs))
                    {
                        fo.InstanceVariables[fs] = atw.Value;
                    }
                    else
                    {
                        fo.InstanceVariables.Add(fs, atw.Value);
                    }
                }
                else
                {
                }
            }
            else
            if (key.Type == Key.KeyType.Array)
            {
                (ob as FuzzyArray)[key.ArrayKey] = atw.Value;
            }
            else if (key.Type == Key.KeyType.Hash)
            {
                (ob as FuzzyHash)[key.HashKey] = atw.Value;
            }
            else if (key.Type == Key.KeyType.Object)
            {
                if (key.ObjectKey.Name == NAME_VALUE)
                {
                    (ob as FuzzyObject).ClassName = FuzzySymbol.GetSymbol(atw.TextValue);
                }
                else
                {
                    (ob as FuzzyObject).InstanceVariables[key.ObjectKey] = atw.Value;
                }
            }
            listViewForAny1.ScanObject();
        }
Example #2
0
        private void listViewForAny1_DoubleClick(object sender, EventArgs e)
        {
            AnyTypeWindow atw = new AnyTypeWindow();

            atw.Initialize();
            object ob = listViewForAny1.SelectedObject;

            if (ob == null)
            {
                atw.Set(true, NEW_VALUE, FuzzyNil.Instance);
                if (atw.ShowDialog() == DialogResult.OK)
                {
                    Push(atw);
                }
            }
            else
            {
                atw.Set(false, listViewForAny1.SelectedKey.ToString(), ob);
                if (atw.ShowDialog() == DialogResult.OK)
                {
                    Push(atw);
                }
            }
        }