public void SaveExpansionStatus()
    {
        if (AkUtilities.IsWwiseProjectAvailable)
        {
            if (RootItem.Header == "Root item")
            {
                // We were unpopulated, no need to save. But we still need to display the correct data, though.
                AkWwisePicker.PopulateTreeview();
                return;
            }

            if (AkWwiseProjectInfo.GetData() != null)
            {
                var PreviousExpandedItems = AkWwiseProjectInfo.GetData().ExpandedItems;
                AkWwiseProjectInfo.GetData().ExpandedItems.Clear();

                var path = string.Empty;

                if (RootItem.HasChildItems() && RootItem.IsExpanded)
                {
                    SaveExpansionStatus(RootItem, path);
                }

                AkWwiseProjectInfo.GetData().ExpandedItems.Sort();

                if (System.Linq.Enumerable.Count(System.Linq.Enumerable.Except(AkWwiseProjectInfo.GetData().ExpandedItems, PreviousExpandedItems)) > 0)
                {
                    UnityEditor.EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
                }
            }
        }
    }
Beispiel #2
0
        /// <summary>
        /// Gets the item by identifier.
        /// </summary>
        /// <param name="requiredNamespace">The required namespace.</param>
        /// <param name="locale">The locale.</param>
        /// <param name="itemId">The item identifier.</param>
        /// <returns></returns>
        public static async Task <RootItem> GetItemById(string requiredNamespace, string locale, int itemId)
        {
            Console.WriteLine("Début de la recherche d'un item via son ID");
            UriBuilder uriBuilder = new UriBuilder(baseURL);

            uriBuilder.Path = $"data/wow/item/" + itemId.ToString();
            var query = HttpUtility.ParseQueryString(uriBuilder.Query);

            query["namespace"] = requiredNamespace;
            query["locale"]    = locale;
            uriBuilder.Query   = query.ToString();

            var request = AuthentificationRepoAPI.CreateHttpRequest(HttpMethod.Get, uriBuilder.Uri);

            var content = await httpClient.Retry(request);

            if (content != null)
            {
                RootItem result = JsonConvert.DeserializeObject <RootItem>(content);
                if (result != null)
                {
                    Console.WriteLine("Récupération de l'item OK");
                    return(result);
                }
            }

            Console.WriteLine("Récupération de l'item KO");
            return(null);
        }
Beispiel #3
0
        public void UpdatesNextSourceOnPropertyChange()
        {
            var fakeInpc = new Fake {
                Next = new Level {
                    Name = "1"
                }
            };
            var rootItem = new RootItem(fakeInpc);

            var nextName      = NameOf.Property <Fake>(x => x.Next);
            var nextProp      = typeof(Fake).GetProperty(nextName);
            var firstProperty = new PathProperty(null, nextProp);
            var first         = new NotifyingPathItem(rootItem, firstProperty);

            var isTrueName     = NameOf.Property <Level>(x => x.IsTrue);
            var isTrueProp     = typeof(Level).GetProperty(isTrueName);
            var secondProperty = new PathProperty(firstProperty, isTrueProp);
            var second         = new NotifyingPathItem(first, secondProperty);

            Assert.AreSame(fakeInpc.Next, second.Source);
            fakeInpc.Next = new Level {
                Name = "2"
            };
            Assert.AreSame(fakeInpc.Next, second.Source);
        }
Beispiel #4
0
        //add a datasheet plugin root item
        public void AddRibbon(string sender)
        {
            rootHeaderItem           = new RootItem(strPanelKey, strPanelCaption);
            rootHeaderItem.SortOrder = (short)pluginType;
            App.HeaderControl.Add(rootHeaderItem);

            //tell ProjMngr if this is being Shown
            if (sender == "Show")
            {
                //make this the selected root
                App.HeaderControl.SelectRoot(strPanelKey);
            }

            //add sub-ribbon
            string rGroupCaption = strPanelCaption;

            btnRun              = new SimpleActionItem(strPanelKey, "Run", btnRun_Click);
            btnRun.LargeImage   = Properties.Resources.Run;
            btnRun.GroupCaption = rGroupCaption;
            btnRun.Enabled      = true;
            App.HeaderControl.Add(btnRun);

            btnCancel              = new SimpleActionItem(strPanelKey, "Cancel", btnCancel_Click);
            btnCancel.LargeImage   = Properties.Resources.Cancel;
            btnCancel.GroupCaption = rGroupCaption;
            btnCancel.Enabled      = false;
            App.HeaderControl.Add(btnCancel);
        }
