Ejemplo n.º 1
0
 public List<News> GetNewsForDistrict(string district)
 {
     var response = GetResponseForDistrict(district, "", 1000);
     var result = new List<News>();
     var scores = new Keywords();
     foreach (var document in response.Data.documents)
     {
         News news = new News();
         news.ID = document.identifier;
         if (document.entities != null && document.entities.keywords != null)
             foreach (var keyword in document.entities.keywords)
             {
                 int wordScore;
                 if (!scores.Scores.TryGetValue(keyword.lemma, out wordScore))
                 {
                     wordScore = new Random().Next(20)-10;
                 }
                 decimal score = wordScore*keyword.weight;
                 news.RawScore += score;
             }
         if (news.RawScore != 0)
         {
             result.Add(news);
         }
     }
     return result;
 }
Ejemplo n.º 2
0
		public Token(TokenType type, string ltoken, string token)
		{
			this.type = type;
			this.utoken = token;
			this.token = ltoken;
			this.keyword = Keywords.NotAKeyword;
		}
Ejemplo n.º 3
0
		public Token(TokenType type, Keywords keyword)
		{
			if (keyword == Keywords.Short) keyword = Keywords.Int;
			else if (keyword == Keywords.Scn) keyword = Keywords.ScriptName;
			this.type = type;
			this.keyword = keyword;
			this.token = keyword.ToString();
			this.utoken = this.token;
		}
Ejemplo n.º 4
0
        public ActionResult GetKeywordsStats(HomeModel homeModel)
        {
            string url = homeModel.RequestedUrl;

            //create stringbuilder for urlinfo
            StringBuilder sb = new StringBuilder();
            sb.Append("Wprowadź adres url");
            //basic validate
            if (String.IsNullOrWhiteSpace(url))
            {
                homeModel.UrlInfo = sb.ToString();

                //return to index with updated model
                return View("Index",homeModel);
            }
            if (Uri.IsWellFormedUriString(url, UriKind.Relative))
            {
                //append stringbuilder if url is not well formated
                sb.Append("<br />Wprowadź prawidłowy adres np. http://www.przyklad.pl");
                homeModel.UrlInfo = sb.ToString();
                //return to index with updated model
                return View("Index",homeModel);
            }

            //main process start
            HtmlAgilityPack.HtmlDocument doc = KeywordsStats.GetHtmlDoc("http://www.borbis.pl/");
            List<string> keywordsList = KeywordsStats.GetKeywords(doc);
            if (keywordsList.Count() < 1)
            {
                sb.Append("<br />Nie znaleziono słów kluczowych w nagłówku strony");
                homeModel.UrlInfo = sb.ToString();
                //return to index with updated model
                return View("Index", homeModel);
            }

            //getting body html
            string bodyText = KeywordsStats.GetBodyTextFromHtml(doc);

            //create keywords class list
            List<Keywords> KeywordsClassList = new List<Keywords>();
            int keywordCount = 0;
            foreach (var key in keywordsList)
            {
                keywordCount = KeywordsStats.CoutKeywordInText(key, bodyText);
                Keywords keyword = new Keywords(key, keywordCount);
                KeywordsClassList.Add(keyword);
            }
            //add test keyword object test
            KeywordsClassList.Add(new Keywords("test", 10));

            //create mdoel for stats view
            KeywordsStatsViewModel model = new KeywordsStatsViewModel();
            model.KeyWordsList = KeywordsClassList;
            //pass the model to view
            return View(model);
        }
Ejemplo n.º 5
0
 protected LogEntry(int eventId, Keywords keyword, Opcodes opcode, Tasks task, Levels level, EventSource eventSource, int version, string message, Payload payload, DateTime created)
 {
     Id = Guid.NewGuid();
     EventId = eventId;
     Keyword = keyword;
     Opcode = opcode;
     Task = task;
     Level = level;
     EventSource = eventSource;
     Version = version;
     Message = message;
     Payload = payload;
     Created = created;
 }
Ejemplo n.º 6
0
        protected ErrorLogEntry(Guid id, Guid accountId, int eventId, Keywords keyword, Opcodes opcode, Tasks task, Levels level,
			EventSource eventSource, int version, string message, string exceptionType, string exceptionMessage, string stackTrace, Payload payload, DateTime created)
        {
            Id = id;
            AccountId = accountId;
            EventId = eventId;
            Keyword = keyword;
            Opcode = opcode;
            Task = task;
            Level = level;
            EventSource = eventSource;
            Version = version;
            Message = message;
            ExceptionType = exceptionType;
            ExceptionMessage = exceptionMessage;
            StackTrace = stackTrace;
            Payload = payload;
            Created = created;
        }
Ejemplo n.º 7
0
    /// <summary>
    /// Initialize all of the internal objects inside of the query definition
    /// </summary>
    /// <returns>A new instance of type QueryDefinition</returns>
    public static Profiles GetNewProfilesDefinition()
    {
        QueryDefinition qd = new QueryDefinition();
        Profiles profiles = new Profiles();

        Name name = new Name();
        name.FirstName = new FirstName();
        name.LastName = new LastName();
        qd.Name = name;

        OutputOptions oo = new OutputOptions();
        oo.SortType = OutputOptionsSortType.QueryRelevance;
        oo.StartRecord = "0";

        Affiliation affiliation = new Affiliation();
        AffiliationList affList = new AffiliationList();

        //affiliations.AffiliationList = affList;
        affList.Affiliation = new List<Affiliation>();
        affList.Affiliation.Add(affiliation);

        FacultyRankList ftList = new FacultyRankList();
        ftList.FacultyRank = new List<string>();

        KeywordString kws = new KeywordString();
        Keywords kw = new Keywords();
        kw.KeywordString = new KeywordString();
        kw.KeywordString = kws;

        profiles.QueryDefinition = qd;
        profiles.QueryDefinition.AffiliationList = affList;
        profiles.QueryDefinition.Keywords = kw;
        profiles.QueryDefinition.Name = name;

        profiles.OutputOptions = oo;

        //its hard wired for 2 in this version.
        profiles.Version = 2;

        return profiles;
    }
		public object this[Keywords keyword]

		{
			get { return base[GetKeyName(keyword)]; }

			set { SetValue(GetKeyName(keyword), value); }
		}
 public bool ContainsKey(Keywords keyword)
 {
     return base.ContainsKey(GetKeyName(keyword));
 }
        private object GetAt(Keywords index)
        {
            switch (index)
            {
                case Keywords.DataSource:
                    return DataSource;

                case Keywords.Cache:
                    return Cache;

                default:
                    Debug.Fail("Unexpected keyword: " + index);
                    return null;
            }
        }
		internal static string GetKeyName(Keywords keyword)
		{
		    switch(keyword)
		    {
		        case Keywords.UserName:
    				return "USER ID";
                case Keywords.IntegratedSecurity:
    				return "INTEGRATED SECURITY";
                default:
    				return keyword.ToString().ToUpperInvariant();
		    }
		}
