static KlassementValueConverter()
        {
            _vttl = new Dictionary<string, int>
            {
                ["A"] = 18,
                ["B0"] = 17,
                ["B2"] = 16,
                ["B4"] = 15,
                ["B6"] = 14,
                ["C0"] = 13,
                ["C2"] = 12,
                ["C4"] = 11,
                ["C6"] = 10,
                ["D0"] = 9,
                ["D2"] = 8,
                ["D4"] = 7,
                ["D6"] = 6,
                ["E0"] = 5,
                ["E2"] = 4,
                ["E4"] = 3,
                ["E6"] = 2,
                ["NG"] = 1
            };

            _sporta = new Dictionary<string, int>
            {
                ["A"] = 19,
                ["B0"] = 18,
                ["B2"] = 17,
                ["B4"] = 16,
                ["B6"] = 15,
                ["C0"] = 14,
                ["C2"] = 13,
                ["C4"] = 12,
                ["C6"] = 11,
                ["D0"] = 10,
                ["D2"] = 9,
                ["D4"] = 8,
                ["D6"] = 7,
                ["E0"] = 6,
                ["E2"] = 5,
                ["E4"] = 4,
                ["E6"] = 3,
                ["F"] = 2,
                ["NG"] = 1
            };
        }
 public virtual string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, System.Collections.Generic.IDictionary <string, object> variables, FormulaEvaluator e)
 {
     return(this.EvaluateFormula(formula, dataSourceForEvaluate, null, variables, true, e));
 }
        public virtual string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, string format, System.Collections.Generic.IDictionary <string, object> variables, bool includeDS, FormulaEvaluator e)
        {
            if (e == null)
            {
                e = new FormulaEvaluator();
            }

            e.Variables.Clear();
            // add variables for formula evaluation
            if (variables != null)
            {
                System.Collections.Generic.IEnumerator <System.Collections.Generic.KeyValuePair <string, object> > enumerator = variables.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    e.Variables.Add(enumerator.Current.Key, enumerator.Current.Value);
                }
            }


            if (includeDS)
            {
            }

            // All variables referred to in the formula are expected to be
            // properties of the DataSource.  For example, referring to
            // UnitPrice as a variable will refer to DataSource.UnitPrice
            if (dataSourceForEvaluate == null)
            {
                e.DataSource = this.DataSource;
            }
            else
            {
                e.DataSource = dataSourceForEvaluate;
            }

            // Define the calling control.  This is used to add other
            // related table and record controls as variables.
            e.CallingControl = this;

            object resultObj = e.Evaluate(formula);

            if (resultObj == null)
            {
                return("");
            }

            if (!string.IsNullOrEmpty(format) && (string.IsNullOrEmpty(formula) || formula.IndexOf("Format(") < 0))
            {
                return(FormulaUtils.Format(resultObj, format));
            }
            else
            {
                return(resultObj.ToString());
            }
        }
 protected override void Serialize(System.Collections.Generic.IDictionary <string, object> json)
 {
 }
        public static MvcHtmlString AuthorizedActionLinkOrPlainText(this HtmlHelper helper, string linkText, string action, string controller = null, System.Web.Routing.RouteValueDictionary routeValue = null, System.Collections.Generic.IDictionary <string, object> htmlAttributes = null)
        {
            MvcHtmlString s = helper.AuthorizedActionLink(linkText, action, controller, routeValue, htmlAttributes);
            MvcHtmlString result;

            if (MvcHtmlString.IsNullOrEmpty(s))
            {
                result = MvcHtmlString.Create(helper.Encode(linkText));
            }
            else
            {
                result = s;
            }
            return(result);
        }
Esempio n. 6
0
 protected virtual void OnPropertyChanging(string propertyName, object value)
 {
     if ((null == this._originalValues))
     {
         this._originalValues = new System.Collections.Generic.Dictionary<string, object>();
     }
     if ((false == this._originalValues.ContainsKey(propertyName)))
     {
         this._originalValues.Add(propertyName, value);
     }
     if ((null != this.PropertyChanging))
     {
         this.PropertyChanging(this, new System.ComponentModel.PropertyChangingEventArgs(propertyName));
     }
 }