Beispiel #5
0
        /// <summary>
        /// Called from OnGUI or EditorWindow.OnGUI
        /// </summary>
        public void DisplayTreeView(TreeViewControl.DisplayTypes displayType)
        {
            if (!m_forceDefaultSkin)
            {
                GUI.skin = m_skinUnselected;
            }

            switch (displayType)
            {
            case TreeViewControl.DisplayTypes.USE_SCROLL_VIEW:
                m_scrollView = GUILayout.BeginScrollView(m_scrollView, GUILayout.MaxWidth(Width), GUILayout.MaxHeight(Height));
                break;

            case TreeViewControl.DisplayTypes.USE_SCROLL_AREA:
                GUILayout.BeginArea(new Rect(X, Y, Width, Height));
                m_scrollView = GUILayout.BeginScrollView(m_scrollView, GUILayout.MaxWidth(Width), GUILayout.MaxHeight(Height));
                break;
            }

            RootItem.DisplayItem(0, TreeViewItem.SiblingOrder.FIRST_CHILD);

            switch (displayType)
            {
            case TreeViewControl.DisplayTypes.USE_SCROLL_VIEW:
                GUILayout.EndScrollView();
                break;

            case TreeViewControl.DisplayTypes.USE_SCROLL_AREA:
                GUILayout.EndScrollView();
                GUILayout.EndArea();
                break;
            }

            GUI.skin = null;
        }
        public void PopulateItem(Type type)
        {
            var          assemblyName = type.Assembly.GetName().Name;
            TreeListItem attachPoint  = RootItem.FindItemByName(assemblyName);

            if (attachPoint == null)
            {
                attachPoint = RootItem.AddItem(assemblyName, false, true, new SystemTypeTreeInfo(assemblyName));
                AddHandlerEvents(attachPoint);
            }

            var namespaces = type.Namespace.Split('.');

            foreach (var ns in namespaces)
            {
                var next = attachPoint.FindItemByName(ns);
                if (next == null)
                {
                    attachPoint = attachPoint.AddItem(ns, false, false, new SystemTypeTreeInfo(ns));
                    AddHandlerEvents(attachPoint);
                }
                else
                {
                    attachPoint = next;
                }
            }
            var t = attachPoint.AddItem(type.Name, true, false, new SystemTypeTreeInfo(type));

            AddHandlerEvents(t);
        }
        private void SecondPass()
        {
            RootItem root = _activeItem as RootItem;

            foreach (BaseItem item in root.Files)
            {
                if (item as AssemblyItem == null)
                {
                    continue;
                }

                AssemblyItem assemblyItem = (AssemblyItem)item;
                string       idFrom       = assemblyItem.PureName();

                // We can use referenced assemblies as a shortcut, rather than
                // running over all the method calls in all loaded files.
                foreach (string asmName in assemblyItem.ReferencedAssemblies)
                {
                    string idTo = asmName;

                    if (this.AddedNodes.ContainsKey(idTo))
                    {
                        this.AddEdge(idFrom, idTo, EdgeStyle.NormalArrow);
                    }
                }
            }
        }
        public void ThrowNewException(HttpResponseMessage httpResponseMessage)
        {
            switch (httpResponseMessage.StatusCode)
            {
            case HttpStatusCode.OK:
                Assert.True(true);
                break;

            case HttpStatusCode.Unauthorized:
                if (String.IsNullOrEmpty(_token))
                {
                    throw new Exception("Oturum Açılamadığı İçin İlgili URL'e Erişelemedi!");
                }
                throw new Exception("Oturum Açılmış Olmasına Rağmen İlgili URL'e Erişelemedi!");
                break;

            case HttpStatusCode.NotFound:
                string   message  = httpResponseMessage.Content.ReadAsStringAsync().Result;
                RootItem rootItem = JsonConvert.DeserializeObject <RootItem>(message);
                if (!String.IsNullOrEmpty(rootItem.message))
                {
                    throw new Exception($"Bir Hataya Rastlandı!\nHata Kodu={rootItem.message}");
                }
                throw new Exception($"Bir Hataya Rastlandı!\nHata Kodu={httpResponseMessage.StatusCode}");
                break;

            default:
                throw new Exception(
                          String.Format($"Beklenmeyen Bir Hata Durumu İle Karılaşıldı.\nHata Kodu={httpResponseMessage.StatusCode}")
                          );
                break;
            }
        }