Ejemplo n.º 12
0
Archivo: Plug.cs Proyecto: devjerome/3P
        /// <summary>
        /// Called when the user has finished entering a word
        /// Called after the UI has updated, allows to correctly read the text style, to correct
        /// the indentation w/o it being erased and so on...
        /// </summary>
        /// <param name="c"></param>
        public static void OnCharAddedWordEnd(char c)
        {
            try {
                // we finished entering a keyword
                var curPos = Npp.CurrentPosition;
                int offset;
                if (c == '\n')
                {
                    offset  = curPos - Npp.GetLine().Position;
                    offset += (Npp.GetTextOnLeftOfPos(curPos - offset, 2).Equals("\r\n")) ? 2 : 1;
                }
                else
                {
                    offset = 1;
                }
                var searchWordAt    = curPos - offset;
                var keyword         = Npp.GetKeyword(searchWordAt);
                var isNormalContext = Style.IsCarretInNormalContext(searchWordAt);

                if (!String.IsNullOrWhiteSpace(keyword) && isNormalContext)
                {
                    string replacementWord = null;

                    // automatically insert selected keyword of the completion list
                    if (Config.Instance.AutoCompleteInsertSelectedSuggestionOnWordEnd && keyword.ContainsAtLeastOneLetter())
                    {
                        if (AutoComplete.IsVisible)
                        {
                            var lastSugg = AutoComplete.GetCurrentSuggestion();
                            if (lastSugg != null)
                            {
                                replacementWord = lastSugg.DisplayText;
                            }
                        }
                    }

                    // replace abbreviation by completekeyword
                    if (Config.Instance.CodeReplaceAbbreviations)
                    {
                        var fullKeyword = Keywords.GetFullKeyword(replacementWord ?? keyword);
                        if (fullKeyword != null)
                        {
                            replacementWord = fullKeyword;
                        }
                    }

                    // replace the last keyword by the correct case
                    var casedKeyword = AutoComplete.CorrectKeywordCase(replacementWord ?? keyword, searchWordAt);
                    if (casedKeyword != null)
                    {
                        replacementWord = casedKeyword;
                    }

                    if (replacementWord != null)
                    {
                        Npp.ReplaceKeywordWrapped(replacementWord, -offset);
                    }
                }


                // replace semicolon by a point
                if (c == ';' && Config.Instance.CodeReplaceSemicolon && isNormalContext)
                {
                    Npp.ModifyTextAroundCaret(-1, 0, ".");
                }

                // handles the autocompletion
                AutoComplete.UpdateAutocompletion();
            } catch (Exception e) {
                ErrorHandler.ShowErrors(e, "Error in OnCharAddedWordEnd");
            }
        }
Ejemplo n.º 13
0
        public void RecordMessage(string eventName, Guid activityId, Guid parentActivityId, EventLevel level, Keywords keywords, EventOpcode opcode, string jsonPayload)
        {
            if (!this.IsEnabled(level, keywords))
            {
                return;
            }

            this.RecordMessageInternal(eventName, activityId, parentActivityId, level, keywords, opcode, jsonPayload);
        }
Ejemplo n.º 14
0
 public void AddKeyword(KeywordType type, string value) => Keywords.Add(new Keyword(type, value));
        /// <summary>
        /// The function will modify private member only, not base[key].
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="value"></param>
        /// <returns>value, coerced as needed to the stored type.</returns>
        private object SetValue(Keywords keyword, object value)
        {
            try
            {
                switch (keyword)
                {
                    case Keywords.Host:
                        return this._host = Convert.ToString(value);
                    case Keywords.Port:
                        return this._port = Convert.ToInt32(value);
                    case Keywords.Protocol:
                        return this._protocol = ToProtocolVersion(value);
                    case Keywords.Database:
                        return this._database = Convert.ToString(value);
                    case Keywords.UserName:
                        return this._username = Convert.ToString(value);
                    case Keywords.Password:
                        this._password.Password = value as string;
                        return value as string;
                    case Keywords.SSL:
                        return this._ssl = ToBoolean(value);
                    case Keywords.SslMode:
                        return this._sslmode = ToSslMode(value);
            #pragma warning disable 618
                    case Keywords.Encoding:
                        return Encoding;
            #pragma warning restore 618
                    case Keywords.Timeout:
                        return this._timeout = ToInt32(value, 0, TIMEOUT_LIMIT, keyword);
                    case Keywords.SearchPath:
                        return this._searchpath = Convert.ToString(value);
                    case Keywords.Pooling:
                        return this._pooling = ToBoolean(value);
                    case Keywords.ConnectionLifeTime:
                        return this._connection_life_time = Convert.ToInt32(value);
                    case Keywords.MinPoolSize:
                        return this._min_pool_size = ToInt32(value, 0, POOL_SIZE_LIMIT, keyword);
                    case Keywords.MaxPoolSize:
                        return this._max_pool_size = ToInt32(value, 0, POOL_SIZE_LIMIT, keyword);
                    case Keywords.SyncNotification:
                        return this._sync_notification = ToBoolean(value);
                    case Keywords.CommandTimeout:
                        return this._command_timeout = Convert.ToInt32(value);
                    case Keywords.Enlist:
                        return this._enlist = ToBoolean(value);
                    case Keywords.PreloadReader:
                        return this._preloadReader = ToBoolean(value);
                    case Keywords.UseExtendedTypes:
                        return this._useExtendedTypes = ToBoolean(value);
                    case Keywords.IntegratedSecurity:
                        return this._integrated_security = ToIntegratedSecurity(value);
                    case Keywords.Compatible:
                        Version ver = new Version(value.ToString());
                        if (ver > THIS_VERSION)
                            throw new ArgumentException("Attempt to set compatibility with version " + value +
                                                        " when using version " + THIS_VERSION);
                        return _compatible = ver;
                    case Keywords.ApplicationName:
                        return this._application_name = Convert.ToString(value);
                    case Keywords.AlwaysPrepare:
                        return this._always_prepare = Convert.ToBoolean(value);
                }
            }
            catch (InvalidCastException exception)
            {
                string exception_template = string.Empty;

                switch (keyword)
                {
                    case Keywords.Port:
                    case Keywords.Timeout:
                    case Keywords.ConnectionLifeTime:
                    case Keywords.MinPoolSize:
                    case Keywords.MaxPoolSize:
                    case Keywords.CommandTimeout:
                        exception_template = resman.GetString("Exception_InvalidIntegerKeyVal");
                        break;
                    case Keywords.SSL:
                    case Keywords.Pooling:
                    case Keywords.SyncNotification:
                        exception_template = resman.GetString("Exception_InvalidBooleanKeyVal");
                        break;
                    case Keywords.Protocol:
                        exception_template = resman.GetString("Exception_InvalidProtocolVersionKeyVal");
                        break;
                }

                if (!string.IsNullOrEmpty(exception_template))
                {
                    string key_name = GetKeyName(keyword);

                    throw new ArgumentException(string.Format(exception_template, key_name), key_name, exception);
                }

                throw;
            }

            return null;
        }
