Esempio n. 1
0
        protected override void Init()
        {
            Title = title;
            Server.OnClientActivity += (s, e) => SawClientActivity(e.Client);

            Style.fixedWidth = windowWidth;

            var skin = Skin.DefaultSkin;

            labelStyle        = new GUIStyle(skin.label);
            labelStyle.margin = new RectOffset(0, 0, 0, 0);

            stretchyLabelStyle              = new GUIStyle(skin.label);
            stretchyLabelStyle.margin       = new RectOffset(0, 0, 0, 0);
            stretchyLabelStyle.stretchWidth = true;

            fixedLabelStyle = new GUIStyle(skin.label);

            textFieldStyle        = new GUIStyle(skin.textField);
            textFieldStyle.margin = new RectOffset(0, 0, 0, 0);

            longTextFieldStyle        = new GUIStyle(skin.textField);
            longTextFieldStyle.margin = new RectOffset(0, 0, 0, 0);

            stretchyTextFieldStyle              = new GUIStyle(skin.textField);
            stretchyTextFieldStyle.margin       = new RectOffset(0, 0, 0, 0);
            stretchyTextFieldStyle.stretchWidth = true;

            buttonStyle        = new GUIStyle(skin.button);
            buttonStyle.margin = new RectOffset(0, 0, 0, 0);

            toggleStyle               = new GUIStyle(skin.toggle);
            toggleStyle.margin        = new RectOffset(0, 0, 0, 0);
            toggleStyle.stretchWidth  = false;
            toggleStyle.contentOffset = new Vector2(4, 0);

            separatorStyle              = GUILayoutExtensions.SeparatorStyle(new Color(0f, 0f, 0f, 0.25f));
            separatorStyle.fixedHeight  = 2;
            separatorStyle.stretchWidth = true;
            separatorStyle.margin       = new RectOffset(2, 2, 3, 3);

            lightStyle = GUILayoutExtensions.LightStyle();

            errorLabelStyle                  = new GUIStyle(skin.label);
            errorLabelStyle.margin           = new RectOffset(0, 0, 0, 0);
            errorLabelStyle.stretchWidth     = true;
            errorLabelStyle.normal.textColor = errorColor;

            comboOptionsStyle = GUILayoutExtensions.ComboOptionsStyle();
            comboOptionStyle  = GUILayoutExtensions.ComboOptionStyle();

            Errors           = new List <string> ();
            address          = Config.Address.ToString();
            rpcPort          = Config.RPCPort.ToString();
            streamPort       = Config.StreamPort.ToString();
            maxTimePerUpdate = Config.MaxTimePerUpdate.ToString();
            recvTimeout      = Config.RecvTimeout.ToString();

            // Get list of available addresses for drop down
            var interfaceAddresses = NetworkInformation.LocalIPAddresses.Select(x => x.ToString()).ToList();

            interfaceAddresses.Remove(IPAddress.Loopback.ToString());
            interfaceAddresses.Remove(IPAddress.Any.ToString());
            availableAddresses = new List <string> (new [] { localhostText, anyText });
            availableAddresses.AddRange(interfaceAddresses);
            availableAddresses.Add(manualText);
        }
Esempio n. 2
0
        protected override void Init()
        {
            core   = Core.Instance;
            config = ConfigurationFile.Instance;

            var version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);

            Title = "kRPC v" + version.FileMajorPart + "." + version.FileMinorPart + "." + version.FileBuildPart;

            core.OnClientActivity += (s, e) => SawClientActivity(e.Client);

            Style.fixedWidth = windowWidth;

            var skin = Skin.DefaultSkin;

            labelStyle        = new GUIStyle(skin.label);
            labelStyle.margin = new RectOffset(0, 0, 0, 0);

            stretchyLabelStyle              = new GUIStyle(skin.label);
            stretchyLabelStyle.margin       = new RectOffset(0, 0, 0, 0);
            stretchyLabelStyle.stretchWidth = true;

            fixedLabelStyle = new GUIStyle(skin.label);

            textFieldStyle        = new GUIStyle(skin.textField);
            textFieldStyle.margin = new RectOffset(0, 0, 0, 0);

            longTextFieldStyle        = new GUIStyle(skin.textField);
            longTextFieldStyle.margin = new RectOffset(0, 0, 0, 0);

            stretchyTextFieldStyle              = new GUIStyle(skin.textField);
            stretchyTextFieldStyle.margin       = new RectOffset(0, 0, 0, 0);
            stretchyTextFieldStyle.stretchWidth = true;

            buttonStyle        = new GUIStyle(skin.button);
            buttonStyle.margin = new RectOffset(0, 0, 0, 0);

            toggleStyle               = new GUIStyle(skin.toggle);
            toggleStyle.margin        = new RectOffset(0, 0, 0, 0);
            toggleStyle.stretchWidth  = false;
            toggleStyle.contentOffset = new Vector2(4, 0);

            expandStyle             = new GUIStyle(skin.button);
            expandStyle.margin      = new RectOffset(0, 0, 0, 0);
            expandStyle.padding     = new RectOffset(0, 0, 0, 0);
            expandStyle.fixedWidth  = 16;
            expandStyle.fixedHeight = 16;

            separatorStyle              = GUILayoutExtensions.SeparatorStyle(new Color(0f, 0f, 0f, 0.25f));
            separatorStyle.fixedHeight  = 2;
            separatorStyle.stretchWidth = true;
            separatorStyle.margin       = new RectOffset(2, 2, 3, 3);

            lightStyle = GUILayoutExtensions.LightStyle();

            errorLabelStyle                  = new GUIStyle(skin.label);
            errorLabelStyle.margin           = new RectOffset(0, 0, 0, 0);
            errorLabelStyle.stretchWidth     = true;
            errorLabelStyle.normal.textColor = errorColor;

            comboOptionsStyle = GUILayoutExtensions.ComboOptionsStyle();
            comboOptionStyle  = GUILayoutExtensions.ComboOptionStyle();

            Errors           = new List <string> ();
            maxTimePerUpdate = config.Configuration.MaxTimePerUpdate.ToString();
            recvTimeout      = config.Configuration.RecvTimeout.ToString();

            core.OnClientActivity += (s, e) => SawClientActivity(e.Client);
            if (core.Servers.Count == 1)
            {
                expandServers.Add(core.Servers [0].Id);
            }
        }