示例#1
0
        public void Execute()
        {
            Progress(0.0, 1.0);

            if (ObjInput != null)
            {
                if (ObjInput is Array)
                {
                    OutputLen = (ObjInput as Array).Length;
                    GuiLogMessage("Object is an array with " + OutputLen + " entries.", NotificationLevel.Debug);
                }
                else if (ObjInput is IDictionary)
                {
                    OutputLen = (ObjInput as IDictionary).Count;
                    GuiLogMessage("Object is a dictionary with " + OutputLen + " items.", NotificationLevel.Debug);
                }
                else //no array or dictionary
                {
                    OutputLen = ObjInput.ToString().Length;
                    GuiLogMessage("Object isn't an array or dictionary. Length: " + OutputLen, NotificationLevel.Debug);
                }
            }

            Progress(1.0, 1.0);
        }
示例#2
0
        public void Execute()
        {
            if (ObjInput != null)
            {
                // error case, if array index is greater than the length of the array
                if (ObjInput.Length <= ArrayIndex)
                {
                    GuiLogMessage("Array Index is greater than the length of the array", NotificationLevel.Error);
                    return;
                }

                ObjOutput = ObjInput.GetValue(ArrayIndex);

                //GuiLogMessage("Array type is " + ObjInput.GetType().ToString() + " with value: " + ObjOutput.ToString(), NotificationLevel.Debug);
            }
        }