コード例 #1
0
        public static bool Choise(DisplayModeType modeType)
        {
            var doc = RhinoDoc.ActiveDoc;

            if (doc == null)
            {
                return(false);
            }

            using (new Viewport.RedrawSuppressor(doc, "DisplayModesManager.Choise", false, false))
            {
                using (var m = new DisplayModesManager())
                {
                    var mode = m.GetMode(modeType);
                    if (mode != null)
                    {
                        if (doc.Views.ActiveView != null &&
                            doc.Views.ActiveView.ActiveViewport != null)
                        {
                            CurrentDisplayMode = modeType;
                            doc.Views.ActiveView.ActiveViewport.DisplayMode = mode;
                            UpdateTopoLayerVisibility();
                            Viewport.Redraw(doc, "DisplayModesManager.Choise");
                            return(true);
                        }
                    }
                    return(false);
                }
            }
        }
コード例 #2
0
        public DisplayModeDescription GetMode(DisplayModeType modeType)
        {
            if (modeType == DisplayModeType.Other)
            {
                return(null);
            }
            if (DisplayModes.ContainsKey(modeType))
            {
                return(DisplayModes[modeType]); // return from cache
            }

            var modeName = "SolidFix_" + modeType;
            var mode     = DisplayModeDescription.FindByName(modeName);

            if (mode == null)
            {
                log.info(g.SolidFix, "\n * Cannot find SolidFix Display Mode '{0}'", modeName);
                var path = Path.Combine(Utils.AssemblyDirectory, @"DisplayModes\");
                log.info(g.SolidFix, "* Please go to 'Options->View->Display Modes' \n  and import SolidFix display mode \n  from location:  '{0}'\n", path);
                return(null);
            }
            else
            {
                DisplayModes[modeType] = mode; // cache
            }
            return(mode);
        }
コード例 #3
0
 public UserSetData(int audio, int voice, CVType cvType, LanguageType languageType, DisplayModeType displayModeType, ResolutionType resolutionType)
 {
     this.audio           = audio;
     this.voice           = voice;
     this.cvType          = cvType;
     this.languageType    = languageType;
     this.displayModeType = displayModeType;
     this.resolutionType  = resolutionType;
 }
コード例 #4
0
        protected override void HandleLayoutChange(DisplayModeType displayType)
        {
            SnappedBorder.Visibility = Visibility.Collapsed;
            FullFilledGrid.Visibility = Visibility.Visible;

            if (displayType == DisplayModeType.Snapped)
            {
                SnappedBorder.Visibility = Visibility.Visible;
                FullFilledGrid.Visibility = Visibility.Collapsed;
            }
        }
コード例 #5
0
        protected override void HandleLayoutChange(DisplayModeType displayType)
        {
            SnappedBorder.Visibility  = Visibility.Collapsed;
            FullFilledGrid.Visibility = Visibility.Visible;

            if (displayType == DisplayModeType.Snapped)
            {
                SnappedBorder.Visibility  = Visibility.Visible;
                FullFilledGrid.Visibility = Visibility.Collapsed;
            }
        }
コード例 #6
0
 /// <summary>
 /// Set the default values of the settings
 /// </summary>
 private void RestoreDefaults()
 {
     this.displayMode          = DisplayModeType.Center;
     this.backgroundColor      = "Black";
     this.startAutomatically   = true;
     this.startMinimized       = false;
     this.changeAtStartup      = false;
     this.changeRandomly       = true;
     this.fileListIndex        = 0;
     this.highResolutionThumbs = false;
     this.changeAutomatically  = false;
     this.timeInterval         = 30;
 }
コード例 #7
0
 public PageInfo(string name, float weight, DisplayModeType displayMode, int textResId, string logFile, bool jobActivate, string classCode, bool codeShowWarnings, JobsInfo jobsInfo, ErrorsInfo errorsInfo, List <DisplayInfo> displayList, List <StringInfo> stringList)
 {
     Name             = name;
     Weight           = weight;
     DisplayMode      = displayMode;
     TextResId        = textResId;
     LogFile          = logFile;
     JobActivate      = jobActivate;
     ClassCode        = classCode;
     CodeShowWarnings = codeShowWarnings;
     JobsInfo         = jobsInfo;
     ErrorsInfo       = errorsInfo;
     DisplayList      = displayList;
     StringList       = stringList;
     InfoObject       = null;
     ClassObject      = null;
 }
コード例 #8
0
ファイル: MainView.xaml.cs プロジェクト: xximjasonxx/Codemash
        protected override void HandleLayoutChange(DisplayModeType displayType)
        {
            FilledGridView.Visibility = Visibility.Visible;
            SnappedListView.Visibility = Visibility.Collapsed;
            PageTitle.Style = (Style) App.Current.Resources["PageTitle"];
            PageTitle.Margin = new Thickness(20,0,0,7);
            AppBar.Visibility = Visibility.Visible;

            if (displayType == DisplayModeType.Snapped)
            {
                FilledGridView.Visibility = Visibility.Collapsed;
                SnappedListView.Visibility = Visibility.Visible;
                PageTitle.Style = (Style) App.Current.Resources["SnappedPageTitle"];
                PageTitle.Margin = new Thickness(10, 0, 0, 7);
                AppBar.Visibility = Visibility.Collapsed;
            }
        }
コード例 #9
0
        protected override void HandleLayoutChange(DisplayModeType displayType)
        {
            FilledGridView.Visibility  = Visibility.Visible;
            SnappedListView.Visibility = Visibility.Collapsed;
            PageTitle.Style            = (Style)App.Current.Resources["PageTitle"];
            PageTitle.Margin           = new Thickness(20, 0, 0, 7);
            AppBar.Visibility          = Visibility.Visible;

            if (displayType == DisplayModeType.Snapped)
            {
                FilledGridView.Visibility  = Visibility.Collapsed;
                SnappedListView.Visibility = Visibility.Visible;
                PageTitle.Style            = (Style)App.Current.Resources["SnappedPageTitle"];
                PageTitle.Margin           = new Thickness(10, 0, 0, 7);
                AppBar.Visibility          = Visibility.Collapsed;
            }
        }
コード例 #10
0
        protected override void HandleLayoutChange(DisplayModeType displayType)
        {
            SnappedListView.Visibility = Visibility.Collapsed;
            FullGridView.Visibility = Visibility.Visible;
            GoBack.Margin = new Thickness(36, 0, 36, 0);
            PageTitle.Style = (Style) App.Current.Resources["PageTitle"];
            PageTitle.TextWrapping = TextWrapping.NoWrap;
            PageTitle.Margin = new Thickness(20, 0, 0, 7);

            if (displayType == DisplayModeType.Snapped)
            {
                SnappedListView.Visibility = Visibility.Visible;
                FullGridView.Visibility = Visibility.Collapsed;
                GoBack.Margin = new Thickness(5, 0, 5, 0);
                PageTitle.Margin = new Thickness(10, 0, 0, 0);
                PageTitle.Style = (Style)App.Current.Resources["SnappedPageTitle"];
                PageTitle.TextWrapping = TextWrapping.Wrap;
            }
        }
コード例 #11
0
        protected override void HandleLayoutChange(DisplayModeType displayType)
        {
            SnappedListView.Visibility = Visibility.Collapsed;
            FullGridView.Visibility    = Visibility.Visible;
            GoBack.Margin          = new Thickness(36, 0, 36, 0);
            PageTitle.Style        = (Style)App.Current.Resources["PageTitle"];
            PageTitle.TextWrapping = TextWrapping.NoWrap;
            PageTitle.Margin       = new Thickness(20, 0, 0, 7);

            if (displayType == DisplayModeType.Snapped)
            {
                SnappedListView.Visibility = Visibility.Visible;
                FullGridView.Visibility    = Visibility.Collapsed;
                GoBack.Margin          = new Thickness(5, 0, 5, 0);
                PageTitle.Margin       = new Thickness(10, 0, 0, 0);
                PageTitle.Style        = (Style)App.Current.Resources["SnappedPageTitle"];
                PageTitle.TextWrapping = TextWrapping.Wrap;
            }
        }
コード例 #12
0
ファイル: JobReader.cs プロジェクト: rs38/ediabaslib
            public PageInfo(string xmlFileName, string name, float weight, DisplayModeType displayMode, int textResId, int gaugesPortrait, int gaugesLandscape, string logFile, string dbName, bool jobActivate, string classCode, bool codeShowWarnings, JobsInfo jobsInfo, ErrorsInfo errorsInfo, List <DisplayInfo> displayList, List <StringInfo> stringList)
            {
                XmlFileName      = xmlFileName;
                Name             = name;
                Weight           = weight;
                DisplayMode      = displayMode;
                TextResId        = textResId;
                GaugesPortrait   = gaugesPortrait;
                GaugesLandscape  = gaugesLandscape;
                LogFile          = logFile;
                DbName           = dbName;
                JobActivate      = jobActivate;
                ClassCode        = classCode;
                CodeShowWarnings = codeShowWarnings;
                JobsInfo         = jobsInfo;
                ErrorsInfo       = errorsInfo;
                DisplayList      = displayList;
                StringList       = stringList;

                string assetFileName = Path.GetFileName(ActivityCommon.AssetFileName) ?? string.Empty;

                UseCompatIds = string.Compare(dbName, assetFileName, StringComparison.OrdinalIgnoreCase) != 0;

                CompatIdsUsed = false;
                if (JobsInfo != null)
                {
                    foreach (JobInfo jobInfo in JobsInfo.JobList)
                    {
                        jobInfo.UseCompatIds = UseCompatIds;
                        if (UseCompatIds && !string.IsNullOrWhiteSpace(jobInfo.FixedFuncStructId))
                        {
                            CompatIdsUsed = true;
                            break;
                        }
                    }
                }

                InfoObject  = null;
                ClassObject = null;
            }
コード例 #13
0
        private static void Update_CurrentDisplayMode(RhinoDoc doc)
        {
            var modeName = Get_CurrentDisplayMode_EnglishName(doc);

            CurrentDisplayMode = DisplayModeType.Other;
            if (modeName == "SolidFix_Ghosted")
            {
                CurrentDisplayMode = DisplayModeType.Ghosted;
            }
            if (modeName == "SolidFix_Topology")
            {
                CurrentDisplayMode = DisplayModeType.Topology;
            }
            if (modeName == "SolidFix_Mesh")
            {
                CurrentDisplayMode = DisplayModeType.Mesh;
            }
            if (modeName == "SolidFix_TopologyColoredSurfaces")
            {
                CurrentDisplayMode = DisplayModeType.TopologyColoredSurfaces;
            }
        }
コード例 #14
0
 protected virtual void HandleLayoutChange(DisplayModeType displayType)
 {
     return;
 }
コード例 #15
0
 public static void ObjectAttributes_SetDisplayModeOverride(ObjectAttributes attr, DisplayModeType modeType)
 {
     using (var m = new DisplayModesManager())
     {
         var mode = m.GetMode(modeType);
         if (mode != null)
         {
             attr.SetDisplayModeOverride(mode);
         }
     }
 }
コード例 #16
0
 protected virtual void HandleLayoutChange(DisplayModeType displayType)
 {
     return;
 }
コード例 #17
0
        /// <summary>
        /// Load the settings from the file
        /// </summary>
        /// <exception cref="Exception">Can throw exception</exception>
        private void LoadFromFile()
        {
            XmlTextReader reader = null;

            try
            {
                //the settings file doesn't exist, this might be the first time the application ran, so load the defaults
                if (!File.Exists(Settings.SettingsFile))
                {
                    this.RestoreDefaults();
                    return;
                }

                reader = new XmlTextReader(Settings.SettingsFile);
                reader.WhitespaceHandling = WhitespaceHandling.None;
                reader.MoveToContent();

                if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "Settings"))
                {
                    //read to the first element
                    if (!reader.Read())
                    {
                        throw (new Exception("Unable to read first token."));
                    }

                    while (true)
                    {
                        if ((reader.NodeType == XmlNodeType.EndElement) && (reader.Name == "Settings"))
                        {
                            break;
                        }

                        string tag  = reader.Name;
                        string text = reader.ReadElementString();
                        if (tag == "DisplayMode")
                        {
                            this.displayMode = (DisplayModeType)Enum.Parse(typeof(DisplayModeType), text);
                        }
                        else if (tag == "BackgroundColor")
                        {
                            this.backgroundColor = text;
                        }
                        else if (tag == "ChangeAtStartup")
                        {
                            this.changeAtStartup = bool.Parse(text);
                        }
                        else if (tag == "ChangeRandomly")
                        {
                            this.changeRandomly = bool.Parse(text);
                        }
                        else if (tag == "FileListIndex")
                        {
                            this.fileListIndex = int.Parse(text);
                        }
                        else if (tag == "HighResolutionThumbs")
                        {
                            this.highResolutionThumbs = bool.Parse(text);
                        }
                        else if (tag == "ChangeAutomatically")
                        {
                            this.changeAutomatically = bool.Parse(text);
                        }
                        else if (tag == "TimeInterval")
                        {
                            this.timeInterval = uint.Parse(text);
                        }
                        else if (tag == "SelectedImage")
                        {
                            this.selectedImage = text;
                            if (this.selectedImage == "NULL")
                            {
                                this.selectedImage = string.Empty;
                            }
                        }
                        else if (tag == "PresentationImage")
                        {
                            this.presentationImage = text;
                            if (this.presentationImage == "NULL")
                            {
                                this.presentationImage = string.Empty;
                            }
                        }
                        else if (tag == "InPresentationMode")
                        {
                            this.inPresentationMode = bool.Parse(text);
                        }
                        else if (tag == "StartMinimized")
                        {
                            this.startMinimized = bool.Parse(text);
                        }
                        else if (tag == "StartWithWindows")
                        {
                            this.startAutomatically = bool.Parse(text);
                        }
                    }
                }
                else
                {
                    throw (new Exception("Invalid starting token."));
                }
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }
        }