Esempio n. 7
0
        public static T Resolve <T>()
        {
            var value = (T)_factories[typeof(T)]();

            return(value);
        }
Esempio n. 8
0
        /// <summary>
        /// Adds new attributes.
        /// </summary>
        public uint Add(IAttributeCollection tags)
        {
            if (tags == null)
            {
                return(NULL_ATTRIBUTES);
            }
            else if (tags.Count == 0)
            {
                return(EMPTY_ATTRIBUTES);
            }

            if (_isReadonly)
            { // this index is readonly.
                // TODO: make writeable.
                // - set nextId.
                // - create reverse indexes if needed.
                if (_index != null)
                { // this should be an increase-one index.
                    if ((_mode & AttributesIndexMode.IncreaseOne) != AttributesIndexMode.IncreaseOne)
                    {
                        throw new Exception("Invalid combination of data: There is an index but mode isn't increase one.");
                    }

                    _nextId = (uint)_index.Length;
                }

                // build reverse indexes if needed.
                if ((_mode & AttributesIndexMode.ReverseStringIndex) == AttributesIndexMode.ReverseStringIndex ||
                    (_mode & AttributesIndexMode.ReverseStringIndexKeysOnly) == AttributesIndexMode.ReverseStringIndexKeysOnly)
                {
                    _stringReverseIndex = new Reminiscence.Collections.Dictionary <string, int>(
                        new MemoryMapStream(), 1024 * 16);

                    // add existing data.
                    if ((_mode & AttributesIndexMode.ReverseStringIndex) == AttributesIndexMode.ReverseStringIndex)
                    { // build reverse index for all data.
                        foreach (var pair in _stringIndex)
                        {
                            _stringReverseIndex[pair.Value] = (int)pair.Key;
                        }
                    }
                    else
                    { // build reverse index for keys only.
                        foreach (var collectionPair in _collectionIndex)
                        {
                            foreach (var stringId in collectionPair.Value)
                            {
                                _stringReverseIndex[_stringIndex.Get(stringId)] = stringId;
                            }
                        }
                    }
                }

                if ((_mode & AttributesIndexMode.ReverseCollectionIndex) == AttributesIndexMode.ReverseCollectionIndex)
                {
                    _collectionReverseIndex = new Reminiscence.Collections.Dictionary <int[], uint>(new MemoryMapStream(), 1024 * 16, new EqualityComparer());
                    if (_index != null)
                    {
                        for (uint col = 0; col < _nextId; col++)
                        {
                            var pointer = _index[col];
                            _collectionReverseIndex[_collectionIndex.Get(pointer)] = col;
                        }
                    }
                    else
                    {
                        foreach (var pair in _collectionIndex)
                        {
                            _collectionReverseIndex[pair.Value] = (uint)pair.Key;
                        }
                    }
                }

                _isReadonly = false;
            }

            // add new collection.
            var sortedSet = new SortedSet <long>();

            foreach (var tag in tags)
            {
                sortedSet.Add((long)this.AddString(tag.Key, true) +
                              (long)int.MaxValue * (long)this.AddString(tag.Value, false));
            }

            // sort keys.
            var sorted = new int[sortedSet.Count * 2];
            var i      = 0;

            foreach (var pair in sortedSet)
            {
                sorted[i] = (int)(pair % int.MaxValue);
                i++;
                sorted[i] = (int)(pair / int.MaxValue);
                i++;
            }

            // add sorted collection.
            return(this.AddCollection(sorted));
        }
Esempio n. 9
0
 CassandraTable.Definition.IWithAttach <UpdateParentT> HasOptions.Definition.IWithOptions <CassandraTable.Definition.IWithAttach <UpdateParentT> > .WithOptionsAppend(System.Collections.Generic.IDictionary <string, string> options)
 {
     return(this.WithOptionsAppend(options));
 }
Esempio n. 10
0
 public static BitSet Of <TKey, TValue>(System.Collections.Generic.IDictionary <TKey, TValue> elements)
 {
     return(BitSet.Of(elements.Keys.Cast <int>()));
 }
