//
        // UserIDs
        //

        /// <summary>
        /// Get a list of all stored usernames and userids
        /// </summary>
        /// <returns>A dictory of [username]->[userid] values</returns>
        public static Dictionary <string, string> GetAllUsers()
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            try
            {
                RegistryKey key = DEFAULT.CreateSubKey("UserID");
                foreach (string name in key.GetValueNames())
                {
                    if (dic.ContainsKey(name))
                    {
                        continue;
                    }
                    string uid  = key.GetValue(name).ToString();
                    long   test = 0;
                    if (!long.TryParse(uid, out test))
                    {
                        continue;
                    }
                    if (uid != test.ToString())
                    {
                        continue;
                    }
                    dic.Add(name, uid);
                }
            }
            catch { }
            return(dic);
        }
Exemple #2
0
 public OSCMessage(string address, object msgvalue)
 {
     _typeTag          = DEFAULT.ToString();
     this.Address      = address;
     currentRreadIndex = 0;
     Append(msgvalue);
 }
Exemple #3
0
        internal virtual TransactionToApply NextTransaction(long txId)
        {
            PhysicalTransactionRepresentation representation = new PhysicalTransactionRepresentation(CreateRandomCommands());
            TransactionHeaderInformation      headerInfo     = DEFAULT.create();

            representation.SetHeader(headerInfo.AdditionalHeader, headerInfo.MasterId, headerInfo.AuthorId, headerInfo.AuthorId, txId, currentTimeMillis(), 42);
            return(new TransactionToApply(representation));
        }
 /// <summary>
 /// Sets the category file version
 /// </summary>
 public static void SetCategoryVersion(string category, long version)
 {
     try
     {
         RegistryKey key = DEFAULT.CreateSubKey("Category Index");
         key.SetValue(category, version, RegistryValueKind.QWord);
     }
     catch { }
 }
Exemple #5
0
        public static void Create(Uri navigationUri, Microsoft.Phone.Shell.ShellTileData initialData)
        {
            if (navigationUri == null)
            {
                throw new ArgumentNullException("navigationUri");
            }
            if (initialData == null)
            {
                throw new ArgumentNullException("initialData");
            }
            if (DEFAULT.Equals(navigationUri))
            {
                throw new ArgumentOutOfRangeException("navigationUri");
            }
            if (navigationUri.IsAbsoluteUri)
            {
                throw new ArgumentException("navigationUri cannot be absolute");
            }
            if ((navigationUri.ToString().IndexOf('/') != 0) && (navigationUri.ToString().IndexOf('?') != 0))
            {
                throw new UriFormatException();
            }
            int hr   = 0;
            var data = (Microsoft.Phone.Shell.StandardTileData)initialData;

            if ((data != null) && IsTileContainsAnyRemoteURL(data))
            {
                var    xml      = ConstructTokenXmlString(data, navigationUri.ToString());
                byte[] tokenXml = HardConvertUnicodeToASCIIByte(xml);
                var    schedule = new PM_LIVETOKEN_SCHEDULE();
                schedule.recurrenceType = PM_LIVETOKEN_RECURRENCE_TYPE.PM_LIVETOKEN_RECURRENCE_TYPE_INSTANT;
                schedule.fUserNoneIdle  = true;

                hr = TokenManager.CreateTokenWithLiveTokenSubscription(AppId, navigationUri.ToString(), ((data.BackgroundImage != null) && IsRemoteUri(data.BackgroundImage)) ? data.BackgroundImage.OriginalString.ToString() : null, ((data.BackBackgroundImage != null) && IsRemoteUri(data.BackBackgroundImage)) ? data.BackBackgroundImage.OriginalString.ToString() : null, ref schedule, tokenXml, (uint)tokenXml.Length);
            }
            else
            {
                IToken token          = null;
                string taskParameters = navigationUri.ToString();
                TokenManager.MakeToken(AppId, navigationUri.ToString(), 5 /* 5 = default*/ /*initialData.TemplateType*/, out token);
                /*initialData.*/
                //SerializeToToken(data, token);
                if (navigationUri.ToString().IndexOf('/') == 0)
                {
                    taskParameters = "#" + navigationUri.ToString();
                }
                // Dllimport => 8dc5214e-88fa-4c2d-a379-2cd74fe24b72
                token.set_InvocationInfo("_default{7C288D6D-AC47-4ac8-A849-9147FF693061}", taskParameters);
                uint num2       = (uint)(5 /*initialData.TemplateType*/ << 0x10);
                uint propertyId = num2 | 0x25;
                token.set_Property(propertyId, "");
                hr = TokenManager.AddToken(token);
            }
            ThrowExceptionFromHResult(hr, new InvalidOperationException());
        }
        /// <summary>
        /// Gets the category file version
        /// </summary>
        public static long GetCategoryVersion(string category)
        {
            RegistryKey key = DEFAULT.CreateSubKey("Category Index");
            object      ob  = key.GetValue(category);

            if (ob == null || ob.GetType() != typeof(long))
            {
                return(-1);
            }
            return((long)ob);
        }
        /// <summary>
        /// Delete a username from registry entry
        /// </summary>
        /// <param name="name">Username to delete</param>
        public static void DeleteUserid(string name)
        {
            if (!LocalDatabase.usernames.ContainsKey(name))
            {
                return;
            }
            LocalDatabase.usernames.Remove(name);
            RegistryKey key = DEFAULT.CreateSubKey("UserID");

            key.DeleteValue(name, false);
            Interactivity.UserNameListChanged();
        }
        //
        // UserIDs
        //

        /// <summary>
        /// Get a list of all stored usernames and userids
        /// </summary>
        /// <returns>A dictory of [username]->[userid] values</returns>
        public static Dictionary <string, string> GetAllUsers()
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            try
            {
                RegistryKey key = DEFAULT.CreateSubKey("UserID");
                foreach (string name in key.GetValueNames())
                {
                    dic.Add(name, key.GetValue(name).ToString());
                }
            }
            catch { }
            return(dic);
        }
