Beispiel #1
0
        public ArtykulyForm(KindEnum Kind, ModeEnum Mode)
        {
            InitializeComponent();

            setControlsText();

            this.ActiveReason = FormActivate.faMainForm;

            CurrentKind = Kind;
            CurrentMode = Mode;

            loadConfig();

            AuthorsToDelete = new List <string>();
            KeysToDelete    = new List <string>();

            ShowList = false;

            if (CurrentKind == KindEnum.Magazine)
            {
                KindUC = new MagazineUC();
                //KindUC.Location = new Point(12, 438);
                //this.Controls.Add(KindUC);
                KindUC.Location = new Point(0, 0);
                panel1.Controls.Add(KindUC);
            }
            else if (CurrentKind == KindEnum.Book)
            {
                KindUC = new BookUC();
                //KindUC.Location = new Point(12, 438);
                //this.Controls.Add(KindUC);
                KindUC.Location = new Point(0, 0);
                panel1.Controls.Add(KindUC);
            }

            if (CurrentMode == ModeEnum.Edit || CurrentMode == ModeEnum.Delete)
            {
                SearchButton.Visible = true;
                PrintButton.Visible  = true;
            }

            if (CurrentMode == ModeEnum.Delete)
            {
                DeleteButton.Visible  = true;
                Settings.ReadOnlyMode = true;
                LockAll();
            }

            if (CurrentMode == ModeEnum.ReadOnlyCatalog)
            {
                Settings.ReadOnlyMode = true;
                ReadOnlyForCatalog();
            }

            ToolTip SelectToolTip = new ToolTip();

            SelectToolTip.SetToolTip(SourcesButton, _translationsDictionary.getStringFromDictionary("add_attachments", "Dodaj załączniki"));

            keySuggest("");
        }
Beispiel #2
0
 /// <summary>
 /// Creates a signal with a mode and a default value.
 /// </summary>
 /// <param name="identifier">the identifier of the signal</param>
 /// <param name="mode">the mode of the signal</param>
 /// <param name="type">the type of the signal</param>
 /// <param name="defaultValue">the default value of the signal</param>
 public Signal(string identifier, ModeEnum mode, SubtypeIndication type, Expression defaultValue)
     : base(identifier, type)
 {
     this.defaultValue = defaultValue;
     Mode = mode;
     kind = KindEnum.DEFAULT;
 }
        public Hashes(ThinHashes th, HashInput hi)
        {
            Key        = th.Key;
            HashMD5    = th.HashMD5;
            HashSHA256 = th.HashSHA256;

            Kind   = hi.Kind;
            Search = hi.Search;
        }
Beispiel #4
0
        public SourceFieldSymbol(SourceTypeSymbol type, string name, Accessibility accessibility, PHPDocBlock phpdoc, KindEnum kind, BoundExpression initializer = null)
        {
            Contract.ThrowIfNull(type);
            Contract.ThrowIfNull(name);

            _containingType = type;
            _fieldName      = name;
            _fieldKind      = kind;
            _accessibility  = accessibility;
            _phpDoc         = phpdoc;
            _initializer    = initializer;
        }
Beispiel #5
0
        public SourceFieldSymbol(SourceTypeSymbol type, string name, Accessibility accessibility, PHPDocBlock phpdoc, KindEnum kind, BoundExpression initializer = null)
        {
            Contract.ThrowIfNull(type);
            Contract.ThrowIfNull(name);

            _containingType = type;
            _fieldName = name;
            _fieldKind = kind;
            _accessibility = accessibility;
            _phpDoc = phpdoc;
            _initializer = initializer;
        }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PkgCreateResources" /> class.
        /// </summary>
        /// <param name="id">id (required).</param>
        /// <param name="kind">kind (required).</param>
        /// <param name="name">name.</param>
        public PkgCreateResources(string id = default(string), KindEnum kind = default(KindEnum), string name = default(string))
        {
            // to ensure "id" is required (not null)
            if (id == null)
            {
                throw new InvalidDataException("id is a required property for PkgCreateResources and cannot be null");
            }
            else
            {
                this.Id = id;
            }

            this.Kind = kind;
            this.Name = name;
        }
