예제 #1
0
        void SaveUiLayout()
        {
            WindowInfo vl = new WindowInfo();

            vl.Convert(this);

            if (!Directory.Exists(InternalConfigDir))
            {
                Directory.CreateDirectory(InternalConfigDir);
            }
            Cbf.WriteFile(Path.Combine(InternalConfigDir, LayoutConfigFilename), vl);
        }
예제 #2
0
        void LoadUiLayout()
        {
            string filename = Path.Combine(InternalConfigDir, LayoutConfigFilename);

            if (File.Exists(filename))
            {
                _savedWindow = Cbf.ReadFile <WindowInfo>(filename);
            }
            else
            {
                var assembly = Assembly.GetExecutingAssembly();

                using (var stream = assembly.GetManifestResourceStream(DefaultLayoutDefinition))
                {
                    _savedWindow = Cbf.Read <WindowInfo>(stream);
                }
            }
            _savedWindow.Convert(this, _uiManager);
        }