Exemplo n.º 1
0
 public SelectForm(LinkControl linkedControl)
 {
     InitializeComponent();
     selectControl = new SelectControl(linkedControl);
     this.Controls.Add(selectControl);
     this.Size = selectControl.Size;
 }
Exemplo n.º 2
0
        public static string GetSelectZoneId(HttpContext context, DropDownList ddlZone)
        {
            var zone = ddlZone.SelectedValue;

            SelectControl.SetSelectZoneToCookie(context, zone);
            return(zone);
        }
Exemplo n.º 3
0
        public void AfterFirstLineRecvHandler(ref SelectControl selectControl, Socket socket, Buf safeBuffer)
        {
            try
            {
                if (!TryReceive(socket, safeBuffer))
                {
                    selectControl.ShutdownDisposeAndRemoveReceiveSocket(socket);
                    return;
                }

                String line = lineParser.GetLine();
                if (line == null)
                {
                    return;
                }

                ByteBuilder builder = new ByteBuilder(safeBuffer.array);
                HandleNpcLines(ref selectControl, socket, safeBuffer, builder, line);
            }
            catch (Exception e)
            {
                callback.UnhandledException(clientString, e);
                selectControl.ShutdownDisposeAndRemoveReceiveSocket(socket);
            }
        }
Exemplo n.º 4
0
    void Start()
    {
        ps          = GetComponent <ParticleSystem>();
        sc          = GetComponent <SelectControl>();
        audioSource = GetComponent <AudioSource>();

        fish = new GameObject[sc.countFish];

        for (int i = 0; i < sc.countFish; i++)
        {
            fish[i] = Instantiate(sc.prefab, transform.position + Vector3.left * i, Quaternion.identity);
            fish[i].GetComponent <FollowTarget>().target = this.gameObject;
            fish[i].transform.localScale = new Vector3(sc.fishScale, sc.fishScale, sc.fishScale);

            if (tag == "LeftFish")
            {
                fish[i].GetComponent <Attack>().current = Attack.FishSide.LeftFish;
                fish[i].gameObject.tag = "LeftFish";
//                fish[i].GetComponent<Renderer>().material.SetColor("_Color", Color.blue);
            }
            else
            {
                fish[i].GetComponent <Attack>().current = Attack.FishSide.RightFish;
                fish[i].gameObject.tag = "RightFish";
//                fish[i].GetComponent<Renderer>().material.SetColor("_Color", Color.red);
            }
        }
    }
Exemplo n.º 5
0
        private void PickRegion()
        {
            //Reset the values.
            SelectControl.Retry();

            IsPickingRegion = true;
        }
Exemplo n.º 6
0
        void BindData()
        {
            try
            {
                var list = ConnectionFactory.Instance.GetZoneList(Page.User.Identity.Name);
                if (list != null)
                {
                    _defaultZone = list[0].Value;
                }
                var zoneCache = SelectControl.GetSelectZoneFromCookie(HttpContext.Current);
                var index     = 0;
                if (!string.IsNullOrEmpty(zoneCache) && list != null)
                {
                    index        = list.FindIndex(d => d.Value == zoneCache);
                    _defaultZone = zoneCache;
                }


                SZone.DataSource     = list;
                SZone.DataTextField  = "Text";
                SZone.DataValueField = "Value";
                SZone.DataBind();
                SZone.SelectedIndex = index;
            }
            catch (Exception ex)
            {
                LogHelper.Insert(ex);
            }
        }
Exemplo n.º 7
0
 protected void Page_Init(object sender, EventArgs e)
 {
     SelectControl.Items.Clear();
     SelectControl.Items.Add(new ListItem(string.Empty));
     SelectControl.DataSource = ConLibControls;
     SelectControl.DataBind();
 }
Exemplo n.º 8
0
        public void AcceptCallback(ref SelectControl control, Socket socket, Buf safeBuffer)
        {
            Socket dataSocket = socket.Accept();

            //Console.WriteLine("[{0}] New Client '{1}'", serviceName, socket.RemoteEndPoint);
            control.AddReceiveSocket(dataSocket, new RecordBuilder(dataSocket.SafeRemoteEndPointString(),
                                                                   HandleTcpRecord).TcpSocketRecvCallback);
        }
Exemplo n.º 9
0
    void Start()
    {
        mv = GetComponent <MovePointer>();
        sc = GetComponent <SelectControl>();

        ft = new FollowTarget[5];
        for (int i = 0; i < 5; i++)
        {
            ft[i] = fish[i].GetComponent <FollowTarget>();
        }
    }