Ejemplo n.º 16
0
 public TestEventListener(EventLevel maxVerbosity, Keywords keywordFilter, IEventListenerEventSink eventSink)
     : base(maxVerbosity, keywordFilter, eventSink)
 {
 }
Ejemplo n.º 17
0
        public void Mount(EventLevel verbosity, Keywords keywords)
        {
            this.currentState = MountState.Mounting;

            // We must initialize repo metadata before starting the pipe server so it
            // can immediately handle status requests
            string error;

            if (!RepoMetadata.TryInitialize(this.tracer, this.enlistment.DotGVFSRoot, out error))
            {
                this.FailMountAndExit("Failed to load repo metadata: " + error);
            }

            string gitObjectsRoot;

            if (!RepoMetadata.Instance.TryGetGitObjectsRoot(out gitObjectsRoot, out error))
            {
                this.FailMountAndExit("Failed to determine git objects root from repo metadata: " + error);
            }

            string localCacheRoot;

            if (!RepoMetadata.Instance.TryGetLocalCacheRoot(out localCacheRoot, out error))
            {
                this.FailMountAndExit("Failed to determine local cache path from repo metadata: " + error);
            }

            string blobSizesRoot;

            if (!RepoMetadata.Instance.TryGetBlobSizesRoot(out blobSizesRoot, out error))
            {
                this.FailMountAndExit("Failed to determine blob sizes root from repo metadata: " + error);
            }

            this.tracer.RelatedEvent(
                EventLevel.Informational,
                "CachePathsLoaded",
                new EventMetadata
            {
                { "gitObjectsRoot", gitObjectsRoot },
                { "localCacheRoot", localCacheRoot },
                { "blobSizesRoot", blobSizesRoot },
            });

            this.enlistment.InitializeCachePaths(localCacheRoot, gitObjectsRoot, blobSizesRoot);

            using (NamedPipeServer pipeServer = this.StartNamedPipe())
            {
                this.tracer.RelatedEvent(
                    EventLevel.Informational,
                    $"{nameof(this.Mount)}_StartedNamedPipe",
                    new EventMetadata {
                    { "NamedPipeName", this.enlistment.NamedPipeName }
                });

                this.context = this.CreateContext();

                if (this.context.Unattended)
                {
                    this.tracer.RelatedEvent(EventLevel.Critical, GVFSConstants.UnattendedEnvironmentVariable, null);
                }

                this.ValidateMountPoints();

                string errorMessage;
                if (!HooksInstaller.TryUpdateHooks(this.context, out errorMessage))
                {
                    this.FailMountAndExit(errorMessage);
                }

                GVFSPlatform.Instance.ConfigureVisualStudio(this.enlistment.GitBinPath, this.tracer);

                this.MountAndStartWorkingDirectoryCallbacks(this.cacheServer);

                Console.Title = "GVFS " + ProcessHelper.GetCurrentProcessVersion() + " - " + this.enlistment.EnlistmentRoot;

                this.tracer.RelatedEvent(
                    EventLevel.Critical,
                    "Mount",
                    new EventMetadata
                {
                    // Use TracingConstants.MessageKey.InfoMessage rather than TracingConstants.MessageKey.CriticalMessage
                    // as this message should not appear as an error
                    { TracingConstants.MessageKey.InfoMessage, "Virtual repo is ready" },
                });

                this.currentState = MountState.Ready;

                this.unmountEvent.WaitOne();
            }
        }
Ejemplo n.º 18
0
        private void Reset(Keywords index)
        {
            switch (index)
            {
            case Keywords.ApplicationIntent:
                _applicationIntent = DbConnectionStringDefaults.ApplicationIntent;
                break;

            case Keywords.ApplicationName:
                _applicationName = DbConnectionStringDefaults.ApplicationName;
                break;

            case Keywords.AttachDBFilename:
                _attachDBFilename = DbConnectionStringDefaults.AttachDBFilename;
                break;

            case Keywords.ConnectTimeout:
                _connectTimeout = DbConnectionStringDefaults.ConnectTimeout;
                break;

            case Keywords.CurrentLanguage:
                _currentLanguage = DbConnectionStringDefaults.CurrentLanguage;
                break;

            case Keywords.DataSource:
                _dataSource = DbConnectionStringDefaults.DataSource;
                break;

            case Keywords.Encrypt:
                _encrypt = DbConnectionStringDefaults.Encrypt;
                break;

            case Keywords.FailoverPartner:
                _failoverPartner = DbConnectionStringDefaults.FailoverPartner;
                break;

            case Keywords.InitialCatalog:
                _initialCatalog = DbConnectionStringDefaults.InitialCatalog;
                break;

            case Keywords.IntegratedSecurity:
                _integratedSecurity = DbConnectionStringDefaults.IntegratedSecurity;
                break;

            case Keywords.LoadBalanceTimeout:
                _loadBalanceTimeout = DbConnectionStringDefaults.LoadBalanceTimeout;
                break;

            case Keywords.MultipleActiveResultSets:
                _multipleActiveResultSets = DbConnectionStringDefaults.MultipleActiveResultSets;
                break;

            case Keywords.MaxPoolSize:
                _maxPoolSize = DbConnectionStringDefaults.MaxPoolSize;
                break;

            case Keywords.MinPoolSize:
                _minPoolSize = DbConnectionStringDefaults.MinPoolSize;
                break;

            case Keywords.MultiSubnetFailover:
                _multiSubnetFailover = DbConnectionStringDefaults.MultiSubnetFailover;
                break;

            //          case Keywords.NamedConnection:
            //              _namedConnection = DbConnectionStringDefaults.NamedConnection;
            //              break;
            case Keywords.PacketSize:
                _packetSize = DbConnectionStringDefaults.PacketSize;
                break;

            case Keywords.Password:
                _password = DbConnectionStringDefaults.Password;
                break;

            case Keywords.PersistSecurityInfo:
                _persistSecurityInfo = DbConnectionStringDefaults.PersistSecurityInfo;
                break;

            case Keywords.Pooling:
                _pooling = DbConnectionStringDefaults.Pooling;
                break;

            case Keywords.ConnectRetryCount:
                _connectRetryCount = DbConnectionStringDefaults.ConnectRetryCount;
                break;

            case Keywords.ConnectRetryInterval:
                _connectRetryInterval = DbConnectionStringDefaults.ConnectRetryInterval;
                break;

            case Keywords.Replication:
                _replication = DbConnectionStringDefaults.Replication;
                break;

            case Keywords.TrustServerCertificate:
                _trustServerCertificate = DbConnectionStringDefaults.TrustServerCertificate;
                break;

            case Keywords.TypeSystemVersion:
                _typeSystemVersion = DbConnectionStringDefaults.TypeSystemVersion;
                break;

            case Keywords.UserID:
                _userID = DbConnectionStringDefaults.UserID;
                break;

            case Keywords.UserInstance:
                _userInstance = DbConnectionStringDefaults.UserInstance;
                break;

            case Keywords.WorkstationID:
                _workstationID = DbConnectionStringDefaults.WorkstationID;
                break;

            default:
                Debug.Assert(false, "unexpected keyword");
                throw UnsupportedKeyword(s_validKeywords[(int)index]);
            }
        }