Beispiel #9
0
        private void SetItems(DisplayFilter filter)
        {
            if (filter == _filter || _allItems.Count == 0)
            {
                return;
            }

            RootItem.ClearAllChildItems();

            foreach (var item in _allItems.Values)
            {
                item.ExecutionOrder = 0;

                if (item.ParentId.HasValue)
                {
                    var parentItem = FindParentItem(item.ParentId.Value, filter);
                    if (filter == DisplayFilter.None || !item.IsInactive)
                    {
                        parentItem.AddChildItem(item);
                    }
                }
            }

            var leafItemSource = _allItems.Values.Where(i => i.IsLeaf);

            if (filter == DisplayFilter.ActiveNodesOnly)
            {
                leafItemSource = leafItemSource.Where(i => !i.IsInactive);
            }

            ResolveExecutionOrder(leafItemSource.ToList());

            _filter = filter;
        }
Beispiel #10
0
        public void Should_Duplicate_FoldersAndChildItems()
        {
            var jobScheduler  = Substitute.For <IJobScheduler>();
            var settingsStore = Substitute.For <ISettingsStore>();

            var rootItem = new RootItem();
            var folder   = new Folder();
            var item1    = new Item();
            var item2    = new Item();

            rootItem.Add(folder);
            folder.Add(item1);
            folder.Add(item2);

            var command = new DuplicateCommand(folder);
            var handler = new DuplicateCommandHandler(jobScheduler, settingsStore);

            handler.Handle(command);

            Assert.IsTrue(rootItem.Items.Count == 2);

            var newFolder = rootItem.Items[1];

            Assert.IsTrue(newFolder.Items.Count == 2);

            Assert.AreSame(newFolder, newFolder.Items[0].Parent);
            Assert.AreSame(newFolder, newFolder.Items[1].Parent);

            jobScheduler.Received(1).Schedule(newFolder, true);

            settingsStore.Received(1).TrySave();
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            var tl = new Nunjsharp.Environment();

            tl.ParseTemplate("parent.html", @"{% block header %}
This is the default content
{% endblock %}
{# Loop through all the users #}
<section class=""left"">
  {% block left %}{% endblock %}
</section>
{{ World[""Of""][""Wonders""] }}
<section class=""right"">
{% block right %}  This is more content {% endblock %}
</section>
");
            tl.ParseTemplate("extends.html", @"{% extends ""parent.html"" %}

{% block left %}            This is the left side!{% endblock %}

{% block right %}{{ super() }}This is the right side!{% endblock %}
");

            var data = new RootItem();

            Trace.TraceInformation(tl.RenderTemplate("extends.html", data));
        }
Beispiel #12
0
        public void ShowTooltip(Point Where, String Tip)
        {
            var item = ConstructWidget(new Widget
            {
                Text      = Tip,
                Border    = "border-dark",
                Font      = TooltipFont,
                TextSize  = TooltipTextSize,
                TextColor = new Vector4(1, 1, 1, 1)
            });

            var       bestSize = item.GetBestSize();
            Rectangle rect     = new Rectangle(
                Where.X + (MousePointer == null ? 0 : GetTileSheet(MousePointer.Sheet).TileWidth) + 2,
                Where.Y, bestSize.X, bestSize.Y);

            rect      = MathFunctions.SnapRect(rect, RealScreen);
            item.Rect = rect;
            RootItem.AddChild(item);

            if (TooltipItem != null)
            {
                DestroyWidget(TooltipItem);
            }

            TooltipItem = item;
        }
Beispiel #13
0
        public void Search(string newKeyword)
        {
            this.Cancel();
            if (RootItem.IsNull() || oldKeyword == newKeyword)
            {
                this.IsSearching = false;
                return;
            }

            this.IsCanceled = false;
            if (newKeyword.IsNullOrEmpty())
            {
                this.oldKeyword  = newKeyword;
                this.IsSearching = false;
                return;
            }

            oldKeyword = newKeyword;
            regPattern = GetRegexPattern(newKeyword);
            //Eric:Temp ignore
            //if (RootItem is CloudFolder)
            //{
            //    SearchCloudFolder(RootItem as CloudFolder);
            //}
            //else
            {
                SearchFolder(RootItem);
            }
        }
        private void FirstPass()
        {
            RootItem root = _activeItem as RootItem;

            foreach (BaseItem item in root.Files)
            {
                if (item as AssemblyItem == null)
                {
                    continue;
                }

                AssemblyItem assemblyItem = (AssemblyItem)item;

                foreach (NamespaceItem nsItem in assemblyItem.NameSpaces)
                {
                    // Use the allow duplicates version of AddNode, which builds a list
                    // of items for a single node. We don't add more than one node per id.
                    this.AddNode(nsItem.Name, nsItem.Name,
                                 _sharedOptions.NamespaceColor, nsItem, true);

                    // Hang onto our namespaces, and keep a list of duplicates.
                    if (_namespaces.ContainsKey(nsItem.GetShortID()))
                    {
                        List <NamespaceItem> list = _namespaces[nsItem.GetShortID()];
                        list.Add(nsItem);
                    }
                    else
                    {
                        List <NamespaceItem> list = new List <NamespaceItem>();
                        list.Add(nsItem);
                        _namespaces.Add(nsItem.GetShortID(), list);
                    }
                }
            }
        }
Beispiel #15
0
        //add a datasheet plugin root item
        void AddIPyPLSRibbon()
        {
            _PLSModelTab           = new RootItem(kPLSModel, _panelName);
            _PLSModelTab.SortOrder = 100;
            App.HeaderControl.Add(_PLSModelTab);



            //add sub-ribbons
            //section for adding data
            const string rGroupCaption = _panelName;

            btnRun              = new SimpleActionItem(kPLSModel, "Run", btnRunn_Click);
            btnRun.LargeImage   = Properties.Resources.Run;
            btnRun.GroupCaption = rGroupCaption;
            btnRun.Enabled      = true;
            App.HeaderControl.Add(btnRun);



            btnGoToPred              = new SimpleActionItem(kPLSModel, "Go To Prediction", _IPyPLS.btnSelectModel_Click);
            btnGoToPred.LargeImage   = Properties.Resources.GoToPrediction;
            btnGoToPred.GroupCaption = rGroupCaption;
            btnGoToPred.Enabled      = false;
            App.HeaderControl.Add(btnGoToPred);
        }
Beispiel #16
0
    public void SaveExpansionStatus()
    {
        if (AkWwisePicker.WwiseProjectFound == true)
        {
            if (RootItem.Header == "Root item")
            {
                // We were unpopulated, no need to save. But we still need to display the correct data, though.
                AkWwisePicker.PopulateTreeview();
                return;
            }

            if (AkWwiseProjectInfo.GetData() != null)
            {
                AkWwiseProjectInfo.GetData().ExpandedItems.Clear();

                string path = string.Empty;

                if (RootItem.HasChildItems() && RootItem.IsExpanded)
                {
                    SaveExpansionStatus(RootItem, path);
                }

                AkWwiseProjectInfo.GetData().ExpandedItems.Sort();
                EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
            }
        }
    }
Beispiel #17
0
        //add a datasheet plugin root item
        void AddDatasheetRibbon()
        {
            _DatasheetTab           = new RootItem(kDataSheet, _panelName);
            _DatasheetTab.SortOrder = 80;
            App.HeaderControl.Add(_DatasheetTab);



            //add sub-ribbons
            //section for adding data
            const string tGroupCaption = "Add";

            btnImport              = new SimpleActionItem(kDataSheet, "Import Data", btnImport_Click);
            btnImport.LargeImage   = Properties.Resources.OpenFile;
            btnImport.GroupCaption = tGroupCaption;
            btnImport.Enabled      = true;
            App.HeaderControl.Add(btnImport);



            //section for validating
            const string grpValidate = "Validate";

            btnValidate              = new SimpleActionItem(kDataSheet, "Validate Data", btnValidate_Click);
            btnValidate.LargeImage   = Properties.Resources.Validate;
            btnValidate.GroupCaption = grpValidate;
            btnValidate.Enabled      = false;
            App.HeaderControl.Add(btnValidate);


            //section for working with data
            const string grpManipulate = "Work with Data";

            btnComputeAO              = new SimpleActionItem(kDataSheet, "Compute A O", _frmDatasheet.btnComputeAO_Click);
            btnComputeAO.LargeImage   = Properties.Resources.Compute;
            btnComputeAO.GroupCaption = grpManipulate;
            btnComputeAO.Enabled      = false;
            App.HeaderControl.Add(btnComputeAO);


            btnManipulate              = new SimpleActionItem(kDataSheet, "Manipulate", _frmDatasheet.btnManipulate_Click);
            btnManipulate.LargeImage   = Properties.Resources.Manipulate;
            btnManipulate.GroupCaption = grpManipulate;
            btnManipulate.Enabled      = false;
            App.HeaderControl.Add(btnManipulate);


            btnTransform              = new SimpleActionItem(kDataSheet, "Transform", _frmDatasheet.btnTransform_Click);
            btnTransform.LargeImage   = Properties.Resources.Transform;
            btnTransform.GroupCaption = grpManipulate;
            btnTransform.Enabled      = false;
            App.HeaderControl.Add(btnTransform);


            btnGoToModeling              = new SimpleActionItem(kDataSheet, "Go To Model", _frmDatasheet.btnGoToModeling_Click);
            btnGoToModeling.LargeImage   = Properties.Resources.GoToModeling;
            btnGoToModeling.GroupCaption = grpManipulate;
            btnGoToModeling.Enabled      = false;
            App.HeaderControl.Add(btnGoToModeling);
        }
Beispiel #18
0
        //add a datasheet plugin root item
        public void AddRibbon(string sender)
        {
            locationTab           = new RootItem(strPanelKey, strPanelCaption);
            locationTab.SortOrder = (short)pluginType;
            App.HeaderControl.Add(locationTab);

            //tell ProjMngr if this is being Shown
            if (sender == "Show")
            {
                //make this the selected root
                App.HeaderControl.SelectRoot(strPanelKey);
            }


            //section for working with data
            const string grpManipulate = "Waste time and space";

            btnNull              = new SimpleActionItem(strPanelKey, "Do nothing!", btnNull_Click);
            btnNull.LargeImage   = Properties.Resources.USGS;
            btnNull.GroupCaption = grpManipulate;
            btnNull.Enabled      = false;
            App.HeaderControl.Add(btnNull);

            //var validateBtn = new SimpleActionItem("Validate", btnValidate_Click) { RootKey = kVBLocation, ToolTipText = "Validate Data", LargeImage = Properties.Resources.validate };
            //App.HeaderControl.Add(validateBtn);

            //var computeBtn = new SimpleActionItem("Compute", btnCompute_Click) { RootKey = kVBLocation, ToolTipText = "Compute" };
            //App.HeaderControl.Add(computeBtn);

            //var manipulateBtn = new SimpleActionItem("Manipulate", btnManipulate_Click) { RootKey = kVBLocation, ToolTipText = "Manipulate", LargeImage = Properties.Resources.manipulate };
            //App.HeaderControl.Add(manipulateBtn);

            //var transformBtn = new SimpleActionItem("Transform", btnTransform_Click) { RootKey = kVBLocation, ToolTipText = "Transform", LargeImage = Properties.Resources.transform };
            //App.HeaderControl.Add(transformBtn);
        }
Beispiel #19
0
 public CSharpBar(IWpfTextView textView)
 {
     _View = textView;
     _SyntaxNodeRangeAdornment = _View.GetAdornmentLayer(SyntaxNodeRange);
     _SymbolListContainer      = new ExternalAdornment(_View);
     _SemanticContext          = textView.Properties.GetOrCreateSingletonProperty(() => new SemanticContext(textView));
     this.SetBackgroundForCrispImage(ThemeHelper.TitleBackgroundColor);
     textView.Properties.AddProperty(nameof(NaviBar), this);
     Name      = nameof(CSharpBar);
     Resources = SharedDictionaryManager.Menu;
     SetResourceReference(BackgroundProperty, VsBrushes.CommandBarMenuBackgroundGradientKey);
     SetResourceReference(ForegroundProperty, VsBrushes.CommandBarTextInactiveKey);
     Items.Add(_RootItem = new RootItem(this));
     _View.Selection.SelectionChanged += Update;
     _View.Closed += ViewClosed;
     Update(this, EventArgs.Empty);
     if (_SemanticContext.Compilation != null)
     {
         foreach (var m in _SemanticContext.Compilation.Members)
         {
             if (m.IsKind(SyntaxKind.NamespaceDeclaration))
             {
                 _RootItem.SetText(m.GetDeclarationSignature());
                 break;
             }
         }
     }
 }
        private void SetRootItem(object newValue)
        {
            if (RootItem != null)
            {
                RootItem.Owner = null;
                RootItem.ClearValue(ViewItem.ItemsSourceProperty);
                ItemsContainer.Children.Remove(RootItem);
            }

            if (ItemsContainer != null)
            {
                RootItem = new ViewItem()
                {
                    Content         = newValue,
                    ContentTemplate = ItemTemplate,
                    Owner           = this
                };

                if (ItemTemplate is HierarchicalDataTemplate)
                {
                    var binding = (ItemTemplate as HierarchicalDataTemplate).ItemsSource;
                    BindingOperations.SetBinding(RootItem, ViewItem.ItemsSourceProperty, binding);
                }

                ItemsContainer.Children.Add(RootItem);
            }
        }
 /// <summary>Performs the final opreations after a scan.</summary>
 /// <param name="token"></param>
 private void FinishScan(CancellationToken token)
 {
     scanningStates = null;
     if (!token.IsCancellationRequested)
     {
         RootItem.Finish();
     }
 }
Beispiel #22
0
        //add a datasheet plugin root item
        public void AddRibbon(string sender)
        {
            rootDatasheetTab           = new RootItem(strPanelKey, strPanelCaption);
            rootDatasheetTab.SortOrder = (short)pluginType;
            App.HeaderControl.Add(rootDatasheetTab);

            //tell ProjMngr if this is being Shown
            if (sender == "Show")
            {
                //make this the selected root
                App.HeaderControl.SelectRoot(strPanelKey);
            }

            //add sub-ribbons
            const string tGroupCaption = "Add";

            btnImport              = new SimpleActionItem(strPanelKey, "Import Data", btnImport_Click);
            btnImport.LargeImage   = Properties.Resources.Import;
            btnImport.GroupCaption = tGroupCaption;
            btnImport.Enabled      = true;
            App.HeaderControl.Add(btnImport);

            //section for validating
            const string grpValidate = "Validate";

            btnValidate              = new SimpleActionItem(strPanelKey, "Validate Data", btnValidate_Click);
            btnValidate.LargeImage   = Properties.Resources.Validate;
            btnValidate.GroupCaption = grpValidate;
            btnValidate.Enabled      = false;
            App.HeaderControl.Add(btnValidate);

            //section for working with data
            const string grpManipulate = "Work with Data";

            btnComputeAO              = new SimpleActionItem(strPanelKey, "Compute A O", _frmDatasheet.btnComputeAO_Click);
            btnComputeAO.LargeImage   = Properties.Resources.Compute;
            btnComputeAO.GroupCaption = grpManipulate;
            btnComputeAO.Enabled      = false;
            App.HeaderControl.Add(btnComputeAO);

            btnManipulate              = new SimpleActionItem(strPanelKey, "Manipulate", _frmDatasheet.btnManipulate_Click);
            btnManipulate.LargeImage   = Properties.Resources.Manipulate;
            btnManipulate.GroupCaption = grpManipulate;
            btnManipulate.Enabled      = false;
            App.HeaderControl.Add(btnManipulate);

            btnTransform              = new SimpleActionItem(strPanelKey, "Transform", _frmDatasheet.btnTransform_Click);
            btnTransform.LargeImage   = Properties.Resources.Transform;
            btnTransform.GroupCaption = grpManipulate;
            btnTransform.Enabled      = false;
            App.HeaderControl.Add(btnTransform);

            btnGoToModeling              = new SimpleActionItem(strPanelKey, "Go To Model", btnGoToModeling_Click);
            btnGoToModeling.LargeImage   = Properties.Resources.GoToModeling;
            btnGoToModeling.GroupCaption = grpManipulate;
            btnGoToModeling.Enabled      = false;
            App.HeaderControl.Add(btnGoToModeling);
        }
Beispiel #23
0
        //Add a HydroR root item
        void AddHydroRRibbon()
        {
            _hydroRTab           = new RootItem(kHydroR, _panelName);
            _hydroRTab.SortOrder = 60;
            App.HeaderControl.Add(_hydroRTab);

            string rGroupCaption  = _panelName + " Tools";
            string rScriptCaption = "Script";

            _btnR              = new SimpleActionItem(kHydroR, "Start R", _hydroRControl.btnR_Click);
            _btnR.Key          = "kBtnR";
            _btnR.LargeImage   = Properties.Resources.Ricon;
            _btnR.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(_btnR);

            var btnGenR = new SimpleActionItem(kHydroR, "Generate R Code", _hydroRControl.txtGenR_Click);

            btnGenR.LargeImage   = Properties.Resources.GenerateR;
            btnGenR.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnGenR);

            var btnSendLine = new SimpleActionItem(kHydroR, "Send Line", _hydroRControl.btnSend_Click);

            btnSendLine.LargeImage   = Properties.Resources.SendLine;
            btnSendLine.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnSendLine);

            var btnSendSel = new SimpleActionItem(kHydroR, "Send Selection", _hydroRControl.btnSendSel_Click);

            btnSendSel.LargeImage   = Properties.Resources.SendSelection;
            btnSendSel.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnSendSel);

            var btnSendAll = new SimpleActionItem(kHydroR, "Send All", _hydroRControl.btnSendAll_Click);

            btnSendAll.LargeImage   = Properties.Resources.SendScript;
            btnSendAll.GroupCaption = rGroupCaption;
            App.HeaderControl.Add(btnSendAll);

            var btnOpen = new SimpleActionItem(kHydroR, "Open Script", _hydroRControl.btnOpen_Click);

            btnOpen.LargeImage   = Properties.Resources.OpenFile;
            btnOpen.GroupCaption = rScriptCaption;
            App.HeaderControl.Add(btnOpen);

            var btnSave = new SimpleActionItem(kHydroR, "Save Script", _hydroRControl.btnSave_Click);

            btnSave.LargeImage   = Properties.Resources.SaveFile;
            btnSave.GroupCaption = rScriptCaption;
            App.HeaderControl.Add(btnSave);

            _btnSettings              = new SimpleActionItem(kHydroR, "Path to R", _hydroRControl.btnSettings_Click);
            _btnSettings.LargeImage   = Properties.Resources.RSettings_32;
            _btnSettings.SmallImage   = Properties.Resources.RSettings_16;
            _btnSettings.GroupCaption = "Settings";
            _btnSettings.Click       += new EventHandler(_hydroRControl.btnSettings_Click);
            App.HeaderControl.Add(_btnSettings);
        }
