private void PreviousButton_Click(object sender, RoutedEventArgs e)
 {
     if (CodeBehind.index - 1 <= 0)
     {
         return;
     }
     CodeBehind.index--;
     CodeBehind.Seteaza_Controler(this);
 }
 private void NextButton_Click(object sender, RoutedEventArgs e)
 {
     if (CodeBehind.index > CodeBehind._frames.Count - 1)
     {
         return;
     }
     CodeBehind.index++;
     CodeBehind.Seteaza_Controler(this);
 }
Beispiel #3
0
        static IType CreateCodeBesideClass(DocumentInfo info, DocumentReferenceManager refman)
        {
            var v = new MemberListVisitor(info.AspNetDocument, refman);

            info.AspNetDocument.RootNode.AcceptVisit(v);
            var t = new DomType(info.ClassName);

            t.CompilationUnit = new CompilationUnit(info.AspNetDocument.FileName);
            var dom      = refman.TypeCtx.ProjectDom;
            var baseType = dom.GetType(info.BaseType);

            foreach (var m in CodeBehind.GetDesignerMembers(v.Members.Values, baseType, null, dom, null))
            {
                t.Add(new DomField(m.Name, Modifiers.Protected, m.Location, new DomReturnType(m.Type)));
            }
            return(t);
        }
Beispiel #4
0
        static IUnresolvedTypeDefinition CreateCodeBesideClass(DocumentInfo info, DocumentReferenceManager refman)
        {
            var v = new MemberListVisitor(refman);

            info.AspNetDocument.RootNode.AcceptVisit(v);
            var t        = new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedTypeDefinition(info.ClassName);
            var dom      = refman.TypeCtx.Compilation;
            var baseType = ReflectionHelper.ParseReflectionName(info.BaseType).Resolve(dom);

            foreach (var m in CodeBehind.GetDesignerMembers(v.Members.Values, baseType, null))
            {
                t.Members.Add(new ICSharpCode.NRefactory.TypeSystem.Implementation.DefaultUnresolvedField(t, m.Name)
                {
                    Accessibility = Accessibility.Protected,
                    ReturnType    = m.Type.ToTypeReference()
                });
            }
            return(t);
        }
        void AsyncUpdateDesignerFile(object sender, EventArgs e)
        {
            if (project == null)
            {
                return;
            }

            var file = project.GetProjectFile(FileName);

            if (file == null)
            {
                return;
            }

            var designerFile = CodeBehind.GetDesignerFile(file);

            if (designerFile == null)
            {
                return;
            }

            System.Threading.ThreadPool.QueueUserWorkItem(r => {
                using (var monitor = MonoDevelop.Ide.IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor(
                           GettextCatalog.GetString("Updating ASP.NET Designer File..."), null, false))
                {
                    var writer = CodeBehindWriter.CreateForProject(monitor, project);
                    var result = CodeBehind.UpdateDesignerFile(writer, project, file, designerFile);
                    //don't worry about reporting error's here for now
                    //if the user wants to see errors, they can compile
                    if (!result.Failed)
                    {
                        writer.WriteOpenFiles();
                    }
                }
            });
        }
Beispiel #6
0
 private void OnLoadTradePointsCustomersUC()
 {
     CodeBehind.LoadView(ViewType.TradePointsCustomers);
 }
Beispiel #7
0
 private void OnLoadProductsUC()
 {
     CodeBehind.LoadView(ViewType.Products);
 }
 private void OnToLoginGroupViewExecuted(object p)
 {
     CodeBehind.LoadView(ViewType.LoginGroup);
 }
 private void RunButton_Click(object sender, RoutedEventArgs e)
 {
     CodeBehind.RuleazaAlgormitmul(this);
 }
Beispiel #10
0
 private void OnLoadTradePointsSalesUC()
 {
     CodeBehind.LoadView(ViewType.TradePointsSales);
 }
 private void OnLoadMain()
 {
     CodeBehind.LoadView(ViewType.Authorization);
 }
 private void OnLoadForum_main()
 {
     CodeBehind.LoadView(ViewType.Forum);
     //System.Windows.MessageBox.Show("123");
 }
Beispiel #13
0
 private void OnLoadEmployeesUC()
 {
     CodeBehind.LoadView(ViewType.Employees);
 }
 private void OnLoadInfo()
 {
     CodeBehind.LoadView(ViewType.Info);
 }
 private void OnLoadFirstUC()
 {
     CodeBehind.LoadView(ViewType.Registration);
 }
 private void OnLoadMainPage()
 {
     CodeBehind.LoadView(ViewType.MainPage);
 }
 private void On_ExitAccount()
 {
     //CodeBehind.LoadView(ViewType.Forum);
     //System.Windows.MessageBox.Show("123");
     CodeBehind.ButExitAccount();
 }
 private void OnLoadAuthorization()
 {
     //CodeBehind.LoadView(ViewType.Forum);
     //System.Windows.MessageBox.Show("123");
     CodeBehind.HeadButAuthorization();
 }