Ejemplo n.º 19
0
        private object GetAt(Keywords index)
        {
            switch (index)
            {
            case Keywords.ApplicationIntent: return(this.ApplicationIntent);

            case Keywords.ApplicationName: return(ApplicationName);

            case Keywords.AttachDBFilename: return(AttachDBFilename);

            case Keywords.ConnectTimeout: return(ConnectTimeout);

            case Keywords.CurrentLanguage: return(CurrentLanguage);

            case Keywords.DataSource: return(DataSource);

            case Keywords.Encrypt: return(Encrypt);

            case Keywords.FailoverPartner: return(FailoverPartner);

            case Keywords.InitialCatalog: return(InitialCatalog);

            case Keywords.IntegratedSecurity: return(IntegratedSecurity);

            case Keywords.LoadBalanceTimeout: return(LoadBalanceTimeout);

            case Keywords.MultipleActiveResultSets: return(MultipleActiveResultSets);

            case Keywords.MaxPoolSize: return(MaxPoolSize);

            case Keywords.MinPoolSize: return(MinPoolSize);

            case Keywords.MultiSubnetFailover: return(MultiSubnetFailover);

            //          case Keywords.NamedConnection:          return NamedConnection;
            case Keywords.PacketSize: return(PacketSize);

            case Keywords.Password: return(Password);

            case Keywords.PersistSecurityInfo: return(PersistSecurityInfo);

            case Keywords.Pooling: return(Pooling);

            case Keywords.Replication: return(Replication);

            case Keywords.TrustServerCertificate: return(TrustServerCertificate);

            case Keywords.TypeSystemVersion: return(TypeSystemVersion);

            case Keywords.UserID: return(UserID);

            case Keywords.UserInstance: return(UserInstance);

            case Keywords.WorkstationID: return(WorkstationID);

            case Keywords.ConnectRetryCount: return(ConnectRetryCount);

            case Keywords.ConnectRetryInterval: return(ConnectRetryInterval);

            default:
                Debug.Assert(false, "unexpected keyword");
                throw UnsupportedKeyword(s_validKeywords[(int)index]);
            }
        }
Ejemplo n.º 20
0
        public override object this[string keyword]
        {
            get
            {
                Keywords index = GetIndex(keyword);
                return(GetAt(index));
            }
            set
            {
                if (null != value)
                {
                    Keywords index = GetIndex(keyword);
                    switch (index)
                    {
                    case Keywords.ApplicationIntent: this.ApplicationIntent = ConvertToApplicationIntent(keyword, value); break;

                    case Keywords.ApplicationName: ApplicationName = ConvertToString(value); break;

                    case Keywords.AttachDBFilename: AttachDBFilename = ConvertToString(value); break;

                    case Keywords.CurrentLanguage: CurrentLanguage = ConvertToString(value); break;

                    case Keywords.DataSource: DataSource = ConvertToString(value); break;

                    case Keywords.FailoverPartner: FailoverPartner = ConvertToString(value); break;

                    case Keywords.InitialCatalog: InitialCatalog = ConvertToString(value); break;

                    //                  case Keywords.NamedConnection:          NamedConnection = ConvertToString(value); break;
                    case Keywords.Password: Password = ConvertToString(value); break;

                    case Keywords.UserID: UserID = ConvertToString(value); break;

                    case Keywords.TypeSystemVersion: TypeSystemVersion = ConvertToString(value); break;

                    case Keywords.WorkstationID: WorkstationID = ConvertToString(value); break;

                    case Keywords.ConnectTimeout: ConnectTimeout = ConvertToInt32(value); break;

                    case Keywords.LoadBalanceTimeout: LoadBalanceTimeout = ConvertToInt32(value); break;

                    case Keywords.MaxPoolSize: MaxPoolSize = ConvertToInt32(value); break;

                    case Keywords.MinPoolSize: MinPoolSize = ConvertToInt32(value); break;

                    case Keywords.PacketSize: PacketSize = ConvertToInt32(value); break;

                    case Keywords.IntegratedSecurity: IntegratedSecurity = ConvertToIntegratedSecurity(value); break;

                    case Keywords.Encrypt: Encrypt = ConvertToBoolean(value); break;

                    case Keywords.TrustServerCertificate: TrustServerCertificate = ConvertToBoolean(value); break;

                    case Keywords.MultipleActiveResultSets: MultipleActiveResultSets = ConvertToBoolean(value); break;

                    case Keywords.MultiSubnetFailover: MultiSubnetFailover = ConvertToBoolean(value); break;

                    case Keywords.PersistSecurityInfo: PersistSecurityInfo = ConvertToBoolean(value); break;

                    case Keywords.Pooling: Pooling = ConvertToBoolean(value); break;

                    case Keywords.Replication: Replication = ConvertToBoolean(value); break;

                    case Keywords.UserInstance: UserInstance = ConvertToBoolean(value); break;

                    case Keywords.ConnectRetryCount: ConnectRetryCount = ConvertToInt32(value); break;

                    case Keywords.ConnectRetryInterval: ConnectRetryInterval = ConvertToInt32(value); break;

                    default:
                        Debug.Assert(false, "unexpected keyword");
                        throw UnsupportedKeyword(keyword);
                    }
                }
                else
                {
                    Remove(keyword);
                }
            }
        }
 internal static string GetKeyName(Keywords keyword)
 {
     switch (keyword)
     {
         case Keywords.Host:
             return "HOST";
         case Keywords.Port:
             return "PORT";
         case Keywords.Protocol:
             return "PROTOCOL";
         case Keywords.Database:
             return "DATABASE";
         case Keywords.UserName:
             return "USER ID";
         case Keywords.Password:
             return "PASSWORD";
         case Keywords.SSL:
             return "SSL";
         case Keywords.SslMode:
             return "SSLMODE";
     #pragma warning disable 618
         case Keywords.Encoding:
     #pragma warning restore 618
             return "ENCODING";
         case Keywords.Timeout:
             return "TIMEOUT";
         case Keywords.SearchPath:
             return "SEARCHPATH";
         case Keywords.Pooling:
             return "POOLING";
         case Keywords.ConnectionLifeTime:
             return "CONNECTIONLIFETIME";
         case Keywords.MinPoolSize:
             return "MINPOOLSIZE";
         case Keywords.MaxPoolSize:
             return "MAXPOOLSIZE";
         case Keywords.SyncNotification:
             return "SYNCNOTIFICATION";
         case Keywords.CommandTimeout:
             return "COMMANDTIMEOUT";
         case Keywords.Enlist:
             return "ENLIST";
         case Keywords.PreloadReader:
             return "PRELOADREADER";
         case Keywords.UseExtendedTypes:
             return "USEEXTENDEDTYPES";
         case Keywords.IntegratedSecurity:
             return "INTEGRATED SECURITY";
         case Keywords.Compatible:
             return "COMPATIBLE";
         case Keywords.ApplicationName:
             return "APPLICATIONNAME";
         case Keywords.AlwaysPrepare:
             return "ALWAYSPREPARE";
         default:
             return keyword.ToString().ToUpperInvariant();
     }
 }