Beispiel #24
0
        public Project(IManager manager)
        {
            mManager  = manager;
            mRootItem = new RootItem(this);

            mProjectName         = "New Project";
            mUserDocument        = CreateEmptyUserDocument();
            mUserOptionsDatabase = new XmlOptionsDatabase((XmlElement)mUserDocument.SelectSingleNode("UserConfiguration"));
        }
Beispiel #25
0
        void ProjectDocument_Loaded(Document sender)
        {
            --mLoading;

            if (mLoading == 0)
            {
                ProjectDocumentItem item = RootItem.FindDocument(sender.FileName) as ProjectDocumentItem;
                OnProjectReloaded(item);
            }
        }
Beispiel #26
0
        /// <summary>
        /// Show a widget as a popup. Replaces any existing popup widget already displayed.
        /// </summary>
        /// <param name="Popup"></param>
        public void ShowPopup(Widget Popup, PopupExclusivity Exclusivity = PopupExclusivity.AddToStack)
        {
            if (Exclusivity == PopupExclusivity.DestroyExistingPopups)
            {
                CleanupPopupStack();
            }

            PopupStack.Add(Popup);
            RootItem.AddChild(Popup);
        }
Beispiel #27
0
        public void SignalsValue()
        {
            var item = new RootItem(null);

            item.ObservePropertyChanged(x => x.Value, false)
            .Subscribe(_changes.Add);
            Assert.AreEqual(0, _changes.Count);
            item.Value = new object();
            Assert.AreEqual(1, _changes.Count);
        }