Exemplo n.º 10
0
        public void DatagramHandler(ref SelectControl control, Socket socket, Buf safeBuffer)
        {
            throw new NotImplementedException();

            /*
             * String clientString = String.Format("UDP:{0}", endPoint);
             *
             * UInt32 responseLength = HandleRecord(clientString, bytes, 0, bytesRead, sendBuffer, 0);
             * if (responseLength > 0)
             * {
             *  socket.SendTo(sendBuffer.array, 0, (Int32)responseLength, SocketFlags.None, endPoint);
             * }
             * return ServerInstruction.NoInstruction;
             */
        }
Exemplo n.º 11
0
        public void AcceptCallback(ref SelectControl selectControl, Socket listenSocket, Buf safeBuffer)
        {
            Socket clientSocket = listenSocket.Accept();

            if (clientSocket.Connected)
            {
                String clientLogString = clientSocket.SafeRemoteEndPointString();

                var dataHandler = new NpcSocketHandler(clientLogString, callback, npcExecutor, htmlGenerator);
                selectControl.AddReceiveSocket(clientSocket, dataHandler.InitialRecvHandler);
            }
            else
            {
                clientSocket.Close();
            }
        }
Exemplo n.º 12
0
        public void InitialRecvHandler(ref SelectControl selectControl, Socket socket, Buf safeBuffer)
        {
            try
            {
                if (!TryReceive(socket, safeBuffer))
                {
                    selectControl.ShutdownDisposeAndRemoveReceiveSocket(socket);
                    return;
                }

                String line = lineParser.GetLine();
                if (line == null)
                {
                    return;
                }

                ByteBuilder builder = new ByteBuilder(safeBuffer.array);

                // Check if it is an HTTP request
                if (line.StartsWith("GET "))
                {
                    selectControl.RemoveReceiveSocket(socket);
                    uint start = BuildHttpResponseFromFirstLine(builder, line);

                    if (builder.bytes != safeBuffer.array)
                    {
                        safeBuffer.array = builder.bytes; // Update the buffer with the bigger buffer
                    }
                    if (builder.contentLength > 0)
                    {
                        socket.Send(builder.bytes, (int)start, (int)(builder.contentLength - start), SocketFlags.None);
                    }

                    selectControl.ShutdownDisposeAndRemoveReceiveSocket(socket);
                    return;
                }

                selectControl.UpdateHandler(socket, AfterFirstLineRecvHandler);
                HandleNpcLines(ref selectControl, socket, safeBuffer, builder, line);
            }
            catch (Exception e)
            {
                callback.UnhandledException(clientString, e);
                selectControl.ShutdownDisposeAndRemoveReceiveSocket(socket);
            }
        }
Exemplo n.º 13
0
        public static void BindZoneControl(HttpContext context, DropDownList ddlZone, string userName,
                                           bool selectAll = false)
        {
            var zoneList = ConnectionFactory.Instance.GetZoneList(userName, selectAll);

            ddlZone.DataSource     = zoneList;
            ddlZone.DataTextField  = "Text";
            ddlZone.DataValueField = "Value";
            ddlZone.DataBind();
            var zoneCache = SelectControl.GetSelectZoneFromCookie(context);
            var index     = 0;

            if (!string.IsNullOrEmpty(zoneCache))
            {
                index = zoneList.FindIndex(d => d.Value == zoneCache);
            }
            ddlZone.SelectedIndex = index;
        }
Exemplo n.º 14
0
        public override void OnCreate(object hook)
        {
            _context        = hook as IAppContext;
            base.m_caption  = "纵断面分析";
            base.m_category = "PipelineAnalysus";
            base.m_bitmap   = Properties.Resources.icon_section_vert;
            base.m_name     = "PipeAnalysis_VertSectionStart";
            base._key       = "PipeAnalysis_VertSectionStart";
            base.m_toolTip  = "纵断面分析";
            base.m_checked  = false;
            base.m_message  = "纵断面分析";
            base.m_enabled  = true;
            base._itemType  = RibbonItemType.Tool;

            this.m_SectionControl = new SelectControl(_context);
            this.m_SectionControl.Clear();
            _context.FocusMap.ClearSelection();
            _context.ActiveView.Refresh();
            CommonUtils.AppContext = _context;
        }