Beispiel #7
0
        public ArtykulyForm(KindEnum Kind, ModeEnum Mode, string ID) : this(Kind, Mode)
        {
            this.ID = ID;

            if (Kind == KindEnum.Book)
            {
                SetBook();
            }
            else if (Kind == KindEnum.Magazine)
            {
                SetMagazine();
            }

            SetAuthorsAndKeys();
        }
Beispiel #8
0
        public void Show(KindEnum kind)
        {
            // hidding all action buttons (made from GUI) except Close
            foreach (var item in toolbar.AllChildren)
            {
                if (item is Gtk.ToolButton)
                {
                    if ((item as Gtk.ToolButton).Name != "actionClose")
                    {
                        if ((item as Gtk.ToolButton).Action != null)
                        {
                            (item as Gtk.ToolButton).Action.Visible = false;
                        }
                    }
                }
            }
            // hidding language buttons
            foreach (var btn in LngButtons) btn.Visible = false;

            switch (kind)
            {
                case KindEnum.Add:

                        actionAddSingleFile.Visible = true;
                        actionAddFolder.Visible = true;
                        actionAddFolderRecursive.Visible = true;
                        //actionRemoveAll.Visible = false;
                        //actionRemoveSelected.Visible = false;
                    break;
                case KindEnum.Remove:
                        //actionAddFile.Visible = false;
                        //actionAddFolder.Visible = false;
                        actionRemoveAll.Visible = true;
                        actionRemoveSelected.Visible = true;
                    break;
                case KindEnum.Languages:
                        foreach (var btn in LngButtons) btn.Visible = true;
                    break;
                case KindEnum.Selection:
                        actionSelectAll.Visible = true;
                        actionUnselectAll.Visible = true;
                    break;
            }

            Show();

            SetSizeRequest (toolbar.Allocation.Size.Width+5, toolbar.Allocation.Size.Height+10);
        }
Beispiel #9
0
 public RecordingRule(
     [JsonProperty("type")]
     TypeEnum type,
     [JsonProperty("all")]
     bool?all,
     [JsonProperty("publisher")]
     string publisher,
     [JsonProperty("track")]
     string track,
     [JsonProperty("kind")]
     KindEnum kind
     )
 {
     Type      = type;
     All       = all;
     Publisher = publisher;
     Track     = track;
     Kind      = kind;
 }
Beispiel #10
0
 public SubscribeRule(
     [JsonProperty("type")]
     TypeEnum type,
     [JsonProperty("all")]
     bool?all,
     [JsonProperty("publisher")]
     string publisher,
     [JsonProperty("track")]
     string track,
     [JsonProperty("kind")]
     KindEnum kind,
     [JsonProperty("priority")]
     PriorityEnum priority
     )
 {
     Type      = type;
     All       = all;
     Kind      = kind;
     Priority  = priority;
     Publisher = publisher;
     Track     = track;
 }
