Esempio n. 1
0
        /// <summary>
        /// Editor needs context items.
        /// </summary>
        private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e)
        {
            if (Operations.Parent is Factor)
            {
            }
            else
            {
                object o = Apsim.Get(Operations, e.ObjectName);

                if (o == null)
                    o = Apsim.Find(Operations, e.ObjectName);

                if (o != null)
                {
                    e.AllItems.AddRange(NeedContextItemsArgs.ExamineObjectForContextItems(o, true, true, false));
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Intellisense lookup.
        /// </summary>
        void OnContextItemsNeeded(object sender, NeedContextItemsArgs e)
        {
            if (e.ObjectName == "")
                e.ObjectName = ".";
            try
            {
                Experiment experiment = Factor.Parent.Parent as Experiment;
                if (experiment != null && experiment.BaseSimulation != null)
                {
                    object o = experiment.BaseSimulation.Get(e.ObjectName);

                    if (o != null)
                    {
                        foreach (IVariable Property in Apsim.FieldsAndProperties(o, BindingFlags.Instance | BindingFlags.Public))
                            e.Items.Add(Property.Name);
                        e.Items.Sort();
                    }
                }
            }
            catch (Exception)
            {

            }
        }
Esempio n. 3
0
        /// <summary>
        /// The view is asking for event names.
        /// </summary>
        void OnNeedEventNames(object Sender, NeedContextItemsArgs e)
        {
            object o = Apsim.Get(Report, e.ObjectName);

            if (o != null)
            {
                e.AllItems.AddRange(NeedContextItemsArgs.ExamineObjectForContextItems(o, false, false, true));
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Editor needs context items.
 /// </summary>
 private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e)
 {
     e.AllItems.AddRange(NeedContextItemsArgs.ExamineModelForNames(Operations, e.ObjectName, true, true, false));
 }
Esempio n. 5
0
        /// <summary>
        /// The view is asking for variable names.
        /// </summary>
        void OnNeedVariableNames(object Sender, NeedContextItemsArgs e)
        {
            if (e.ObjectName == "")
                e.ObjectName = ".";
            object o = Apsim.Get(Report, e.ObjectName);

            if (o != null)
            {
                e.AllItems.AddRange(NeedContextItemsArgs.ExamineObjectForContextItems(o, true, true, true));
            }
        }