Ejemplo n.º 22
0
 public string GetKeyword(KeywordType type) => Keywords.First(key => key.Type == type).Value;
        /// <summary>
        /// The function will access private member only, not base[key].
        /// </summary>
        /// <param name="keyword"></param>
        /// <returns>value.</returns>
        private object GetValue(Keywords keyword)
        {
            switch (keyword)
            {
                case Keywords.Host:
                    return this._host;
                case Keywords.Port:
                    return this._port;
                case Keywords.Protocol:
                    return this._protocol;
                case Keywords.Database:
                    return this._database;
                case Keywords.UserName:
                    return this._username;
                case Keywords.Password:
                    return this._password.Password;
                case Keywords.SSL:
                    return this._ssl;
                case Keywords.SslMode:
                    return this._sslmode;
            #pragma warning disable 618
                case Keywords.Encoding:
                    return Encoding;
            #pragma warning restore 618
                case Keywords.Timeout:
                    return this._timeout;
                case Keywords.SearchPath:
                    return this._searchpath;
                case Keywords.Pooling:
                    return this._pooling;
                case Keywords.ConnectionLifeTime:
                    return this._connection_life_time;
                case Keywords.MinPoolSize:
                    return this._min_pool_size;
                case Keywords.MaxPoolSize:
                    return this._max_pool_size;
                case Keywords.SyncNotification:
                    return this._sync_notification;
                case Keywords.CommandTimeout:
                    return this._command_timeout;
                case Keywords.Enlist:
                    return this._enlist;
                case Keywords.PreloadReader:
                    return this._preloadReader;
                case Keywords.UseExtendedTypes:
                    return this._useExtendedTypes;
                case Keywords.IntegratedSecurity:
                    return this._integrated_security;
                case Keywords.Compatible:
                    return _compatible;
                case Keywords.ApplicationName:
                    return this._application_name;
                case Keywords.AlwaysPrepare:
                    return this._always_prepare;
                default:
                    return null;

            }
        }
Ejemplo n.º 24
0
 public bool IsKeyword(KeywordType type, string value) => Keywords.Any(key => key.Type == type && key.Value == value);
Ejemplo n.º 25
0
 public static Keywords CreateKeywords(global::System.Guid keywordsId, string text)
 {
     Keywords keywords = new Keywords();
     keywords.KeywordsId = keywordsId;
     keywords.Text = text;
     return keywords;
 }
 public override void ExitKeyword(Antlr.SearchPhraseParser.KeywordContext context)
 {
     base.ExitKeyword(context);
     Keywords.Add(Unescape(context.GetText()));
 }
Ejemplo n.º 27
0
			/// <see cref="Translator.CheckFor"/>
			public override bool CheckFor( Keywords nodeId, Keywords parentId )
			{
				return nodeId == Keywords.ID_MATERIAL;
			}
Ejemplo n.º 28
0
        IRefResolvable?IRefResolvable.ResolvePointerSegment(string?value)
        {
            var keyword = Keywords?.FirstOrDefault(k => k.Keyword() == value);

            return(keyword as IRefResolvable);
        }
Ejemplo n.º 29
0
			/// <see cref="Translator.CheckFor"/>
			internal override bool CheckFor( Keywords nodeId, Keywords parentId )
			{
				return nodeId == Keywords.ID_TECHNIQUE && parentId == Keywords.ID_MATERIAL;
			}
Ejemplo n.º 30
0
        private string ToDebugString()
        {
            var idKeyword = Keywords.OfType <IdKeyword>().SingleOrDefault();

            return(idKeyword?.Id.OriginalString ?? ValidationOptions.Default.DefaultBaseUri.OriginalString);
        }
        private void Reset(Keywords index)
        {
            switch (index)
            {
                case Keywords.DataSource:
                    _dataSource = string.Empty;
                    return;

                case Keywords.Cache:
                    _cacheMode = SqliteConnectionCacheMode.Private;
                    return;

                default:
                    Debug.Fail("Unexpected keyword: " + index);
                    return;
            }
        }
