void ReleaseDesignerOutlets()
        {
            if (LabelAddress != null)
            {
                LabelAddress.Dispose();
                LabelAddress = null;
            }

            if (LabelCity != null)
            {
                LabelCity.Dispose();
                LabelCity = null;
            }

            if (LabelCustomerName != null)
            {
                LabelCustomerName.Dispose();
                LabelCustomerName = null;
            }

            if (LabelDateJoined != null)
            {
                LabelDateJoined.Dispose();
                LabelDateJoined = null;
            }

            if (LabelOrdersCount != null)
            {
                LabelOrdersCount.Dispose();
                LabelOrdersCount = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (ButtonDirections != null)
            {
                ButtonDirections.Dispose();
                ButtonDirections = null;
            }

            if (ImageStore != null)
            {
                ImageStore.Dispose();
                ImageStore = null;
            }

            if (LabelAddress != null)
            {
                LabelAddress.Dispose();
                LabelAddress = null;
            }

            if (LabelName != null)
            {
                LabelName.Dispose();
                LabelName = null;
            }

            if (LabelTelephone != null)
            {
                LabelTelephone.Dispose();
                LabelTelephone = null;
            }
        }
Пример #3
0
        private void LabelAssign()
        {
            if (Tokens.Count < 3)
            {
                return;
            }


            bool  isSuccess = false;
            Token t1        = Tokens.Pop();
            Token t2        = Tokens.Pop();
            Token t3        = Tokens.Pop();

            if (t1.Type == TokenType.Register &&
                t2.Type == TokenType.Operator &&
                t2.Value == ":=" &&
                t3.Type == TokenType.String)
            {
                if (Tokens.Peek().Type != TokenType.Semicolon)
                {
                    Error("No semicolon in operation", t3);
                }
                else
                {
                    Tokens.Pop();

                    byte          r1      = Convert.ToByte(t1.Value);
                    BinaryCommand prevCmd = new AssignConstCommand(0, r1);
                    Program.Add(prevCmd);
                    BinaryCommand cmd = new AddNextConstCommand(r1, r1);
                    Program.Add(cmd);

                    Label        label   = Mapper.Labels.Contains(t3.Value) ? (Label)Mapper.Labels[t3.Value] : null;
                    LabelAddress address = new LabelAddress(label);
                    if (label == null)
                    {
                        Mapper.Unreferenced.Add(new KeyValuePair <string, LabelAddress>(t3.Value, address));
                    }
                    Program.Add(address);

                    isSuccess = true;
                }
            }

            if (isSuccess)
            {
                return;
            }

            Tokens.Push(t3);
            Tokens.Push(t2);
            Tokens.Push(t1);
        }
        void ReleaseDesignerOutlets()
        {
            if (ButtonAddress != null)
            {
                ButtonAddress.Dispose();
                ButtonAddress = null;
            }

            if (ButtonAvailable != null)
            {
                ButtonAvailable.Dispose();
                ButtonAvailable = null;
            }

            if (ButtonEnabled != null)
            {
                ButtonEnabled.Dispose();
                ButtonEnabled = null;
            }

            if (ButtonGetLocation != null)
            {
                ButtonGetLocation.Dispose();
                ButtonGetLocation = null;
            }

            if (LabelAddress != null)
            {
                LabelAddress.Dispose();
                LabelAddress = null;
            }

            if (LabelAvailable != null)
            {
                LabelAvailable.Dispose();
                LabelAvailable = null;
            }

            if (LabelEnabled != null)
            {
                LabelEnabled.Dispose();
                LabelEnabled = null;
            }

            if (LabelLocation != null)
            {
                LabelLocation.Dispose();
                LabelLocation = null;
            }
        }
Пример #5
0
        // ask block.io for the Addresses (really we care about the Labels) for a given apikey, and update the UI if successful (this is also how we detect the cointype)
        private bool tryGetAddresses(string apikey)
        {
            try
            {
                BlockIO     client = new BlockIO(apikey);
                APIResponse r      = client.getMyAddresses();

                string net = (string)r.Data["network"];
                currentNet = net;

                // reload the Fractions dropdown to follow the potential change in coin network
                reloadFractions();

                // update the text on the "add tx fee" checkbox, again to follow potential network change
                updateFeeAddCheckbox();

                lblCoinType.Text = string.Format("Using coin type: {0}", net);

                // gather list of addresses-labels-values and put in to a nice dropdown list (replacing current silly "label" textbox)
                ArrayList addresses = (ArrayList)r.Data["addresses"];

                // devnote: store the data properly structured internally (make a class, store as array-of-class), then build display strings for the DDL
                // and in a SelectedIndexChanged handler for that new DDL, update a new Label to show available balance

                labels = new List <LabelAddress>();

                foreach (Dictionary <string, object> a in addresses)
                {
                    LabelAddress la = new LabelAddress();
                    la.net     = net;
                    la.label   = (string)a["label"];
                    la.balance = decimal.Parse((string)a["available_balance"]);

                    labels.Add(la);
                }

                ddlTakeFromLabel.DataSource    = labels;
                ddlTakeFromLabel.SelectedIndex = 0;
                //reloadLabels();
            }
            catch (Exception ex)
            {
                // that didn't work...
                string errmsg = string.Format("Error when asking Block.Io for Address/Label List.\nInternal Error message is:\n{0}", ex.Message);
                MessageBox.Show(errmsg, "Error getting Label List", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            return(true);
        }
        void ReleaseDesignerOutlets()
        {
            if (LabelAddress != null)
            {
                LabelAddress.Dispose();
                LabelAddress = null;
            }

            if (LabelCity != null)
            {
                LabelCity.Dispose();
                LabelCity = null;
            }

            if (LabelName != null)
            {
                LabelName.Dispose();
                LabelName = null;
            }

            if (LabelTelNumber != null)
            {
                LabelTelNumber.Dispose();
                LabelTelNumber = null;
            }

            if (TextFieldAddress != null)
            {
                TextFieldAddress.Dispose();
                TextFieldAddress = null;
            }

            if (TextFieldCity != null)
            {
                TextFieldCity.Dispose();
                TextFieldCity = null;
            }

            if (TextFieldName != null)
            {
                TextFieldName.Dispose();
                TextFieldName = null;
            }

            if (TextFieldTelNumber != null)
            {
                TextFieldTelNumber.Dispose();
                TextFieldTelNumber = null;
            }
        }