Beispiel #19
0
 private void OnLoadOrdersUC()
 {
     CodeBehind.LoadView(ViewType.Orders);
 }
 private void OnLoadAuctions()
 {
     CodeBehind.LoadView(ViewType.Auctions);
 }
Beispiel #21
0
 private void OnLoadSuppliesUC()
 {
     CodeBehind.LoadView(ViewType.Supplies);
 }
 private void OnLoadSecondUC()
 {
     CodeBehind.LoadView(ViewType.Second);
 }
Beispiel #23
0
 private void OnLoadTradePointsPaymentsUC()
 {
     CodeBehind.LoadView(ViewType.TradePointsPayments);
 }
 private void LoadButton_Click(object sender, RoutedEventArgs e)
 {
     CodeBehind.Incarca_gramatica();
 }
        void AddAspAttributeValueCompletionData(CompletionDataList list, XName tagName, XName attName, string id)
        {
            Debug.Assert(tagName.IsValid && tagName.HasPrefix);
            Debug.Assert(attName.IsValid && !attName.HasPrefix);

            INamedTypeSymbol controlClass = refman.GetControlType(tagName.Prefix, tagName.Name);

            if (controlClass == null)
            {
                return;
            }

            //find the codebehind class
            INamedTypeSymbol codeBehindClass;

            GetCodeBehind(out codeBehindClass);

            //if it's an event, suggest compatible methods
            if (codeBehindClass != null && attName.Name.StartsWith("On", StringComparison.Ordinal))
            {
                string eventName = attName.Name.Substring(2);

                foreach (IEventSymbol ev in controlClass.GetAccessibleMembersInThisAndBaseTypes <IEventSymbol> (controlClass))
                {
                    if (ev.Name == eventName)
                    {
                        var domMethod = BindingService.MDDomToCodeDomMethod(ev);
                        if (domMethod == null)
                        {
                            return;
                        }

                        foreach (IMethodSymbol meth
                                 in BindingService.GetCompatibleMethodsInClass(codeBehindClass, ev))
                        {
                            list.Add(meth.Name, "md-method",
                                     GettextCatalog.GetString("A compatible method in the CodeBehind class"));
                        }

                        string suggestedIdentifier = ev.Name;
                        if (id != null)
                        {
                            suggestedIdentifier = id + "_" + suggestedIdentifier;
                        }
                        else
                        {
                            suggestedIdentifier = tagName.Name + "_" + suggestedIdentifier;
                        }

                        domMethod.Name = BindingService.GenerateIdentifierUniqueInClass
                                             (codeBehindClass, suggestedIdentifier);
                        domMethod.Attributes = (domMethod.Attributes & ~System.CodeDom.MemberAttributes.AccessMask)
                                               | System.CodeDom.MemberAttributes.Family;

                        list.Add(
                            new SuggestedHandlerCompletionData(project, domMethod, codeBehindClass,
                                                               CodeBehind.GetNonDesignerClassLocation(codeBehindClass))
                            );
                        return;
                    }
                }
            }

            //if it's a property and is an enum or bool, suggest valid values
            foreach (IPropertySymbol prop in GetAllMembers <IPropertySymbol> (controlClass))
            {
                if (prop.Name != attName.Name)
                {
                    continue;
                }

                //boolean completion
                if (prop.GetReturnType().Equals(refman.Compilation.GetTypeByMetadataName("System.Boolean")))
                {
                    AddBooleanCompletionData(list);
                    return;
                }
                //color completion
                if (prop.GetReturnType().Equals(refman.Compilation.GetTypeByMetadataName("System.Drawing.Color")))
                {
                    var conv = new System.Drawing.ColorConverter();
                    foreach (System.Drawing.Color c in conv.GetStandardValues(null))
                    {
                        if (c.IsSystemColor)
                        {
                            continue;
                        }
                        string hexcol = string.Format("#{0:x2}{1:x2}{2:x2}", c.R, c.G, c.B);
                        list.Add(c.Name, hexcol);
                    }
                    return;
                }

                //enum completion
                var retCls = prop.GetReturnType() as INamedTypeSymbol;
                if (retCls != null && retCls.TypeKind == TypeKind.Enum)
                {
                    foreach (var enumVal in GetAllMembers <IFieldSymbol> (retCls))
                    {
                        if (enumVal.DeclaredAccessibility == Accessibility.Public && enumVal.IsStatic)
                        {
                            list.Add(enumVal.Name, "md-literal", Ambience.GetSummaryMarkup(enumVal));
                        }
                    }
                    return;
                }
            }
        }
Beispiel #26
0
 private void OnLoadProductsCommandExecuted(object p) => CodeBehind.LoadView(ViewType.PRODUCTS);
 private void OnLoadFirstUC()
 {
     CodeBehind.LoadView(ViewType.First);
 }
 private void CompileButton_Click(object sender, RoutedEventArgs e)
 {
     CodeBehind.Compileaza();
 }
 private void OnLoadMainUC()
 {
     CodeBehind.LoadView(ViewType.Main);
 }
Beispiel #30
0
 private void OnLoadAdminToolsCommandExecuted(object p) => CodeBehind.LoadView(ViewType.ADMIN_TOOLS);