Ejemplo n.º 32
0
        /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>true if the current object is equal to the <paramref name="other">other</paramref> parameter; otherwise, false.</returns>
        public bool Equals(JsonSchema?other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (BoolValue.HasValue)
            {
                return(BoolValue == other.BoolValue);
            }
            if (other.BoolValue.HasValue)
            {
                return(false);
            }
            if (Keywords !.Count != other.Keywords !.Count)
            {
                return(false);
            }
            if (OtherData?.Count != other.OtherData?.Count)
            {
                return(false);
            }

            if (Keywords != null)
            {
                var byKeyword = Keywords.Join(other.Keywords,
                                              tk => tk.Keyword(),
                                              ok => ok.Keyword(),
                                              (tk, ok) => new { ThisKeyword = tk, OtherKeyword = ok })
                                .ToList();
                if (byKeyword.Count != Keywords.Count)
                {
                    return(false);
                }
                if (!byKeyword.All(k => k.ThisKeyword.Equals(k.OtherKeyword)))
                {
                    return(false);
                }
            }

            if (OtherData != null)
            {
                var byKey = OtherData.Join(other.OtherData !,
                                           td => td.Key,
                                           od => od.Key,
                                           (td, od) => new { ThisData = td.Value, OtherData = od.Value })
                            .ToList();
                if (byKey.Count != OtherData.Count)
                {
                    return(false);
                }
                if (!byKey.All(k => k.ThisData.IsEquivalentTo(k.OtherData)))
                {
                    return(false);
                }
            }

            return(true);
        }
		internal static object GetDefaultValue(Keywords keyword)

		{
			return defaults[keyword];
		}
