コード例 #1
0
        public void OpenInMethodExten()
        {
            Type   windowType = XReflectionUtils.TryGetClass("XMethodWindow");
            object window     = windowType.TryInvokeGlobalMethod("Init");

            windowType.TrySetProperty(window, "Target", this);
        }
コード例 #2
0
    void MatchPara()
    {
        var functions = command.RegexCutString("(", ")");
        var clear     = command.RegexCutStringReverse("(", ")");

        string[] commandPara = clear.Split('.');
        if (commandPara.Length > 0 && type == null && currValue == null)
        {
            type = XReflectionUtils.TryGetClass(commandPara[0]);
        }

        currValue = draggedObject;

        int allLenght = commandPara.Length;
        int funCount  = functions.Length;

        int startIndex = 1;

        if (currValue != null)
        {
            startIndex = 0;
        }
        for (int i = startIndex; i < startIndex + funCount; i++)
        {
            //  TODO loop in funCount
            if (currValue == null)
            {
                currValue = type.TryInvokeGlobalMethod(commandPara[i]);
            }
            else
            {
                currValue = currValue.GetType().TryInvokeMethod(currValue, commandPara[i]);
            }
        }
        int fieldCount = commandPara.Length - funCount;

        int fieldIndex = 1;

        if (currValue != null)
        {
            fieldIndex = 0;
        }
        for (int pos = fieldIndex; pos < fieldCount; pos++)
        {
            //  TODO loop in Length
            if (currValue == null)
            {
                currValue = type.TrySearchGlobalMemberValue(commandPara[pos + startIndex]);
            }
            else
            {
                currValue = currValue.TryGetFieldValue(commandPara[pos + startIndex]);
            }
        }
        Debug.Log("currValue is : " + currValue.ToString());
    }
コード例 #3
0
    void HandleInput(Event e)
    {
        if (Event.current.isKey)
        {
            Listen();
            string[] paras = command.Split('.');


            switch (paras.Length)
            {
            case 1:
                isClassIntent    = false;
                isMethodIntent   = false;
                isFieldIntent    = false;
                searchCollection = TryGetClass(paras[0]);
                break;

            case 2:
                if (!isClassIntent)
                {
                    type           = XReflectionUtils.TryGetClass(paras[0]);
                    isClassIntent  = true;
                    isMethodIntent = false;
                    isFieldIntent  = false;
                }
                searchCollection = TryGetMember(paras[1], true);
                break;

            case 3:
                if (!isMethodIntent)
                {
//						object instance = TryInvokeGlobalFunction( paras[1] );
//						type = instance.GetType();
//						isMethodIntent = true;
                }
                searchCollection = TryGetMember(paras[2], false);
                break;

            default:
                break;
            }
        }
        DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
        if (Event.current.type == EventType.DragPerform)
        {
            DragAndDrop.AcceptDrag();
            foreach (var draggedObject in DragAndDrop.objectReferences)
            {
                this.draggedObject = draggedObject;
            }
        }

        Repaint();
    }
コード例 #4
0
 public override void OnInitialization(params object[] args)
 {
     webViewType = XReflectionUtils.TryGetClass("WebView");
     //Init web view
     InitWebView();
 }
コード例 #5
0
 public static System.Type GetClass(string className)
 {
     return(XReflectionUtils.TryGetClass(className));
 }