Beispiel #11
0
        /// <summary>
        /// Adds an new word in the referential
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="kind">The kind.</param>
        /// <param name="multiplicity">The multiplicity.</param>
        /// <param name="types">The types.</param>
        /// <returns></returns>
        public WordItem Add(string text, KindEnum kind, MultiplicityEnum multiplicity, params string[] types)
        {
            Assert.NotEmpty(text, "text");
            Assert.Ensure(types.Length > 0, () => new ArgumentOutOfRangeException("types can't be empty"));

            List <WordType> _types = new List <WordType>();

            foreach (var item in types)
            {
                this.Types.Resolve(item.Trim());
            }

            WordItem w = new WordItem()
            {
                Text         = text.Trim(),
                Kind         = kind,
                Multiplicity = multiplicity,
                Types        = _types,
            };

            this._items.Add(w);

            return(w);
        }
        /// <summary>
        /// Parse the PropertyName structure.
        /// </summary>
        /// <param name="s">A stream containing the PropertyName structure</param>
        public override void Parse(Stream s)
        {
            base.Parse(s);
            this.Kind = (KindEnum)ReadByte();
            this.GUID = ReadGuid();
            switch (this.Kind)
            {
                case KindEnum.LID:
                    {
                        this.LID = ReadUint();
                        break;
                    }
                case KindEnum.Name:
                    {
                        this.NameSize = ReadByte();
                        this.Name = new MAPIString(Encoding.Unicode, "", (int)NameSize / 2);
                        this.Name.Parse(s);

                        break;
                    }
                case KindEnum.NoPropertyName:
                default:
                    {
                        break;
                    }
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Instrument" /> class.
        /// </summary>
        /// <param name="quoteCurrency">The currency in which the instrument prices are quoted. (required).</param>
        /// <param name="kind">Instrument kind, &#x60;\&quot;future\&quot;&#x60; or &#x60;\&quot;option\&quot;&#x60; (required).</param>
        /// <param name="tickSize">specifies minimal price change and, as follows, the number of decimal places for instrument prices (required).</param>
        /// <param name="contractSize">Contract size for instrument (required).</param>
        /// <param name="isActive">Indicates if the instrument can currently be traded. (required).</param>
        /// <param name="optionType">The option type (only for options).</param>
        /// <param name="minTradeAmount">Minimum amount for trading. For perpetual and futures - in USD units, for options it is amount of corresponding cryptocurrency contracts, e.g., BTC or ETH. (required).</param>
        /// <param name="instrumentName">Unique instrument identifier (required).</param>
        /// <param name="settlementPeriod">The settlement period. (required).</param>
        /// <param name="strike">The strike value. (only for options).</param>
        /// <param name="baseCurrency">The underlying currency being traded. (required).</param>
        /// <param name="creationTimestamp">The time when the instrument was first created (milliseconds) (required).</param>
        /// <param name="expirationTimestamp">The time when the instrument will expire (milliseconds) (required).</param>
        public Instrument(QuoteCurrencyEnum quoteCurrency = default(QuoteCurrencyEnum), KindEnum kind = default(KindEnum), decimal?tickSize = default(decimal?), int?contractSize = default(int?), bool?isActive = default(bool?), OptionTypeEnum?optionType = default(OptionTypeEnum?), decimal?minTradeAmount = default(decimal?), string instrumentName = default(string), SettlementPeriodEnum settlementPeriod = default(SettlementPeriodEnum), decimal?strike = default(decimal?), BaseCurrencyEnum baseCurrency = default(BaseCurrencyEnum), int?creationTimestamp = default(int?), int?expirationTimestamp = default(int?))
        {
            // to ensure "quoteCurrency" is required (not null)
            if (quoteCurrency == null)
            {
                throw new InvalidDataException("quoteCurrency is a required property for Instrument and cannot be null");
            }
            else
            {
                this.QuoteCurrency = quoteCurrency;
            }

            // to ensure "kind" is required (not null)
            if (kind == null)
            {
                throw new InvalidDataException("kind is a required property for Instrument and cannot be null");
            }
            else
            {
                this.Kind = kind;
            }

            // to ensure "tickSize" is required (not null)
            if (tickSize == null)
            {
                throw new InvalidDataException("tickSize is a required property for Instrument and cannot be null");
            }
            else
            {
                this.TickSize = tickSize;
            }

            // to ensure "contractSize" is required (not null)
            if (contractSize == null)
            {
                throw new InvalidDataException("contractSize is a required property for Instrument and cannot be null");
            }
            else
            {
                this.ContractSize = contractSize;
            }

            // to ensure "isActive" is required (not null)
            if (isActive == null)
            {
                throw new InvalidDataException("isActive is a required property for Instrument and cannot be null");
            }
            else
            {
                this.IsActive = isActive;
            }

            // to ensure "minTradeAmount" is required (not null)
            if (minTradeAmount == null)
            {
                throw new InvalidDataException("minTradeAmount is a required property for Instrument and cannot be null");
            }
            else
            {
                this.MinTradeAmount = minTradeAmount;
            }

            // to ensure "instrumentName" is required (not null)
            if (instrumentName == null)
            {
                throw new InvalidDataException("instrumentName is a required property for Instrument and cannot be null");
            }
            else
            {
                this.InstrumentName = instrumentName;
            }

            // to ensure "settlementPeriod" is required (not null)
            if (settlementPeriod == null)
            {
                throw new InvalidDataException("settlementPeriod is a required property for Instrument and cannot be null");
            }
            else
            {
                this.SettlementPeriod = settlementPeriod;
            }

            // to ensure "baseCurrency" is required (not null)
            if (baseCurrency == null)
            {
                throw new InvalidDataException("baseCurrency is a required property for Instrument and cannot be null");
            }
            else
            {
                this.BaseCurrency = baseCurrency;
            }

            // to ensure "creationTimestamp" is required (not null)
            if (creationTimestamp == null)
            {
                throw new InvalidDataException("creationTimestamp is a required property for Instrument and cannot be null");
            }
            else
            {
                this.CreationTimestamp = creationTimestamp;
            }

            // to ensure "expirationTimestamp" is required (not null)
            if (expirationTimestamp == null)
            {
                throw new InvalidDataException("expirationTimestamp is a required property for Instrument and cannot be null");
            }
            else
            {
                this.ExpirationTimestamp = expirationTimestamp;
            }

            this.OptionType = optionType;
            this.Strike     = strike;
        }
Beispiel #14
0
 public CatalogProfileLink(DocumentTypeEnum type = DocumentTypeEnum.Feed, KindEnum kind = KindEnum.None)
 {
     _type = type;
     _kind = kind;
 }
Beispiel #15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Position" /> class.
        /// </summary>
        /// <param name="direction">direction, &#x60;buy&#x60; or &#x60;sell&#x60; (required).</param>
        /// <param name="averagePriceUsd">Only for options, average price in USD.</param>
        /// <param name="estimatedLiquidationPrice">Only for futures, estimated liquidation price.</param>
        /// <param name="floatingProfitLoss">Floating profit or loss (required).</param>
        /// <param name="floatingProfitLossUsd">Only for options, floating profit or loss in USD.</param>
        /// <param name="openOrdersMargin">Open orders margin (required).</param>
        /// <param name="totalProfitLoss">Profit or loss from position (required).</param>
        /// <param name="realizedProfitLoss">Realized profit or loss.</param>
        /// <param name="delta">Delta parameter (required).</param>
        /// <param name="initialMargin">Initial margin (required).</param>
        /// <param name="size">Position size for futures size in quote currency (e.g. USD), for options size is in base currency (e.g. BTC) (required).</param>
        /// <param name="maintenanceMargin">Maintenance margin (required).</param>
        /// <param name="kind">Instrument kind, &#x60;\&quot;future\&quot;&#x60; or &#x60;\&quot;option\&quot;&#x60; (required).</param>
        /// <param name="markPrice">Current mark price for position&#39;s instrument (required).</param>
        /// <param name="averagePrice">Average price of trades that built this position (required).</param>
        /// <param name="settlementPrice">Last settlement price for position&#39;s instrument 0 if instrument wasn&#39;t settled yet (required).</param>
        /// <param name="indexPrice">Current index price (required).</param>
        /// <param name="instrumentName">Unique instrument identifier (required).</param>
        /// <param name="sizeCurrency">Only for futures, position size in base currency.</param>
        public Position(DirectionEnum direction = default(DirectionEnum), decimal?averagePriceUsd = default(decimal?), decimal?estimatedLiquidationPrice = default(decimal?), decimal?floatingProfitLoss = default(decimal?), decimal?floatingProfitLossUsd = default(decimal?), decimal?openOrdersMargin = default(decimal?), decimal?totalProfitLoss = default(decimal?), decimal?realizedProfitLoss = default(decimal?), decimal?delta = default(decimal?), decimal?initialMargin = default(decimal?), decimal?size = default(decimal?), decimal?maintenanceMargin = default(decimal?), KindEnum kind = default(KindEnum), decimal?markPrice = default(decimal?), decimal?averagePrice = default(decimal?), decimal?settlementPrice = default(decimal?), decimal?indexPrice = default(decimal?), string instrumentName = default(string), decimal?sizeCurrency = default(decimal?))
        {
            // to ensure "direction" is required (not null)
            if (direction == null)
            {
                throw new InvalidDataException("direction is a required property for Position and cannot be null");
            }
            else
            {
                this.Direction = direction;
            }

            // to ensure "floatingProfitLoss" is required (not null)
            if (floatingProfitLoss == null)
            {
                throw new InvalidDataException("floatingProfitLoss is a required property for Position and cannot be null");
            }
            else
            {
                this.FloatingProfitLoss = floatingProfitLoss;
            }

            // to ensure "openOrdersMargin" is required (not null)
            if (openOrdersMargin == null)
            {
                throw new InvalidDataException("openOrdersMargin is a required property for Position and cannot be null");
            }
            else
            {
                this.OpenOrdersMargin = openOrdersMargin;
            }

            // to ensure "totalProfitLoss" is required (not null)
            if (totalProfitLoss == null)
            {
                throw new InvalidDataException("totalProfitLoss is a required property for Position and cannot be null");
            }
            else
            {
                this.TotalProfitLoss = totalProfitLoss;
            }

            // to ensure "delta" is required (not null)
            if (delta == null)
            {
                throw new InvalidDataException("delta is a required property for Position and cannot be null");
            }
            else
            {
                this.Delta = delta;
            }

            // to ensure "initialMargin" is required (not null)
            if (initialMargin == null)
            {
                throw new InvalidDataException("initialMargin is a required property for Position and cannot be null");
            }
            else
            {
                this.InitialMargin = initialMargin;
            }

            // to ensure "size" is required (not null)
            if (size == null)
            {
                throw new InvalidDataException("size is a required property for Position and cannot be null");
            }
            else
            {
                this.Size = size;
            }

            // to ensure "maintenanceMargin" is required (not null)
            if (maintenanceMargin == null)
            {
                throw new InvalidDataException("maintenanceMargin is a required property for Position and cannot be null");
            }
            else
            {
                this.MaintenanceMargin = maintenanceMargin;
            }

            // to ensure "kind" is required (not null)
            if (kind == null)
            {
                throw new InvalidDataException("kind is a required property for Position and cannot be null");
            }
            else
            {
                this.Kind = kind;
            }

            // to ensure "markPrice" is required (not null)
            if (markPrice == null)
            {
                throw new InvalidDataException("markPrice is a required property for Position and cannot be null");
            }
            else
            {
                this.MarkPrice = markPrice;
            }

            // to ensure "averagePrice" is required (not null)
            if (averagePrice == null)
            {
                throw new InvalidDataException("averagePrice is a required property for Position and cannot be null");
            }
            else
            {
                this.AveragePrice = averagePrice;
            }

            // to ensure "settlementPrice" is required (not null)
            if (settlementPrice == null)
            {
                throw new InvalidDataException("settlementPrice is a required property for Position and cannot be null");
            }
            else
            {
                this.SettlementPrice = settlementPrice;
            }

            // to ensure "indexPrice" is required (not null)
            if (indexPrice == null)
            {
                throw new InvalidDataException("indexPrice is a required property for Position and cannot be null");
            }
            else
            {
                this.IndexPrice = indexPrice;
            }

            // to ensure "instrumentName" is required (not null)
            if (instrumentName == null)
            {
                throw new InvalidDataException("instrumentName is a required property for Position and cannot be null");
            }
            else
            {
                this.InstrumentName = instrumentName;
            }

            this.AveragePriceUsd           = averagePriceUsd;
            this.EstimatedLiquidationPrice = estimatedLiquidationPrice;
            this.FloatingProfitLossUsd     = floatingProfitLossUsd;
            this.RealizedProfitLoss        = realizedProfitLoss;
            this.SizeCurrency = sizeCurrency;
        }
Beispiel #16
0
 /// <summary>
 /// Creates a signal with a mode.
 /// </summary>
 /// <param name="identifier">the identifier of the signal</param>
 /// <param name="mode">the mode of the signal</param>
 /// <param name="type">the type of the signal</param>
 public Signal(string identifier, ModeEnum mode, SubtypeIndication type)
     : base(identifier, type)
 {
     Mode = mode;
     kind = KindEnum.DEFAULT;
 }
Beispiel #17
0
 public CatalogProfileLink(DocumentTypeEnum type = DocumentTypeEnum.Feed, KindEnum kind = KindEnum.None)
 {
     _type = type;
     _kind = kind;
 }