Ejemplo n.º 34
0
        private JsonTracer CreateTracer(GVFSEnlistment enlistment, EventLevel verbosity, Keywords keywords)
        {
            JsonTracer tracer = new JsonTracer(GVFSConstants.GVFSEtwProviderName, "GVFSMount", enlistment.GetEnlistmentId(), enlistment.GetMountId());

            tracer.AddLogFileEventListener(
                GVFSEnlistment.GetNewGVFSLogFileName(enlistment.GVFSLogsRoot, GVFSConstants.LogFileTypes.MountProcess),
                verbosity,
                keywords);
            if (this.ShowDebugWindow)
            {
                tracer.AddDiagnosticConsoleEventListener(verbosity, keywords);
            }

            return(tracer);
        }
 public object this[Keywords keyword]
 {
     get { return GetValue(keyword); }
     set { SetValue(GetKeyName(keyword), keyword, value); }
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Parses a single header and sets member variables according to it.
        /// </summary>
        /// <param name="headerName">The name of the header</param>
        /// <param name="headerValue">The value of the header in unfolded state (only one line)</param>
        /// <exception cref="ArgumentNullException">If <paramref name="headerName"/> or <paramref name="headerValue"/> is <see langword="null"/></exception>
        private void ParseHeader(string headerName, string headerValue)
        {
            if (headerName == null)
            {
                throw new ArgumentNullException("headerName");
            }

            if (headerValue == null)
            {
                throw new ArgumentNullException("headerValue");
            }

            switch (headerName.ToUpperInvariant())
            {
            // See http://tools.ietf.org/html/rfc5322#section-3.6.3
            case "TO":
                To = RfcMailAddress.ParseMailAddresses(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.3
            case "CC":
                Cc = RfcMailAddress.ParseMailAddresses(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.3
            case "BCC":
                Bcc = RfcMailAddress.ParseMailAddresses(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.2
            case "FROM":
                // There is only one MailAddress in the from field
                From = RfcMailAddress.ParseMailAddress(headerValue);
                break;

            // http://tools.ietf.org/html/rfc5322#section-3.6.2
            // The implementation here might be wrong
            case "REPLY-TO":
                // This field may actually be a list of addresses, but no
                // such case has been encountered
                ReplyTo = RfcMailAddress.ParseMailAddress(headerValue);
                break;

            // http://tools.ietf.org/html/rfc5322#section-3.6.2
            case "SENDER":
                Sender = RfcMailAddress.ParseMailAddress(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.5
            // RFC 5322:
            // The "Keywords:" field contains a comma-separated list of one or more
            // words or quoted-strings.
            // The field are intended to have only human-readable content
            // with information about the message
            case "KEYWORDS":
                string[] keywordsTemp = headerValue.Split(',');
                foreach (string keyword in keywordsTemp)
                {
                    // Remove the quotes if there is any
                    Keywords.Add(Decode.Utility.RemoveQuotesIfAny(keyword.Trim()));
                }
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.7
            case "RECEIVED":
                // Simply add the value to the list
                Received.Add(new Received(headerValue.Trim()));
                break;

            case "IMPORTANCE":
                Importance = HeaderFieldParser.ParseImportance(headerValue.Trim());
                break;

            // See http://tools.ietf.org/html/rfc3798#section-2.1
            case "DISPOSITION-NOTIFICATION-TO":
                DispositionNotificationTo = RfcMailAddress.ParseMailAddresses(headerValue);
                break;

            case "MIME-VERSION":
                MimeVersion = headerValue.Trim();
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.5
            case "SUBJECT":
                Subject = EncodedWord.Decode(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.7
            case "RETURN-PATH":
                // Return-paths does not include a username, but we
                // may still use the address parser
                ReturnPath = RfcMailAddress.ParseMailAddress(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.4
            // Example Message-ID
            // <*****@*****.**>
            case "MESSAGE-ID":
                MessageId = HeaderFieldParser.ParseId(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.4
            case "IN-REPLY-TO":
                InReplyTo = HeaderFieldParser.ParseMultipleIDs(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.4
            case "REFERENCES":
                References = HeaderFieldParser.ParseMultipleIDs(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc5322#section-3.6.1))
            case "DATE":
                Date     = headerValue.Trim();
                DateSent = Rfc2822DateTime.StringToDate(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc2045#section-6
            // See ContentTransferEncoding class for more details
            case "CONTENT-TRANSFER-ENCODING":
                ContentTransferEncoding = HeaderFieldParser.ParseContentTransferEncoding(headerValue.Trim());
                break;

            // See http://tools.ietf.org/html/rfc2045#section-8
            case "CONTENT-DESCRIPTION":
                // Human description of for example a file. Can be encoded
                ContentDescription = EncodedWord.Decode(headerValue.Trim());
                break;

            // See http://tools.ietf.org/html/rfc2045#section-5.1
            // Example: Content-type: text/plain; charset="us-ascii"
            case "CONTENT-TYPE":
                ContentType = HeaderFieldParser.ParseContentType(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc2183
            case "CONTENT-DISPOSITION":
                ContentDisposition = HeaderFieldParser.ParseContentDisposition(headerValue);
                break;

            // See http://tools.ietf.org/html/rfc2045#section-7
            // Example: <foo4*[email protected]>
            case "CONTENT-ID":
                ContentId = HeaderFieldParser.ParseId(headerValue);
                break;

            default:
                // This is an unknown header

                // Custom headers are allowed. That means headers
                // that are not mentionen in the RFC.
                // Such headers start with the letter "X"
                // We do not have any special parsing of such

                // Add it to unknown headers
                UnknownHeaders.Add(headerName, headerValue);
                break;
            }
        }
 internal static object GetDefaultValue(Keywords keyword)
 {
     return valueDescriptions[keyword].ExplicitDefault;
 }
Ejemplo n.º 38
0
 private void AddKeyword()
 {
     Keywords.Add(new Keyword());
 }
        private static int ToInt32(object value, int min, int max, Keywords keyword)
        {
            int v = Convert.ToInt32(value);

            if (v < min)
            {
                string key = GetKeyName(keyword);

                throw new ArgumentOutOfRangeException(
                    key, String.Format(resman.GetString("Exception_IntegerKeyValMin"), key, min));
            }
            else if (v > max)
            {
                string key = GetKeyName(keyword);

                throw new ArgumentOutOfRangeException(
                    key, String.Format(resman.GetString("Exception_IntegerKeyValMax"), key, max));
            }

            return v;
        }
Ejemplo n.º 40
0
 protected bool IsEnabled(EventLevel level, Keywords keyword)
 {
     return(this.keywordFilter != Keywords.None &&
            this.maxVerbosity >= level &&
            (this.keywordFilter & keyword) != 0);
 }
        /// <summary>
        /// This function will set value for known key, both private member and base[key].
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns>value, coerced as needed to the stored type.</returns>
        private object SetValue(string keyword, Keywords key, object value)
        {
            ValueDescription description;

            description = valueDescriptions[key];

            if (! description.StoreInBase)
            {
                return value;
            }

            if (value == null)
            {
                Remove(keyword);
                return value;
            }

            value = SetValue(key, value);

            // If the value matches both the parameter's default and the type's default, remove it from base,
            // otherwise convert to string and set the base value.
            if (
                description.DefaultsDiffer ||
                (description.ExplicitDefault.CompareTo((IComparable)value) != 0)
            )
            {
                base[keyword] = description.ConvertNativeToString(value);
            }
            else
            {
                base.Remove(keyword);
            }

            return value;
        }
Ejemplo n.º 42
0
 public List<string> getKeywords()
 {
     Keywords obj = new Keywords();
     return obj.getkeywords();
 }
Ejemplo n.º 43
0
			/// <see cref="Translator.CheckFor"/>
			internal override bool CheckFor( Keywords nodeId, Keywords parentId )
			{
				return nodeId == Keywords.ID_TEXTURE_UNIT && parentId == Keywords.ID_PASS;
			}
Ejemplo n.º 44
0
        public Keywords GetKeywords(string documentId)
        {
            var keywords = new Keywords();

            var uDocument = App.Core.GetDocumentByID(long.Parse(documentId));
            foreach (KeywordRecord uKeywordRecord in uDocument.KeywordRecords.Where(x => x.KeywordRecordType.RecordType != RecordType.MultiInstance))
            {
                foreach (Keyword uKeyword in uKeywordRecord.Keywords)
                {
                    var keywordType = new KeywordType(uKeyword.KeywordType.ID,
                                                                    uKeyword.KeywordType.Name,
                                                                    GetSystemTypeFromUnityType(uKeyword.KeywordType.DataType),
                                                                    uKeyword.KeywordType.DefaultValue);
                    ObjectLibrary.Keyword keyword = null;
                    switch (uKeyword.KeywordType.DataType)
                    {
                        case KeywordDataType.AlphaNumeric:
                            keyword = new ObjectLibrary.Keyword(keywordType, uKeyword.AlphaNumericValue);
                            break;
                        case KeywordDataType.Currency:
                        case KeywordDataType.SpecificCurrency:
                            keyword = new ObjectLibrary.Keyword(keywordType, uKeyword.CurrencyValue);
                            break;
                        case KeywordDataType.Date:
                        case KeywordDataType.DateTime:
                            keyword = new ObjectLibrary.Keyword(keywordType, uKeyword.DateTimeValue);
                            break;
                        case KeywordDataType.FloatingPoint:
                            keyword = new ObjectLibrary.Keyword(keywordType, uKeyword.FloatingPointValue);
                            break;
                        case KeywordDataType.Numeric20:
                            keyword = new ObjectLibrary.Keyword(keywordType, uKeyword.Numeric20Value);
                            break;
                        case KeywordDataType.Numeric9:
                            keyword = new ObjectLibrary.Keyword(keywordType, uKeyword.Numeric9Value);
                            break;
                    }
                    keywords.Add(keyword);
                }
            }

            return keywords;
        }
Ejemplo n.º 45
0
 public void AddToKeywords(Keywords keywords)
 {
     base.AddObject("Keywords", keywords);
 }
Ejemplo n.º 46
0
        private void Style(int linenum, int end)
        {
            int line_length = SendMessageDirect(Constants.SCI_LINELENGTH, linenum);
            int start_pos   = SendMessageDirect(Constants.SCI_POSITIONFROMLINE, linenum);
            int laststyle   = start_pos;

            Cpp stylingMode;

            if (start_pos > 0)
            {
                stylingMode = (Cpp)GetStyleAt(start_pos - 1);
            }
            else
            {
                stylingMode = Cpp.Default;
            }
            bool onNewLine    = true;
            bool onScriptLine = false;
            int  i;

            SendMessageDirect(Constants.SCI_STARTSTYLING, start_pos, 0x1f);

            for (i = start_pos; i <= end; i++)
            {
                char c = (char)GetCharAt(i);

                if (!Char.IsLetterOrDigit(c) && (stylingMode != Cpp.Comment || stylingMode != Cpp.CommentLine || stylingMode != Cpp.String))
                {
                    string lastword = previousWordFrom(i);
                    if (lastword.Length != 0)
                    {
                        Cpp newMode = stylingMode;
                        if (onScriptLine && Keywords.Contains(lastword.Trim()))
                        {
                            newMode = Cpp.Word;
                        }
                        if (!onScriptLine && stylingMode == Cpp.Word2) // before colon
                        {
                            if (lastword.Trim() == "return" || lastword.Trim() == "stop")
                            {
                                newMode = Cpp.Word;
                            }
                        }


                        if (newMode != stylingMode)
                        {
                            SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle - lastword.Length, (int)stylingMode);
                            SendMessageDirect(Constants.SCI_SETSTYLING, lastword.Length, (int)newMode);
                            laststyle = i;
                        }
                    }
                }

                if (c == '\n')
                {
                    onNewLine    = true;
                    onScriptLine = false;
                    if (stylingMode != Cpp.Comment && stylingMode != Cpp.String)
                    {
                        if (laststyle < i)
                        {
                            SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                            laststyle = i;
                        }
                        stylingMode = Cpp.Default;
                    }
                    continue;
                }

                if (onNewLine)
                {
                    if (c == ' ')
                    {
                        onScriptLine = true;
                        onNewLine    = false;
                        continue;
                    }
                }

                if (onScriptLine)
                {
                    if (isOperator(c))
                    {
                        if (stylingMode != Cpp.String && stylingMode != Cpp.Comment && stylingMode != Cpp.CommentLine)
                        {
                            SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                            SendMessageDirect(Constants.SCI_SETSTYLING, 1, (int)Cpp.Operator);
                            stylingMode = Cpp.Default;
                            laststyle   = i + 1;
                        }
                    }

                    else if (isNumeric(c))
                    {
                        if (stylingMode != Cpp.String && stylingMode != Cpp.Comment && stylingMode != Cpp.CommentLine)
                        {
                            SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                            SendMessageDirect(Constants.SCI_SETSTYLING, 1, (int)Cpp.Number);
                            stylingMode = Cpp.Default;
                            laststyle   = i + 1;
                        }
                    }
                    else if (c == '"')
                    {
                        if (stylingMode == Cpp.String)
                        {
                            SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle + 1, (int)stylingMode);
                            laststyle   = i + 1;
                            stylingMode = Cpp.Default;
                        }
                        else
                        {
                            stylingMode = Cpp.String;
                        }
                    }
                }
                else
                {
                    if (onNewLine && stylingMode != Cpp.Comment)
                    {
                        SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                        stylingMode = Cpp.Word2;
                        laststyle   = i;
                    }
                    if (c == ':' && stylingMode != Cpp.Comment && stylingMode != Cpp.CommentLine)
                    {
                        SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle + 1, (int)stylingMode);
                        laststyle   = i + 1;
                        stylingMode = Cpp.Number;
                    }
                    if (c == '@' && stylingMode == Cpp.Word2)
                    {
                        SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                        stylingMode = Cpp.Number;
                        laststyle   = i;
                    }
                }

                if (c == '/')
                {
                    if (stylingMode == Cpp.Comment && GetCharAt(i - 1) == '*')
                    {
                        SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle + 1, (int)stylingMode);
                        stylingMode = Cpp.Default;
                        laststyle   = i + 1;
                    }
                    else if (GetCharAt(i + 1) == '*' && onScriptLine)
                    {
                        SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                        stylingMode = Cpp.Comment;
                        laststyle   = i;
                    }
                    else if (GetCharAt(i + 1) == '/')
                    {
                        SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
                        stylingMode = Cpp.CommentLine;
                        laststyle   = i;
                    }
                }

                onNewLine = false;
            }



            SendMessageDirect(Constants.SCI_SETSTYLING, i - laststyle, (int)stylingMode);
        }
Ejemplo n.º 47
0
			/// <see cref="Translator.CheckFor"/>
			public override bool CheckFor( Keywords nodeId, Keywords parentId )
			{
				return nodeId == Keywords.ID_TEXTURE_SOURCE && parentId == Keywords.ID_TEXTURE_UNIT;
			}
Ejemplo n.º 48
0
        internal void EmitKeyword(CljILGen ilg, Keyword kw)
        {
            int i = (int)Keywords.valAt(kw);

            EmitConstant(ilg, i, kw);
        }
			/// <see cref="Translator.CheckFor"/>
			internal override bool CheckFor( Keywords nodeId, Keywords parentId )
			{
				return nodeId == Keywords.ID_TECHNIQUE && parentId == Keywords.ID_COMPOSITOR;
			}
Ejemplo n.º 50
0
        private JsonTracer CreateTracer(GVFSEnlistment enlistment, EventLevel verbosity, Keywords keywords)
        {
            string enlistmentId = null;
            string mountId      = null;

            GitProcess git = new GitProcess(enlistment);

            GitProcess.Result configResult = git.GetFromLocalConfig(GVFSConstants.GitConfig.EnlistmentId);
            if (!configResult.HasErrors)
            {
                enlistmentId = configResult.Output.Trim();
            }

            configResult = git.GetFromLocalConfig(GVFSConstants.GitConfig.MountId);
            if (!configResult.HasErrors)
            {
                mountId = configResult.Output.Trim();
            }

            JsonTracer tracer = new JsonTracer(GVFSConstants.GVFSEtwProviderName, "GVFSMount", enlistmentId: enlistmentId, mountId: mountId);

            tracer.AddLogFileEventListener(
                GVFSEnlistment.GetNewGVFSLogFileName(enlistment.GVFSLogsRoot, GVFSConstants.LogFileTypes.MountProcess),
                verbosity,
                keywords);
            if (this.ShowDebugWindow)
            {
                tracer.AddDiagnosticConsoleEventListener(verbosity, keywords);
            }

            return(tracer);
        }
Ejemplo n.º 51
0
 protected EventListener(EventLevel maxVerbosity, Keywords keywordFilter, IEventListenerEventSink eventSink)
 {
     this.maxVerbosity  = maxVerbosity;
     this.keywordFilter = keywordFilter;
     this.eventSink     = eventSink;
 }
Ejemplo n.º 52
0
 public InProcEventListener(EventLevel maxVerbosity, Keywords keywordFilter)
 {
     this.maxVerbosity  = maxVerbosity;
     this.keywordFilter = keywordFilter;
 }
Ejemplo n.º 53
0
		public bool IsKeyword(Keywords k)
		{
			return type == TokenType.Keyword && keyword == k;
		}
Ejemplo n.º 54
0
 public bool IsKeyword(Keywords k)
 {
     return(this.type == TokenType.Keyword && this.keyword == k);
 }