Beispiel #28
0
        void AddMLRRibbon()
        {
            _MLRpredTab           = new RootItem(kIPyPrediction, _panelName);
            _MLRpredTab.SortOrder = 110;
            App.HeaderControl.Add(_MLRpredTab);

            //subribbon
            const string rGroupCaption = "Import";

            btnImportIVs              = new SimpleActionItem(kIPyPrediction, "Import IVs", _frmIPyPred.btnImportIVs_Click);
            btnImportIVs.LargeImage   = Properties.Resources.ImportIVs;
            btnImportIVs.GroupCaption = rGroupCaption;
            btnImportIVs.Enabled      = true;
            App.HeaderControl.Add(btnImportIVs);

            btnImportOBs              = new SimpleActionItem(kIPyPrediction, "Import OBs", _frmIPyPred.btnImportObs_Click);
            btnImportOBs.LargeImage   = Properties.Resources.ImportOBs;
            btnImportOBs.GroupCaption = rGroupCaption;
            btnImportOBs.Enabled      = true;
            App.HeaderControl.Add(btnImportOBs);

            const string sGroupCaption = "Manipulate";

            btnPlot              = new SimpleActionItem(kIPyPrediction, "Plot", _frmIPyPred.btnPlot_Click);
            btnPlot.LargeImage   = Properties.Resources.Plot;
            btnPlot.GroupCaption = sGroupCaption;
            btnPlot.Enabled      = true;
            App.HeaderControl.Add(btnPlot);

            btnClear              = new SimpleActionItem(kIPyPrediction, "Clear", _frmIPyPred.btnClearTable_Click);
            btnClear.LargeImage   = Properties.Resources.Clear;
            btnClear.GroupCaption = sGroupCaption;
            btnClear.Enabled      = true;
            App.HeaderControl.Add(btnClear);

            btnExportAsCSV              = new SimpleActionItem(kIPyPrediction, "Export as CSV", _frmIPyPred.btnExportTable_Click);
            btnExportAsCSV.LargeImage   = Properties.Resources.ExportAsCSV;
            btnExportAsCSV.GroupCaption = sGroupCaption;
            btnExportAsCSV.Enabled      = true;
            App.HeaderControl.Add(btnExportAsCSV);

            const string tGroupCaption = "Validate";

            btnIVDataValidation              = new SimpleActionItem(kIPyPrediction, "IV Data Validation", _frmIPyPred.btnIVDataValidation_Click);
            btnIVDataValidation.LargeImage   = Properties.Resources.IVDataVal;
            btnIVDataValidation.GroupCaption = tGroupCaption;
            btnIVDataValidation.Enabled      = true;
            App.HeaderControl.Add(btnIVDataValidation);

            btnMakePrediction              = new SimpleActionItem(kIPyPrediction, "Make Predictions", _frmIPyPred.btnMakePredictions_Click);
            btnMakePrediction.LargeImage   = Properties.Resources.MakePred;
            btnMakePrediction.GroupCaption = tGroupCaption;
            btnMakePrediction.Enabled      = true;
            App.HeaderControl.Add(btnMakePrediction);
        }