Exemple #9
0
        internal static object Get(Node node, string attribute)
        {
            var    table = node.SymbolTable;
            object value = node;

            try {
                foreach (var attr in attribute.Split('.'))
                {
                    if (value == null)
                    {
                        break;
                    }
                    value = attributes[attr].GetValue(value, table);
                }
                return(value);
            } catch (KeyNotFoundException) {
                DEFAULT.Key = attribute;
                return(DEFAULT.GetValue(value, table));
            }
        }
Exemple #10
0
 public OSCMessage(string address)
 {
     _typeTag     = DEFAULT.ToString();
     this.Address = address;
 }
Exemple #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldOverrideMaxNumberOfProcessors()
        internal virtual void ShouldOverrideMaxNumberOfProcessors()
        {
            shouldOverride(expected => new ConfigurationAnonymousInnerClass5(this)
//JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter:
                           , Configuration::maxNumberOfProcessors, DEFAULT.maxNumberOfProcessors() + 1, DEFAULT.maxNumberOfProcessors() + 10);
        }
Exemple #12
0
            public long maxMemoryUsage()
            {
                string custom = _args.get(ImportTool.Options.MaxMemory.key(), (string)ImportTool.Options.MaxMemory.defaultValue());

                return(!string.ReferenceEquals(custom, null) ? ImportTool.ParseMaxMemory(custom).Value : DEFAULT.maxMemoryUsage());
            }
Exemple #13
0
 public int denseNodeThreshold()
 {
     return(_args.getNumber(dense_node_threshold.name(), DEFAULT.denseNodeThreshold()).intValue());
 }
Exemple #14
0
 public int maxNumberOfProcessors()
 {
     return(_args.getNumber(ImportTool.Options.Processors.key(), DEFAULT.maxNumberOfProcessors()).intValue());
 }
Exemple #15
0
 /// <inheritdoc />
 protected override object CreateLedCustomData(LedId ledId) => (ledId, PerKeyIdMapping.DEFAULT.TryGetValue(ledId, out LogitechLedId logitechLedId) ? logitechLedId : LogitechLedId.Invalid);
Exemple #16
0
        // warning, subsequent reads might give you array out of bounds error

        #region Constructors

        public OSCMessage(string address)
        {
            _typeTag          = DEFAULT.ToString();
            this.Address      = address;
            currentRreadIndex = 0;
        }