Esempio n. 11
0
 public static string ToFormatString(this System.Collections.Generic.IDictionary <string, string> dictionary, string format)
 {
     return(dictionary.ToFormatString(format, ";"));
 }
Esempio n. 12
0
 public static string GetFormatValueString(this System.Collections.Generic.IDictionary <string, object> dictionary, string formatString)
 {
     return(dictionary.GetFormatValueString(formatString, null));
 }
Esempio n. 13
0
 public static System.Collections.Generic.IDictionary <string, string> Merger(this System.Collections.Generic.IDictionary <string, string> dictionary, object o, bool nullValueAsKey, ECase keyECase, bool includeInheritedProperty)
 {
     if (o != null)
     {
         if (o is System.Collections.Generic.IDictionary <string, string> )
         {
             System.Collections.Generic.IDictionary <string, string> dictionary2 = o as System.Collections.Generic.IDictionary <string, string>;
             foreach (string text in dictionary2.Keys)
             {
                 if (dictionary.ContainsKey(text.ToUpper()))
                 {
                     dictionary[text.ToUpper()] = dictionary2[text];
                 }
                 else
                 {
                     dictionary.Add(text.ToUpper(), dictionary2[text]);
                 }
             }
         }
         else
         {
             System.Reflection.PropertyInfo[] array  = includeInheritedProperty ? o.GetType().GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public) : o.GetType().GetProperties(System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public);
             System.Reflection.PropertyInfo[] array2 = array;
             for (int i = 0; i < array2.Length; i++)
             {
                 System.Reflection.PropertyInfo propertyInfo = array2[i];
                 string text = propertyInfo.Name;
                 if (keyECase == ECase.UPPER)
                 {
                     text = text.ToUpper();
                 }
                 else
                 {
                     if (keyECase == ECase.LOWER)
                     {
                         text = text.ToLower();
                     }
                 }
                 object value = propertyInfo.GetValue(o, null);
                 if (value != null)
                 {
                     if (!dictionary.ContainsKey(text))
                     {
                         dictionary.Add(text, value.ToString());
                     }
                     else
                     {
                         dictionary[text] = value.ToString();
                     }
                 }
                 else
                 {
                     if (nullValueAsKey)
                     {
                         if (!dictionary.ContainsKey(text))
                         {
                             dictionary.Add(text, null);
                         }
                         else
                         {
                             dictionary[text] = null;
                         }
                     }
                 }
             }
         }
     }
     return(dictionary);
 }
Esempio n. 14
0
 public MyEventArgs()
 {
     this.extras = new System.Collections.Generic.Dictionary <string, object>();
 }
 GremlinGraph.Definition.IWithAttach <UpdateDefinitionParentT> HasOptions.Definition.IWithOptions <GremlinGraph.Definition.IWithAttach <UpdateDefinitionParentT> > .WithOptionsAppend(System.Collections.Generic.IDictionary <string, string> options)
 {
     return(this.WithOptionsAppend(options));
 }
Esempio n. 16
0
        protected internal override void  DoClose()
        {
            lock (this)
            {
                System.IO.IOException ioe = null;
                normsCache = null;
                foreach (SegmentReader t in subReaders)
                {
					// try to close each reader, even if an exception is thrown
                	try
                	{
                		t.DecRef();
                	}
                	catch (System.IO.IOException e)
                	{
                		if (ioe == null)
                			ioe = e;
                	}
                }

            	// NOTE: only needed in case someone had asked for
                // FieldCache for top-level reader (which is generally
                // not a good idea):
                Search.FieldCache_Fields.DEFAULT.Purge(this);

                // throw the first exception
                if (ioe != null)
                    throw ioe;
            }
        }
 GremlinGraph.Update.IUpdate HasOptions.Update.IWithOptions <GremlinGraph.Update.IUpdate> .WithOptionsReplace(System.Collections.Generic.IDictionary <string, string> options)
 {
     return(this.WithOptionsReplace(options));
 }
Esempio n. 18
0
 CassandraTable.Update.IUpdate HasOptions.Update.IWithOptions <CassandraTable.Update.IUpdate> .WithOptionsReplace(System.Collections.Generic.IDictionary <string, string> options)
 {
     return(this.WithOptionsReplace(options));
 }