Beispiel #29
0
        public void Signals()
        {
            int count = 0;
            var item  = new RootItem(null);

            item.ObservePropertyChanged(x => x.Source, false)
            .Subscribe(_ => count++);
            Assert.AreEqual(0, count);
            item.Value = new object();
            Assert.AreEqual(1, count);
        }
Beispiel #30
0
        /// <summary>
        /// Show a widget as a popup. Replaces any existing popup widget already displayed.
        /// </summary>
        /// <param name="Popup"></param>
        public void ShowPopup(Widget Popup, bool DestroyOnOffClick)
        {
            if (PopupItem != null)
            {
                SafeCall(PopupItem.OnPopupClose, PopupItem);
                DestroyWidget(PopupItem);
            }

            PopupItem = Popup;
            DestroyPopupOnOffClick = DestroyOnOffClick;
            RootItem.AddChild(PopupItem);
        }
 public virtual void TestRefreshIsUnaffectedByPrefetchingBehavior()
 {
     var oc1 = Db();
     var oc2 = OpenNewSession();
     oc1.Configure().ClientServer().PrefetchDepth(1);
     oc2.Configure().ClientServer().PrefetchDepth(1);
     try
     {
         Item itemFromClient1 = new RootItem
             (new Item());
         oc1.Store(itemFromClient1);
         oc1.Commit();
         itemFromClient1.child = null;
         oc1.Store(itemFromClient1);
         Item itemFromClient2 = ((RootItem
             ) RetrieveOnlyInstance(oc2, typeof (RootItem)));
         Assert.IsNotNull(itemFromClient2.child);
         oc1.Rollback();
         itemFromClient2 = ((RootItem) RetrieveOnlyInstance(oc2
             , typeof (RootItem)));
         oc2.Refresh(itemFromClient2, int.MaxValue);
         Assert.IsNotNull(itemFromClient2.child);
         oc1.Commit();
         itemFromClient2 = ((RootItem) RetrieveOnlyInstance(oc2
             , typeof (RootItem)));
         Assert.IsNotNull(itemFromClient2.child);
         oc1.Store(itemFromClient1);
         oc1.Commit();
         oc2.Refresh(itemFromClient2, int.MaxValue);
         itemFromClient2 = ((RootItem) RetrieveOnlyInstance(oc2
             , typeof (RootItem)));
         Assert.IsNull(itemFromClient2.child);
     }
     finally
     {
         oc2.Close();
     }
 }