Example #1
0
        static void Main()
        {
            Console.Write("\n  Client of SelfHosted Strings service");
            Console.Write("\n ======================================\n");

            Thread.Sleep(2500); // give server time to start

            IStrings channel = CreateServiceChannel("http://localhost:8080/Strings");

            string str = "a not very important message";

            Console.Write("\n  sending:  \"{0}\"", str);
            channel.putString(str);
            Console.Write("\n  received: \"{0}\"", channel.getString());

            str = "a modifiable string";
            Console.Write("\n  sending \"{0}\"", str);
            channel.putRefString(ref str);
            Console.Write("\n  string modified to: \"{0}\"", str);

            channel.getOutString(out str);
            Console.Write("\n  received out parameter: \"{0}\"", str);

            Console.Write("\n\n  Press key to terminate client");
            Console.ReadKey();
            Console.Write("\n\n");
            ((IChannel)channel).Close();
        }
 private void CreateNamespaceNavs(SDRepository repository, IStrings strings, string outputPath)
 {
     foreach (var sdNamespace in repository.GetAllNamespaces())
     {
         var namespaceTemplate = new NamespaceNavTemplate { Namespace = sdNamespace, Strings = strings, ApiUrl = repository.Articles.Count == 0 ? "index" : "api" };
         File.WriteAllText(Path.Combine(outputPath, "nav", sdNamespace.Fullname + ".html"), namespaceTemplate.TransformText());
     }
 }
        static Strings()
        {
            var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "GoogleTestAdapter.Common.Dynamic.dll");
            var asm  = Assembly.LoadFile(path);
            var type = asm.GetType("GoogleTestAdapter.Common.Strings");

            _strings = (IStrings)Activator.CreateInstance(type);
        }
Example #4
0
 protected AbstractRibbonGroupModel(IGroupVM viewModel, IStrings strings)
 {
     ViewModel = (viewModel as IActivatable <IControlSource, IGroupVM>)
                 ?.Attach(this);
     Label     = strings?.Label ?? "Label";
     ScreenTip = strings?.ScreenTip ?? "ScreenTip";
     SuperTip  = strings?.SuperTip ?? "SuperTip";
     KeyTip    = strings?.KeyTip ?? "";
 }
Example #5
0
        public NumberTextEnglish(IStrings strings)
        {
            var numbers = strings.GetBySymbol("SS_NUMBERS");

            _numberTokens = numbers?.Text.Split('|') ?? Array.Empty <string>();

            var zero = strings.GetBySymbol("SS_ZEROTOKENS");

            _zeroTokens = zero?.Text.Split('|') ?? Array.Empty <string>();
        }
 private void CreateArticleNavs(SDRepository repository, IStrings strings, string currentLanguage, string outputPath)
 {
     if (repository.Articles.Count > 0)
     {
         var articles = repository.Articles.ContainsKey(currentLanguage)
             ? repository.Articles[currentLanguage]
             : repository.Articles["default"];
         CreateArticleNavs(articles, repository, strings, currentLanguage, outputPath);
     }
 }
        static Strings()
        {
            _strings = new Strings();

            // this is broken since 0.14.0 for reasons I don't understand. Switching to fixed GTA strings for now...
            // var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "GoogleTestAdapter.Common.Dynamic.dll");
            // var asm = Assembly.LoadFile(path);
            // var type = asm.GetType("GoogleTestAdapter.Common.Strings");
            // _strings = (IStrings)Activator.CreateInstance(type);
        }
 public CsvExporter(
     IMapper mapper,
     IVariables variables,
     IStrings strings,
     IEntityContainer entityContainer)
 {
     _mapper          = mapper;
     _variables       = variables;
     _strings         = strings;
     _entityContainer = entityContainer;
 }
Example #9
0
        public override void ProcessStep(ChmExporter chmExporter)
        {
            _tmpFilepath = chmExporter.TmpPath;
            _currentLanguage = chmExporter.CurrentLanguage;
            _repository = chmExporter.Repository;
            _chmConfig = chmExporter.ChmConfig;
            _strings = chmExporter.CurrentStrings;

            chmExporter.ExecuteOnStepProgress(10);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateStylesheet);
            CreateStylesheet();

            chmExporter.ExecuteOnStepProgress(15);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateIndex);
            CreateIndexFile();

            chmExporter.ExecuteOnStepProgress(20);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateToc);
            CreateTocFile();

            chmExporter.ExecuteOnStepProgress(25);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateProject);
            CreateProjectFile();

            chmExporter.ExecuteOnStepProgress(30);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateArticles);
            CreateArticleFiles();

            chmExporter.ExecuteOnStepProgress(35);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateNamespaces);
            CreateNamespaceFiles();

            chmExporter.ExecuteOnStepProgress(40);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateTypes);
            CreateTypeFiles();

            chmExporter.ExecuteOnStepProgress(45);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateFields);
            CreateFieldFiles();

            chmExporter.ExecuteOnStepProgress(50);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateEvents);
            CreateEventFiles();

            chmExporter.ExecuteOnStepProgress(55);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateProperties);
            CreatePropertyFiles();

            chmExporter.ExecuteOnStepProgress(60);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateMethods);
            CreateMethodFiles();

            chmExporter.CurrentStep = new CompileStep();
        }
Example #10
0
 static Platform()
 {
     if (Utils.IsUnix())
     {
         ModuleLoader = new Unix.UnixModuleLoader();
         Strings      = new Unix.UnixStrings();
     }
     else
     {
         ModuleLoader = new Win32.Win32ModuleLoader();
         Strings      = new Win32.Win32Strings();
     }
 }