Exemplo n.º 15
0
        void HandleNpcLines(ref SelectControl selectControl, Socket socket, Buf safeBuffer, ByteBuilder builder, String line)
        {
            do
            {
                if (!HandleLine(builder, line))
                {
                    selectControl.ShutdownDisposeAndRemoveReceiveSocket(socket);
                    break;
                }
                if (builder.bytes != safeBuffer.array)
                {
                    safeBuffer.array = builder.bytes; // Update the buffer with the bigger buffer
                }

                if (builder.contentLength > 0)
                {
                    socket.Send(builder.bytes, (int)builder.contentLength, SocketFlags.None);
                    builder.Clear();
                }

                line = lineParser.GetLine();
            } while (line != null);
        }
Exemplo n.º 16
0
 public void ClearHoverEffects()
 {
     SelectControl.HideZoom();
 }
Exemplo n.º 17
0
 public void ClearSelection()
 {
     SelectControl.Retry();
 }
Exemplo n.º 18
0
    public ChooseItem changJing2;       //网购

    // Use this for initialization
    void Start()
    {
        sControl = transform.parent.GetComponent <SelectControl>();
        changJing1.objSelect.SetActive(true);
    }
Exemplo n.º 19
0
        protected override int OnExecuteCommand(CliExecutionContext context)
        {
            if (Description == null)
            {
                _console.Write("Description: ");
                Description = _console.ReadLine();
            }

            if (!Local && !Global && !User)
            {
                var result = SelectControl.Show(_console, SelectControl.OneSelectionMode.LeftRight, "Command Scope: ", 1, "User", "Local", "Global");
                User   = result.Index == 0;
                Local  = result.Index == 1;
                Global = result.Index == 2;
            }

            var path      = User ? UserCommandsPath : Local ? LocalCommandsPath : GlobalCommandsPath;
            var scopeName = User ? UserScopeName : Local ? LocalScopeName : GlobalScopeName;
            var commands  = _commandsService.LoadCommands(path);

            if (_commandsService.TryGetCommand(commands, Alias, out var command))
            {
                if (!Force)
                {
                    throw new ApplicationExitException(ExitCode.AliasAddExists, $"The alias \"{Alias}\" already exists for scope \"{scopeName}\". Use the --force parameter to override the existing alias.");
                }
                commands.Remove(command.Alias !);
            }

            while (string.IsNullOrWhiteSpace(Command))
            {
                _console.Write("Command: ");
                Command = _console.ReadLine();
            }

            var tool = Tool?.ToTool();

            commands.Add(Alias !, new Command
            {
                Description = Description,
                Tool        = tool,
                CommandText = Command,
            });

            if (!_commandsService.SaveCommands(path, commands))
            {
                return((int)ExitCode.AliasAddFailedModifyJson);
            }

            var success = true;

            success &= _commandsService.WriteScriptFile(path, Alias !, TerminalTool.PowerShell, Command, Description, tool);
            success &= _commandsService.WriteScriptFile(path, Alias !, TerminalTool.Cmd, Command, Description, tool);

            if (success)
            {
                _console.WriteLineWithColor($"Successfully added alias \"{Alias}\" to scope \"{scopeName}\".", ConsoleColor.Green);
            }
            else
            {
                _console.WriteLineWithColor($"Partially added alias \"{Alias}\" to scope \"{scopeName}\".", ConsoleColor.Yellow);
            }

            return((int)(success ? ExitCode.Okay : ExitCode.AliasAddFailedCreateScript));
        }
Exemplo n.º 20
0
 private void ButtonSelect_Click(Object sender, RoutedEventArgs e)
 {
     SelectControl?.Invoke(this);
 }