Esempio n. 19
0
 /// <summary>Initializes the extension (this implementation does nothing)</summary>
 /// <param name="parameters">Initialization parameters (ignored)</param>
 /// <version version="1.5.3">Added documentation</version>
 /// <version version="1.5.3">Parameter <c>Parameters</c> renamed to <c>parameters</c></version>
 /// <version version="1.5.4">Implementations of <c>Initialize</c> method for <see cref="ICodeExtension"/> and <see cref="IPostExtension"/> merged.</version>
 void IExtensionBase.Initialize(System.Collections.Generic.IDictionary <string, string> parameters)
 {
 }
Esempio n. 20
0
 public virtual bool ValidateConfiguration(IConfigurationDescription description, System.Collections.Generic.IDictionary <string, object> values, System.Collections.Generic.IDictionary <string, string> failures)
 {
     // Default is to do nothing
     return(true);
 }
Esempio n. 21
0
 public HashMap(System.Collections.Generic.IDictionary <string, object> dictionary)
     : base(dictionary)
 {
 }
Esempio n. 22
0
 public abstract void ApplyConfiguration(IConfigurationDescription description, System.Collections.Generic.IDictionary <string, object> values);
Esempio n. 23
0
 /// <summary>
 /// Returns a new expression that is the sum of the given variables.
 /// </summary>
 /// <typeparam name="TKey">This type is ignored.</typeparam>
 /// <param name="dictionary">The dictionary with variables to be summed up.</param>
 /// <returns>New expression that is the sum of the given variables.</returns>
 public static Expression Sum <TKey>(this System.Collections.Generic.IDictionary <TKey, Variable> dictionary)
 {
     return(Expression.Sum(dictionary.Values));
 }
Esempio n. 24
0
 public MDict(System.Collections.Generic.IDictionary <string, T> d) : base(d)
 {
 }