Example #11
0
        private void CreateArticle(SDArticle article, SDRepository repository, IStrings strings, string outputPath)
        {
            if (!string.IsNullOrEmpty(article.Content) && article.Content != "SDDoc")
            {
                var articleTemplate = new ArticleTemplate { Repository = repository, Article = article, Strings = strings };
                File.WriteAllText(Path.Combine(outputPath, "article", string.Format("{0}.html", article.Title.Replace(" ", "_"))), articleTemplate.TransformText());
            }

            if (article.Content != "SDDoc")
            {
                foreach (var child in article.Children)
                {
                    CreateArticle(child, repository, strings, outputPath);
                }
            }
        }
        private void CreateArticleNavs(IEnumerable<SDArticle> articles, SDRepository repository, IStrings strings, string currentLanguage, string outputPath)
        {
            foreach (var article in articles)
            {
                if (article.Children.Count > 0)
                {
                    var artivleNavTemplate = new ArticleNavTemplate { Article = article, Repository = repository, Strings = strings, CurrentLanguage = currentLanguage };
                    File.WriteAllText(Path.Combine(outputPath, "nav", article.Title.Replace(" ", "_") + ".html"), artivleNavTemplate.TransformText());

                    CreateArticleNavs(article.Children, repository, strings, currentLanguage, outputPath);
                }
                else if (article.Content == "SDDoc")
                {
                    var apiNavWrapperTemplate = new ApiNavWrapperTemplate { Article = article, Repository = repository, Strings = strings, CurrentLanguage = currentLanguage };
                    File.WriteAllText(Path.Combine(outputPath, "nav", "api.html"), apiNavWrapperTemplate.TransformText());
                }
            }
        }
        public TMEDatabase(
            ILogger <TMEDatabase> logger,
            IEngine engine,
            IVariables variables,
            IStrings strings,
            IEntityContainer entityContainer,
            ISerializeContext serializeContext,
            IDependencyContainer container)
        {
            _container        = container.CurrentContainer;
            _logger           = logger;
            _engine           = engine;
            _variables        = variables;
            _strings          = strings;
            _entityContainer  = entityContainer;
            _serializeContext = serializeContext;

            GameMap = _container.Resolve <IMap>();
        }
 public static void UpdateLocal()
 {
     Strings = GetStringObj();
 }
Example #15
0
        private void CreateHtml(HtmlExporter htmlExporter, SDRepository repository, IStrings strings, string docLanguage, string outputPath)
        {
            var indexTemplate = new IndexTemplate { Repository = repository, Strings = strings, CurrentLanguage = docLanguage };
            File.WriteAllText(Path.Combine(outputPath, "index.html"), indexTemplate.TransformText());

            var namespaceCount = 0d;
            var namespaceTotal = repository.GetAllNamespaces().Count;
            foreach (var nameSpace in repository.GetAllNamespaces())
            {
                htmlExporter.ExecuteOnStepProgress(Convert.ToInt16((namespaceCount / namespaceTotal) * 50) + 50);
                htmlExporter.ExecuteOnStepMessage(htmlExporter.HtmlStrings.CreateFilesForNamespace + ": " + nameSpace.Fullname);
                namespaceCount++;

                var namespaceTemplate = new NamespaceTemplate { Strings = strings, CurrentLanguage = docLanguage, Namespace = nameSpace, Repository = repository };
                File.WriteAllText(Path.Combine(outputPath, "namespace", nameSpace.Guid + ".html"), namespaceTemplate.TransformText());

                foreach (var type in nameSpace.Types)
                {
                    type.SortMembers();
                    var typeTemplate = new TypeTemplate
                    {
                        Strings = strings,
                        CurrentLanguage = type.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                        SDType = type,
                        Repository = repository
                    };
                    File.WriteAllText(Path.Combine(outputPath, "type", type.Guid + ".html"), typeTemplate.TransformText());

                    foreach (var constructor in type.Constructors)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = constructor.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = constructor,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "constructor", constructor.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var method in type.Methods)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = method.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = method,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "method", method.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var field in type.Fields)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = field.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = field,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "field", field.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var property in type.Properties)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = property.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = property,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "property", property.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var eve in type.Events)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = eve.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = eve,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "event", eve.Guid + ".html"), memberTemplate.TransformText());
                    }
                }
            }
        }
Example #16
0
 public GameOfLifeEngine(IStrings strings, IFileSystem file)
 {
     _file    = file;
     _strings = strings;
     _status  = new GameStatus();
 }
 protected ControlModel(Func <string, IActivatable <TSource, TCtrl> > funcViewModel, IStrings strings)
 {
     AttachToViewModel = (controlId, source) => funcViewModel(controlId)?.Attach(source);
     Label             = strings?.Label;
     ScreenTip         = strings?.ScreenTip;
     SuperTip          = strings?.SuperTip;
     KeyTip            = strings?.KeyTip;
 }
 internal AbstractSelectableModel(Func <string, IActivatable <TSource, TCtrl> > funcViewModel, IStrings strings)
     : base(funcViewModel, strings)
 {
 }
 private void CreateIndexNav(SDRepository repository, IStrings strings, string currentLanguage, string outputPath)
 {
     var indexNavTemplate = new IndexNavTemplate { Repository = repository, Strings = strings, CurrentLanguage = currentLanguage };
     File.WriteAllText(Path.Combine(outputPath, "nav", "index.html"), indexNavTemplate.TransformText());
 }
Example #20
0
 protected AbstractRibbonGroupModel(IRibbonViewModel viewModel, string viewModelName, IStrings strings)
     : this(viewModel?.GetControl <GroupVM>(viewModelName), strings)
 {
 }