Exemplo n.º 21
0
        /// <summary>
        ///     Required method for Designer support - do not modify
        ///     the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            var resources = new System.Resources.ResourceManager(typeof(FormSelectVariables));

            this.ctrlVariables  = new AutoFrontend.Controls.SelectControl();
            this.ctrlParameters = new AutoFrontend.Controls.SelectControl();
            this.panel1         = new System.Windows.Forms.Panel();
            this.panel3         = new System.Windows.Forms.Panel();
            this.splitter1      = new System.Windows.Forms.Splitter();
            this.panel2         = new System.Windows.Forms.Panel();
            this.panel4         = new System.Windows.Forms.Panel();
            this.cmdOk          = new System.Windows.Forms.Button();
            this.panel5         = new System.Windows.Forms.Panel();
            this.panel1.SuspendLayout();
            this.panel3.SuspendLayout();
            this.panel2.SuspendLayout();
            this.panel4.SuspendLayout();
            this.panel5.SuspendLayout();
            this.SuspendLayout();
            //
            // ctrlVariables
            //
            this.ctrlVariables.Dock            = System.Windows.Forms.DockStyle.Fill;
            this.ctrlVariables.DockPadding.All = 3;
            this.ctrlVariables.Location        = new System.Drawing.Point(0, 0);
            this.ctrlVariables.Name            = "ctrlVariables";
            this.ctrlVariables.PropertyName    = " Variables: ";
            this.ctrlVariables.SelectedIndices = new int[0];
            this.ctrlVariables.Size            = new System.Drawing.Size(768, 216);
            this.ctrlVariables.TabIndex        = 0;
            //
            // ctrlParameters
            //
            this.ctrlParameters.Dock            = System.Windows.Forms.DockStyle.Fill;
            this.ctrlParameters.DockPadding.All = 3;
            this.ctrlParameters.Location        = new System.Drawing.Point(0, 0);
            this.ctrlParameters.Name            = "ctrlParameters";
            this.ctrlParameters.PropertyName    = " Parameters: ";
            this.ctrlParameters.SelectedIndices = new int[0];
            this.ctrlParameters.Size            = new System.Drawing.Size(768, 238);
            this.ctrlParameters.TabIndex        = 1;
            //
            // panel1
            //
            this.panel1.Controls.Add(this.panel3);
            this.panel1.Controls.Add(this.splitter1);
            this.panel1.Controls.Add(this.panel2);
            this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name     = "panel1";
            this.panel1.Size     = new System.Drawing.Size(768, 462);
            this.panel1.TabIndex = 2;
            //
            // panel3
            //
            this.panel3.Controls.Add(this.ctrlParameters);
            this.panel3.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel3.Location = new System.Drawing.Point(0, 224);
            this.panel3.Name     = "panel3";
            this.panel3.Size     = new System.Drawing.Size(768, 238);
            this.panel3.TabIndex = 2;
            //
            // splitter1
            //
            this.splitter1.Dock     = System.Windows.Forms.DockStyle.Top;
            this.splitter1.Location = new System.Drawing.Point(0, 216);
            this.splitter1.MinSize  = 200;
            this.splitter1.Name     = "splitter1";
            this.splitter1.Size     = new System.Drawing.Size(768, 8);
            this.splitter1.TabIndex = 1;
            this.splitter1.TabStop  = false;
            //
            // panel2
            //
            this.panel2.Controls.Add(this.ctrlVariables);
            this.panel2.Dock     = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Name     = "panel2";
            this.panel2.Size     = new System.Drawing.Size(768, 216);
            this.panel2.TabIndex = 0;
            //
            // panel4
            //
            this.panel4.Controls.Add(this.cmdOk);
            this.panel4.Dock     = System.Windows.Forms.DockStyle.Bottom;
            this.panel4.Location = new System.Drawing.Point(0, 462);
            this.panel4.Name     = "panel4";
            this.panel4.Size     = new System.Drawing.Size(768, 40);
            this.panel4.TabIndex = 3;
            //
            // cmdOk
            //
            this.cmdOk.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.cmdOk.FlatStyle    = System.Windows.Forms.FlatStyle.System;
            this.cmdOk.Location     = new System.Drawing.Point(680, 8);
            this.cmdOk.Name         = "cmdOk";
            this.cmdOk.TabIndex     = 0;
            this.cmdOk.Text         = "Ok";
            this.cmdOk.Click       += new System.EventHandler(this.cmdOk_Click);
            //
            // panel5
            //
            this.panel5.Controls.Add(this.panel1);
            this.panel5.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.panel5.Location = new System.Drawing.Point(0, 0);
            this.panel5.Name     = "panel5";
            this.panel5.Size     = new System.Drawing.Size(768, 462);
            this.panel5.TabIndex = 4;
            //
            // FormSelectVariables
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize        = new System.Drawing.Size(768, 502);
            this.Controls.Add(this.panel5);
            this.Controls.Add(this.panel4);
            try
            {
                this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            }
            catch
            {
            }
            this.Name     = "FormSelectVariables";
            this.Text     = "Select Variables and Parameters for AUTO";
            this.Closing += new System.ComponentModel.CancelEventHandler(this.FormSelectVariables_Closing);
            this.panel1.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel4.ResumeLayout(false);
            this.panel5.ResumeLayout(false);
            this.ResumeLayout(false);
        }
Exemplo n.º 22
0
 // Use this for initialization
 void Start()
 {
     sControl = transform.parent.GetComponent <SelectControl>();
 }