Esempio n. 25
0
        /// <summary>Initializes the extension</summary>
        /// <param name="parameters">Initialization parameters: This class expects following parameters:
        /// <list type="table"><listheader><term>Parameter</term><description>Description</description></listheader>
        /// <item><term><c>PropertyName</c></term><description>Name of property to add attribute to. Required.</description></item>
        /// <item><term><c>TypeName</c></term><description>Name of type property <c>PropertyName</c> is property of. Required.</description></item>
        /// <item><term><c>Name</c></term><description>Name of the attribute</description></item>
        /// <item><term><c>p-&lt;number></c></term><description>Positional attribute constructor parameter. Optional. See remarks.</description></item>
        /// <item><term><c>p-&lt;string></c></term><description>Named attribute parameter. Optional. See remarks.</description></item>
        /// </list></param>
        /// <remarks>
        /// Positional and named parameters of constructor have name in form p-&lt;number or name> and value in form "&lt;TypeName> &lt;value>".
        /// TypeName can be one of supported attribute parameter types (<see cref="String"/>, <see cref="Byte"/>, <see cref="SByte"/>, <see cref="Int16"/>, <see cref="UInt16"/>, <see cref="Int32"/>, <see cref="UInt32"/>, <see cref="Int64"/>, <see cref="UInt64"/>, <see cref="Decimnal"/>, <see cref="Single"/>, <see cref="Double"/>, <see cref="Boolean"/>, <see cref="DateTime"/>, <see cref="Char"/>, <see cref="Type"/>).
        /// If it is not one of them it's treated a name of enumeration type. For supported types value is parsed in invariant culture to that type using appropriate <c>Parse</c> method.
        /// With exception of <see cref="String"/> which is used directly and <see cref="Type"/> where value part is treated as type name.
        /// For enumerations value part is treated as name of enumeration memner of enumeration specified in type part.
        /// <para>
        /// Positional parameters are added as constuctor parameters in order of their position numbers. Missing position numbers are ignored. Skipped optional parameters are not supported.
        /// Named parameters are added at the end of parameters list as named parameters.
        /// </para></remarks>
        /// <exception cref="KeyNotFoundException">A required parameter is not present in the <paramref name="parameters"/> dictionary.</exception>
        /// <exception cref="FormatException">Value of numeric type cannot be parsed.</exception>
        /// <exception cref="OverflowException">Value of numeric type is out of range of given numberic type.</exception>
        public void Initialize(System.Collections.Generic.IDictionary <string, string> parameters)
        {
            propertyName  = parameters["PropertyName"];
            typeName      = parameters["TypeName"];
            attributeName = parameters["Name"];
            //Params in arguments name p-Name or p-Number
            //Content typename-space-value (typename cannot contain space)
            List <CodeAttributeArgument>            namedParams = new List <CodeAttributeArgument>();
            Dictionary <int, CodeAttributeArgument> posParams   = new Dictionary <int, CodeAttributeArgument>();

            foreach (var item in parameters)
            {
                if (item.Key.StartsWith("p-"))
                {
                    string         pName = item.Key.Substring(2);
                    CodeExpression pValue;
                    int            pnum;
                    string         TypeName  = item.Value.Substring(0, item.Value.IndexOf(' '));
                    string         valuePart = item.Value.Substring(item.Value.IndexOf(' ') + 1);
                    switch (TypeName)
                    {
                    case "System.String": pValue = new CodePrimitiveExpression(valuePart); break;

                    case "System.Byte": pValue = new CodePrimitiveExpression(byte.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.SByte": pValue = new CodePrimitiveExpression(SByte.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Int16": pValue = new CodePrimitiveExpression(Int16.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.UInt16": pValue = new CodePrimitiveExpression(UInt16.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Int32": pValue = new CodePrimitiveExpression(Int32.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.UInt32": pValue = new CodePrimitiveExpression(UInt32.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Int64": pValue = new CodePrimitiveExpression(Int64.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.UInt64": pValue = new CodePrimitiveExpression(UInt64.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Decimal": pValue = new CodePrimitiveExpression(Decimal.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Single": pValue = new CodePrimitiveExpression(Single.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Double": pValue = new CodePrimitiveExpression(Double.Parse(valuePart, System.Globalization.CultureInfo.InvariantCulture)); break;

                    case "System.Boolean": pValue = new CodePrimitiveExpression(bool.Parse(valuePart)); break;

                    case "System.DateTime": pValue = new CodePrimitiveExpression((DateTime) new XAttribute("x", valuePart)); break;

                    case "System.Char": pValue = new CodePrimitiveExpression(valuePart[0]); break;

                    case "System.Type": pValue = new CodeTypeOfExpression(valuePart); break;

                    default:    //Enum
                        pValue = new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(TypeName), valuePart); break;
                    }

                    if (int.TryParse(pName, System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.InvariantCulture, out pnum))
                    {
                        posParams.Add(pnum, new CodeAttributeArgument(pValue));
                    }
                    else
                    {
                        namedParams.Add(new CodeAttributeArgument(pName, pValue));
                    }
                }
            }
            attrParams.AddRange(from itm in posParams orderby itm.Key select itm.Value);
            attrParams.AddRange(namedParams);
        }
Esempio n. 26
0
 public System.Collections.Generic.IEnumerable <string> GetEnabledExtensionContentLocations(string contentTypeName, System.Collections.Generic.IDictionary <string, string> attributes)
 {
     throw new NotImplementedException();
 }
Esempio n. 27
0
 public string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, string format, System.Collections.Generic.IDictionary <string, object> variables)
 {
     return(EvaluateFormula(formula, dataSourceForEvaluate, format, variables, true));
 }
 /// <summary>
 /// Creates a new BlobDownloadInfo instance for mocking.
 /// </summary>
 public static BlobDownloadInfo BlobDownloadInfo(
     System.DateTimeOffset lastModified,
     long blobSequenceNumber,
     Azure.Storage.Blobs.Models.BlobType blobType,
     byte[] contentCrc64,
     string contentLanguage,
     string copyStatusDescription,
     string copyId,
     string copyProgress,
     System.Uri copySource,
     Azure.Storage.Blobs.Models.CopyStatus copyStatus,
     string contentDisposition,
     Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration,
     string cacheControl,
     Azure.Storage.Blobs.Models.LeaseState leaseState,
     string contentEncoding,
     Azure.Storage.Blobs.Models.LeaseStatus leaseStatus,
     byte[] contentHash,
     string acceptRanges,
     ETag eTag,
     int blobCommittedBlockCount,
     string contentRange,
     bool isServerEncrypted,
     string contentType,
     string encryptionKeySha256,
     long contentLength,
     byte[] blobContentHash,
     System.Collections.Generic.IDictionary <string, string> metadata,
     System.IO.Stream content,
     System.DateTimeOffset copyCompletionTime)
 {
     return(new BlobDownloadInfo(
                new FlattenedDownloadProperties()
     {
         LastModified = lastModified,
         BlobSequenceNumber = blobSequenceNumber,
         BlobType = blobType,
         ContentCrc64 = contentCrc64,
         ContentLanguage = contentLanguage,
         CopyStatusDescription = copyStatusDescription,
         CopyId = copyId,
         CopyProgress = copyProgress,
         CopySource = copySource,
         CopyStatus = copyStatus,
         ContentDisposition = contentDisposition,
         LeaseDuration = leaseDuration,
         CacheControl = cacheControl,
         LeaseState = leaseState,
         ContentEncoding = contentEncoding,
         LeaseStatus = leaseStatus,
         ContentHash = contentHash,
         AcceptRanges = acceptRanges,
         ETag = eTag,
         BlobCommittedBlockCount = blobCommittedBlockCount,
         ContentRange = contentRange,
         IsServerEncrypted = isServerEncrypted,
         ContentType = contentType,
         EncryptionKeySha256 = encryptionKeySha256,
         ContentLength = contentLength,
         BlobContentHash = blobContentHash,
         Metadata = metadata,
         Content = content,
         CopyCompletionTime = copyCompletionTime
     }
                ));
 }
 public virtual string EvaluateFormula(string formula, BaseClasses.Data.BaseRecord dataSourceForEvaluate, string format, System.Collections.Generic.IDictionary <string, object> variables, bool includeDS)
 {
     return(EvaluateFormula(formula, dataSourceForEvaluate, format, variables, includeDS, null));
 }
Esempio n. 30
0
 public ConstantExpressionReplacementVisitor(
     System.Collections.Generic.IDictionary <string, object> paramValues)
 {
     _paramValues = paramValues;
 }
 /// <summary>
 /// Creates a new StorageFileDownloadInfo instance for mocking.
 /// </summary>
 public static ShareFileDownloadInfo StorageFileDownloadInfo(
     System.DateTimeOffset lastModified = default,
     System.Collections.Generic.IEnumerable <string> contentLanguage = default,
     string acceptRanges = default,
     System.DateTimeOffset copyCompletionTime = default,
     string copyStatusDescription             = default,
     string contentDisposition = default,
     string copyProgress       = default,
     System.Uri copySource     = default,
     Azure.Storage.Files.Shares.Models.CopyStatus copyStatus = default,
     byte[] fileContentHash = default,
     bool isServerEncrypted = default,
     string cacheControl    = default,
     string fileAttributes  = default,
     System.Collections.Generic.IEnumerable <string> contentEncoding = default,
     System.DateTimeOffset fileCreationTime = default,
     byte[] contentHash = default,
     System.DateTimeOffset fileLastWriteTime = default,
     ETag eTag = default,
     System.DateTimeOffset fileChangeTime = default,
     string contentRange      = default,
     string filePermissionKey = default,
     string contentType       = default,
     string fileId            = default,
     long contentLength       = default,
     string fileParentId      = default,
     System.Collections.Generic.IDictionary <string, string> metadata = default,
     System.IO.Stream content = default,
     string copyId            = default)
 {
     return(new ShareFileDownloadInfo(
                new FlattenedStorageFileProperties()
     {
         LastModified = lastModified,
         ContentLanguage = contentLanguage,
         AcceptRanges = acceptRanges,
         CopyCompletionTime = copyCompletionTime,
         CopyStatusDescription = copyStatusDescription,
         ContentDisposition = contentDisposition,
         CopyProgress = copyProgress,
         CopySource = copySource,
         CopyStatus = copyStatus,
         FileContentHash = fileContentHash,
         IsServerEncrypted = isServerEncrypted,
         CacheControl = cacheControl,
         FileAttributes = fileAttributes,
         ContentEncoding = contentEncoding,
         FileCreationTime = fileCreationTime,
         ContentHash = contentHash,
         FileLastWriteTime = fileLastWriteTime,
         ETag = eTag,
         FileChangeTime = fileChangeTime,
         ContentRange = contentRange,
         FilePermissionKey = filePermissionKey,
         ContentType = contentType,
         FileId = fileId,
         ContentLength = contentLength,
         FileParentId = fileParentId,
         Metadata = metadata,
         Content = content,
         CopyId = copyId,
     }
                ));
 }
Esempio n. 32
0
 /// <summary>Initializes the extension</summary>
 /// <param name="parameters">Initialization parameters: Thic classs expects following parameters:
 /// <list type="table"><listheader><term>Parameter</term><description>Description</description></listheader>
 /// <item><term><c>Name</c></term><description>Name(s) of member to be removed. Multiple members separated by comma (,) - no whitespaces around. Required.</description></item>
 /// <item><term><c>Type</c></term><description>Name of type to remove members from. Required.</description></item>
 /// </list></param>
 /// <exception cref="KeyNotFoundException">A required ky is not present in <paramref name="parameters"/> dictionary.</exception>
 public void Initialize(System.Collections.Generic.IDictionary <string, string> parameters)
 {
     names = parameters["Name"].Split(',');
     type  = parameters["Type"];
 }
Esempio n. 33
0
 static QQHelper ()
 {
     TakeQqImageTasks = new List<GetQQImageTask>();
     QqImages = new Dictionary<string, BitmapImage>();
     LockObject = new object();
 }
        protected override void ActivateView(string viewName, System.Collections.Generic.IDictionary <string, object> viewParameters)
        {
            StartPerformanceTimer();

            string   view       = "";
            DateTime?period     = null;
            Employee employee   = null;
            DateTime?searchDate = null;

            object value = null;

            if (viewParameters.TryGetValue("New", out value))
            {
                IsNew = (bool)value;
            }

            if (viewParameters.ContainsKey("NewProfitCenter"))
            {
                NewOrganizationCreated = (Organization)viewParameters["NewProfitCenter"];
            }

            employee = (Employee)viewParameters["Employee"];

            // Check if any specific view should be set as active
            if (viewParameters.ContainsKey("SelectedView"))
            {
                view = viewParameters["SelectedView"].ToString();
            }
            // Check if a period should be loaded
            if (viewParameters.ContainsKey("Period") && viewParameters["Period"].ToString().Length > 0)
            {
                DateTime result;
                DateTime.TryParse(viewParameters["Period"].ToString(), out result);
                period = result;
            }

            if (viewParameters.ContainsKey("SearchDate") && viewParameters["SearchDate"] != null && viewParameters["SearchDate"].ToString().Length > 0)
            {
                DateTime result;
                DateTime.TryParse(viewParameters["SearchDate"].ToString(), out result);
                searchDate = result;
            }

            ReportControl = new ReportControlViewModel();
            if (employee != null)
            {
                ReportControl.CurrentEmployeeNumber = employee.EmployeeNumberStr;
                ReportControl.CurrentEmployeeId     = employee.EmployeeId;
            }
            ReportControl.LoadReportsForView((int)ReportViews.Employee, ReportService);
            RaisePropertyChanged(() => ReportControl);

            // Sanity check!
            if (employee == null)
            {
                return;
            }

            // Check if new or existing employee
            if (employee.EmployeeId > 0)
            {
                // Load employee from server
                LoadEmployee(employee.EmployeeId, searchDate, () => SetActiveView(view, period));
            }
            else
            {
                // New employee
                Employee = employee;
                LoadChildViewmodels();
                // Select first view
                if (_childVM != null && _childVM.Count > 0)
                {
                    SelectedView = _childVM[0];
                }
            }
        }